repo
stringclasses
10 values
instance_id
stringlengths
18
32
html_url
stringlengths
41
55
feature_patch
stringlengths
805
8.42M
test_patch
stringlengths
548
207k
doc_changes
listlengths
0
92
version
stringclasses
57 values
base_commit
stringlengths
40
40
PASS2PASS
listlengths
0
3.51k
FAIL2PASS
listlengths
0
5.17k
augmentations
dict
mask_doc_diff
listlengths
0
92
problem_statement
stringlengths
0
54.8k
pydata/xarray
pydata__xarray-3425
https://github.com/pydata/xarray/pull/3425
diff --git a/MANIFEST.in b/MANIFEST.in index a006660e5fb..4d5c34f622c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,4 @@ prune doc/generated global-exclude .DS_Store include versioneer.py include xarray/_version.py +recursive-include xarray/static * diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 9d3e64badb8..12bed8f332e 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -36,6 +36,12 @@ New Features ``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``. Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken. +- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve + representation of objects in jupyter. By default this feature is turned off + for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`. + (:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and + `Julia Signell <https://github.com/jsignell>`_. + Bug fixes ~~~~~~~~~ - Fix regression introduced in v0.14.0 that would cause a crash if dask is installed diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 08d4f54764f..cba0c74aa3a --- a/setup.py +++ b/setup.py @@ -104,5 +104,7 @@ tests_require=TESTS_REQUIRE, url=URL, packages=find_packages(), - package_data={"xarray": ["py.typed", "tests/data/*"]}, + package_data={ + "xarray": ["py.typed", "tests/data/*", "static/css/*", "static/html/*"] + }, ) diff --git a/xarray/core/common.py b/xarray/core/common.py index 45d860a1797..1a8cf34ed39 100644 --- a/xarray/core/common.py +++ b/xarray/core/common.py @@ -1,5 +1,6 @@ import warnings from contextlib import suppress +from html import escape from textwrap import dedent from typing import ( Any, @@ -18,10 +19,10 @@ import numpy as np import pandas as pd -from . import dtypes, duck_array_ops, formatting, ops +from . import dtypes, duck_array_ops, formatting, formatting_html, ops from .arithmetic import SupportsArithmetic from .npcompat import DTypeLike -from .options import _get_keep_attrs +from .options import OPTIONS, _get_keep_attrs from .pycompat import dask_array_type from .rolling_exp import RollingExp from .utils import Frozen, ReprObject, either_dict_or_kwargs @@ -134,6 +135,11 @@ def __array__(self: Any, dtype: DTypeLike = None) -> np.ndarray: def __repr__(self) -> str: return formatting.array_repr(self) + def _repr_html_(self): + if OPTIONS["display_style"] == "text": + return f"<pre>{escape(repr(self))}</pre>" + return formatting_html.array_repr(self) + def _iter(self: Any) -> Iterator[Any]: for n in range(len(self)): yield self[n] diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 12d5cbdc9f3..eba580f84bd 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3,6 +3,7 @@ import sys import warnings from collections import defaultdict +from html import escape from numbers import Number from pathlib import Path from typing import ( @@ -39,6 +40,7 @@ dtypes, duck_array_ops, formatting, + formatting_html, groupby, ops, resample, @@ -1619,6 +1621,11 @@ def to_zarr( def __repr__(self) -> str: return formatting.dataset_repr(self) + def _repr_html_(self): + if OPTIONS["display_style"] == "text": + return f"<pre>{escape(repr(self))}</pre>" + return formatting_html.dataset_repr(self) + def info(self, buf=None) -> None: """ Concise summary of a Dataset variables and attributes. diff --git a/xarray/core/formatting_html.py b/xarray/core/formatting_html.py new file mode 100644 index 00000000000..b03ecc12962 --- /dev/null +++ b/xarray/core/formatting_html.py @@ -0,0 +1,274 @@ +import uuid +import pkg_resources +from collections import OrderedDict +from functools import partial +from html import escape + +from .formatting import inline_variable_array_repr, short_data_repr + + +CSS_FILE_PATH = "/".join(("static", "css", "style.css")) +CSS_STYLE = pkg_resources.resource_string("xarray", CSS_FILE_PATH).decode("utf8") + + +ICONS_SVG_PATH = "/".join(("static", "html", "icons-svg-inline.html")) +ICONS_SVG = pkg_resources.resource_string("xarray", ICONS_SVG_PATH).decode("utf8") + + +def short_data_repr_html(array): + """Format "data" for DataArray and Variable.""" + internal_data = getattr(array, "variable", array)._data + if hasattr(internal_data, "_repr_html_"): + return internal_data._repr_html_() + return escape(short_data_repr(array)) + + +def format_dims(dims, coord_names): + if not dims: + return "" + + dim_css_map = { + k: " class='xr-has-index'" if k in coord_names else "" for k, v in dims.items() + } + + dims_li = "".join( + f"<li><span{dim_css_map[dim]}>" f"{escape(dim)}</span>: {size}</li>" + for dim, size in dims.items() + ) + + return f"<ul class='xr-dim-list'>{dims_li}</ul>" + + +def summarize_attrs(attrs): + attrs_dl = "".join( + f"<dt><span>{escape(k)} :</span></dt>" f"<dd>{escape(str(v))}</dd>" + for k, v in attrs.items() + ) + + return f"<dl class='xr-attrs'>{attrs_dl}</dl>" + + +def _icon(icon_name): + # icon_name should be defined in xarray/static/html/icon-svg-inline.html + return ( + "<svg class='icon xr-{0}'>" + "<use xlink:href='#{0}'>" + "</use>" + "</svg>".format(icon_name) + ) + + +def _summarize_coord_multiindex(name, coord): + preview = f"({', '.join(escape(l) for l in coord.level_names)})" + return summarize_variable( + name, coord, is_index=True, dtype="MultiIndex", preview=preview + ) + + +def summarize_coord(name, var): + is_index = name in var.dims + if is_index: + coord = var.variable.to_index_variable() + if coord.level_names is not None: + coords = {} + coords[name] = _summarize_coord_multiindex(name, coord) + for lname in coord.level_names: + var = coord.get_level_variable(lname) + coords[lname] = summarize_variable(lname, var) + return coords + + return {name: summarize_variable(name, var, is_index)} + + +def summarize_coords(variables): + coords = {} + for k, v in variables.items(): + coords.update(**summarize_coord(k, v)) + + vars_li = "".join(f"<li class='xr-var-item'>{v}</li>" for v in coords.values()) + + return f"<ul class='xr-var-list'>{vars_li}</ul>" + + +def summarize_variable(name, var, is_index=False, dtype=None, preview=None): + variable = var.variable if hasattr(var, "variable") else var + + cssclass_idx = " class='xr-has-index'" if is_index else "" + dims_str = f"({', '.join(escape(dim) for dim in var.dims)})" + name = escape(name) + dtype = dtype or var.dtype + + # "unique" ids required to expand/collapse subsections + attrs_id = "attrs-" + str(uuid.uuid4()) + data_id = "data-" + str(uuid.uuid4()) + disabled = "" if len(var.attrs) else "disabled" + + preview = preview or escape(inline_variable_array_repr(variable, 35)) + attrs_ul = summarize_attrs(var.attrs) + data_repr = short_data_repr_html(variable) + + attrs_icon = _icon("icon-file-text2") + data_icon = _icon("icon-database") + + return ( + f"<div class='xr-var-name'><span{cssclass_idx}>{name}</span></div>" + f"<div class='xr-var-dims'>{dims_str}</div>" + f"<div class='xr-var-dtype'>{dtype}</div>" + f"<div class='xr-var-preview xr-preview'>{preview}</div>" + f"<input id='{attrs_id}' class='xr-var-attrs-in' " + f"type='checkbox' {disabled}>" + f"<label for='{attrs_id}' title='Show/Hide attributes'>" + f"{attrs_icon}</label>" + f"<input id='{data_id}' class='xr-var-data-in' type='checkbox'>" + f"<label for='{data_id}' title='Show/Hide data repr'>" + f"{data_icon}</label>" + f"<div class='xr-var-attrs'>{attrs_ul}</div>" + f"<pre class='xr-var-data'>{data_repr}</pre>" + ) + + +def summarize_vars(variables): + vars_li = "".join( + f"<li class='xr-var-item'>{summarize_variable(k, v)}</li>" + for k, v in variables.items() + ) + + return f"<ul class='xr-var-list'>{vars_li}</ul>" + + +def collapsible_section( + name, inline_details="", details="", n_items=None, enabled=True, collapsed=False +): + # "unique" id to expand/collapse the section + data_id = "section-" + str(uuid.uuid4()) + + has_items = n_items is not None and n_items + n_items_span = "" if n_items is None else f" <span>({n_items})</span>" + enabled = "" if enabled and has_items else "disabled" + collapsed = "" if collapsed or not has_items else "checked" + tip = " title='Expand/collapse section'" if enabled else "" + + return ( + f"<input id='{data_id}' class='xr-section-summary-in' " + f"type='checkbox' {enabled} {collapsed}>" + f"<label for='{data_id}' class='xr-section-summary' {tip}>" + f"{name}:{n_items_span}</label>" + f"<div class='xr-section-inline-details'>{inline_details}</div>" + f"<div class='xr-section-details'>{details}</div>" + ) + + +def _mapping_section(mapping, name, details_func, max_items_collapse, enabled=True): + n_items = len(mapping) + collapsed = n_items >= max_items_collapse + + return collapsible_section( + name, + details=details_func(mapping), + n_items=n_items, + enabled=enabled, + collapsed=collapsed, + ) + + +def dim_section(obj): + dim_list = format_dims(obj.dims, list(obj.coords)) + + return collapsible_section( + "Dimensions", inline_details=dim_list, enabled=False, collapsed=True + ) + + +def array_section(obj): + # "unique" id to expand/collapse the section + data_id = "section-" + str(uuid.uuid4()) + collapsed = "" + preview = escape(inline_variable_array_repr(obj.variable, max_width=70)) + data_repr = short_data_repr_html(obj) + data_icon = _icon("icon-database") + + return ( + "<div class='xr-array-wrap'>" + f"<input id='{data_id}' class='xr-array-in' type='checkbox' {collapsed}>" + f"<label for='{data_id}' title='Show/hide data repr'>{data_icon}</label>" + f"<div class='xr-array-preview xr-preview'><span>{preview}</span></div>" + f"<pre class='xr-array-data'>{data_repr}</pre>" + "</div>" + ) + + +coord_section = partial( + _mapping_section, + name="Coordinates", + details_func=summarize_coords, + max_items_collapse=25, +) + + +datavar_section = partial( + _mapping_section, + name="Data variables", + details_func=summarize_vars, + max_items_collapse=15, +) + + +attr_section = partial( + _mapping_section, + name="Attributes", + details_func=summarize_attrs, + max_items_collapse=10, +) + + +def _obj_repr(header_components, sections): + header = f"<div class='xr-header'>{''.join(h for h in header_components)}</div>" + sections = "".join(f"<li class='xr-section-item'>{s}</li>" for s in sections) + + return ( + "<div>" + f"{ICONS_SVG}<style>{CSS_STYLE}</style>" + "<div class='xr-wrap'>" + f"{header}" + f"<ul class='xr-sections'>{sections}</ul>" + "</div>" + "</div>" + ) + + +def array_repr(arr): + dims = OrderedDict((k, v) for k, v in zip(arr.dims, arr.shape)) + + obj_type = "xarray.{}".format(type(arr).__name__) + arr_name = "'{}'".format(arr.name) if getattr(arr, "name", None) else "" + coord_names = list(arr.coords) if hasattr(arr, "coords") else [] + + header_components = [ + "<div class='xr-obj-type'>{}</div>".format(obj_type), + "<div class='xr-array-name'>{}</div>".format(arr_name), + format_dims(dims, coord_names), + ] + + sections = [array_section(arr)] + + if hasattr(arr, "coords"): + sections.append(coord_section(arr.coords)) + + sections.append(attr_section(arr.attrs)) + + return _obj_repr(header_components, sections) + + +def dataset_repr(ds): + obj_type = "xarray.{}".format(type(ds).__name__) + + header_components = [f"<div class='xr-obj-type'>{escape(obj_type)}</div>"] + + sections = [ + dim_section(ds), + coord_section(ds.coords), + datavar_section(ds.data_vars), + attr_section(ds.attrs), + ] + + return _obj_repr(header_components, sections) diff --git a/xarray/core/options.py b/xarray/core/options.py index 2f464a33fb1..72f9ad8e1fa 100644 --- a/xarray/core/options.py +++ b/xarray/core/options.py @@ -8,6 +8,7 @@ CMAP_SEQUENTIAL = "cmap_sequential" CMAP_DIVERGENT = "cmap_divergent" KEEP_ATTRS = "keep_attrs" +DISPLAY_STYLE = "display_style" OPTIONS = { @@ -19,9 +20,11 @@ CMAP_SEQUENTIAL: "viridis", CMAP_DIVERGENT: "RdBu_r", KEEP_ATTRS: "default", + DISPLAY_STYLE: "text", } _JOIN_OPTIONS = frozenset(["inner", "outer", "left", "right", "exact"]) +_DISPLAY_OPTIONS = frozenset(["text", "html"]) def _positive_integer(value): @@ -35,6 +38,7 @@ def _positive_integer(value): FILE_CACHE_MAXSIZE: _positive_integer, WARN_FOR_UNCLOSED_FILES: lambda value: isinstance(value, bool), KEEP_ATTRS: lambda choice: choice in [True, False, "default"], + DISPLAY_STYLE: _DISPLAY_OPTIONS.__contains__, } @@ -98,6 +102,9 @@ class set_options: attrs, ``False`` to always discard them, or ``'default'`` to use original logic that attrs should only be kept in unambiguous circumstances. Default: ``'default'``. + - ``display_style``: display style to use in jupyter for xarray objects. + Default: ``'text'``. Other options are ``'html'``. + You can use ``set_options`` either as a context manager: diff --git a/xarray/static/css/style.css b/xarray/static/css/style.css new file mode 100644 index 00000000000..536b8ab6103 --- /dev/null +++ b/xarray/static/css/style.css @@ -0,0 +1,310 @@ +/* CSS stylesheet for displaying xarray objects in jupyterlab. + * + */ + +.xr-wrap { + min-width: 300px; + max-width: 700px; +} + +.xr-header { + padding-top: 6px; + padding-bottom: 6px; + margin-bottom: 4px; + border-bottom: solid 1px #ddd; +} + +.xr-header > div, +.xr-header > ul { + display: inline; + margin-top: 0; + margin-bottom: 0; +} + +.xr-obj-type, +.xr-array-name { + margin-left: 2px; + margin-right: 10px; +} + +.xr-obj-type { + color: #555; +} + +.xr-array-name { + color: #000; +} + +.xr-sections { + padding-left: 0 !important; + display: grid; + grid-template-columns: 150px auto auto 1fr 20px 20px; +} + +.xr-section-item { + display: contents; +} + +.xr-section-item input { + display: none; +} + +.xr-section-item input + label { + color: #ccc; +} + +.xr-section-item input:enabled + label { + cursor: pointer; + color: #555; +} + +.xr-section-item input:enabled + label:hover { + color: #000; +} + +.xr-section-summary { + grid-column: 1; + color: #555; + font-weight: 500; +} + +.xr-section-summary > span { + display: inline-block; + padding-left: 0.5em; +} + +.xr-section-summary-in:disabled + label { + color: #555; +} + +.xr-section-summary-in + label:before { + display: inline-block; + content: '►'; + font-size: 11px; + width: 15px; + text-align: center; +} + +.xr-section-summary-in:disabled + label:before { + color: #ccc; +} + +.xr-section-summary-in:checked + label:before { + content: '▼'; +} + +.xr-section-summary-in:checked + label > span { + display: none; +} + +.xr-section-summary, +.xr-section-inline-details { + padding-top: 4px; + padding-bottom: 4px; +} + +.xr-section-inline-details { + grid-column: 2 / -1; +} + +.xr-section-details { + display: none; + grid-column: 1 / -1; + margin-bottom: 5px; +} + +.xr-section-summary-in:checked ~ .xr-section-details { + display: contents; +} + +.xr-array-wrap { + grid-column: 1 / -1; + display: grid; + grid-template-columns: 20px auto; +} + +.xr-array-wrap > label { + grid-column: 1; + vertical-align: top; +} + +.xr-preview { + color: #888; +} + +.xr-array-preview, +.xr-array-data { + padding: 0 5px !important; + grid-column: 2; +} + +.xr-array-data, +.xr-array-in:checked ~ .xr-array-preview { + display: none; +} + +.xr-array-in:checked ~ .xr-array-data, +.xr-array-preview { + display: inline-block; +} + +.xr-dim-list { + display: inline-block !important; + list-style: none; + padding: 0 !important; + margin: 0; +} + +.xr-dim-list li { + display: inline-block; + padding: 0; + margin: 0; +} + +.xr-dim-list:before { + content: '('; +} + +.xr-dim-list:after { + content: ')'; +} + +.xr-dim-list li:not(:last-child):after { + content: ','; + padding-right: 5px; +} + +.xr-has-index { + font-weight: bold; +} + +.xr-var-list, +.xr-var-item { + display: contents; +} + +.xr-var-item > div, +.xr-var-item label, +.xr-var-item > .xr-var-name span { + background-color: #fcfcfc; + margin-bottom: 0; +} + +.xr-var-item > .xr-var-name:hover span { + padding-right: 5px; +} + +.xr-var-list > li:nth-child(odd) > div, +.xr-var-list > li:nth-child(odd) > label, +.xr-var-list > li:nth-child(odd) > .xr-var-name span { + background-color: #efefef; +} + +.xr-var-name { + grid-column: 1; +} + +.xr-var-dims { + grid-column: 2; +} + +.xr-var-dtype { + grid-column: 3; + text-align: right; + color: #555; +} + +.xr-var-preview { + grid-column: 4; +} + +.xr-var-name, +.xr-var-dims, +.xr-var-dtype, +.xr-preview, +.xr-attrs dt { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding-right: 10px; +} + +.xr-var-name:hover, +.xr-var-dims:hover, +.xr-var-dtype:hover, +.xr-attrs dt:hover { + overflow: visible; + width: auto; + z-index: 1; +} + +.xr-var-attrs, +.xr-var-data { + display: none; + background-color: #fff !important; + padding-bottom: 5px !important; +} + +.xr-var-attrs-in:checked ~ .xr-var-attrs, +.xr-var-data-in:checked ~ .xr-var-data { + display: block; +} + +.xr-var-data > table { + float: right; +} + +.xr-var-name span, +.xr-var-data, +.xr-attrs { + padding-left: 25px !important; +} + +.xr-attrs, +.xr-var-attrs, +.xr-var-data { + grid-column: 1 / -1; +} + +dl.xr-attrs { + padding: 0; + margin: 0; + display: grid; + grid-template-columns: 125px auto; +} + +.xr-attrs dt, dd { + padding: 0; + margin: 0; + float: left; + padding-right: 10px; + width: auto; +} + +.xr-attrs dt { + font-weight: normal; + grid-column: 1; +} + +.xr-attrs dt:hover span { + display: inline-block; + background: #fff; + padding-right: 10px; +} + +.xr-attrs dd { + grid-column: 2; + white-space: pre-wrap; + word-break: break-all; +} + +.xr-icon-database, +.xr-icon-file-text2 { + display: inline-block; + vertical-align: middle; + width: 1em; + height: 1.5em !important; + stroke-width: 0; + stroke: currentColor; + fill: currentColor; +} diff --git a/xarray/static/html/icons-svg-inline.html b/xarray/static/html/icons-svg-inline.html new file mode 100644 index 00000000000..c44f89c4304 --- /dev/null +++ b/xarray/static/html/icons-svg-inline.html @@ -0,0 +1,17 @@ +<svg style="position: absolute; width: 0; height: 0; overflow: hidden"> +<defs> +<symbol id="icon-database" viewBox="0 0 32 32"> +<title>Show/Hide data repr</title> +<path d="M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z"></path> +<path d="M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path> +<path d="M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path> +</symbol> +<symbol id="icon-file-text2" viewBox="0 0 32 32"> +<title>Show/Hide attributes</title> +<path d="M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z"></path> +<path d="M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path> +<path d="M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path> +<path d="M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path> +</symbol> +</defs> +</svg>
diff --git a/xarray/tests/test_formatting_html.py b/xarray/tests/test_formatting_html.py new file mode 100644 index 00000000000..e7f54b22d06 --- /dev/null +++ b/xarray/tests/test_formatting_html.py @@ -0,0 +1,132 @@ +from distutils.version import LooseVersion + +import numpy as np +import pandas as pd +import pytest + +import xarray as xr +from xarray.core import formatting_html as fh + + +@pytest.fixture +def dataarray(): + return xr.DataArray(np.random.RandomState(0).randn(4, 6)) + + +@pytest.fixture +def dask_dataarray(dataarray): + pytest.importorskip("dask") + return dataarray.chunk() + + +@pytest.fixture +def multiindex(): + mindex = pd.MultiIndex.from_product( + [["a", "b"], [1, 2]], names=("level_1", "level_2") + ) + return xr.Dataset({}, {"x": mindex}) + + +@pytest.fixture +def dataset(): + times = pd.date_range("2000-01-01", "2001-12-31", name="time") + annual_cycle = np.sin(2 * np.pi * (times.dayofyear.values / 365.25 - 0.28)) + + base = 10 + 15 * annual_cycle.reshape(-1, 1) + tmin_values = base + 3 * np.random.randn(annual_cycle.size, 3) + tmax_values = base + 10 + 3 * np.random.randn(annual_cycle.size, 3) + + return xr.Dataset( + { + "tmin": (("time", "location"), tmin_values), + "tmax": (("time", "location"), tmax_values), + }, + {"time": times, "location": ["<IA>", "IN", "IL"]}, + attrs={"description": "Test data."}, + ) + + +def test_short_data_repr_html(dataarray): + data_repr = fh.short_data_repr_html(dataarray) + assert data_repr.startswith("array") + + +def test_short_data_repr_html_dask(dask_dataarray): + import dask + + if LooseVersion(dask.__version__) < "2.0.0": + assert not hasattr(dask_dataarray.data, "_repr_html_") + data_repr = fh.short_data_repr_html(dask_dataarray) + assert ( + data_repr + == "dask.array&lt;xarray-&lt;this-array&gt;, shape=(4, 6), dtype=float64, chunksize=(4, 6)&gt;" + ) + else: + assert hasattr(dask_dataarray.data, "_repr_html_") + data_repr = fh.short_data_repr_html(dask_dataarray) + assert data_repr == dask_dataarray.data._repr_html_() + + +def test_format_dims_no_dims(): + dims, coord_names = {}, [] + formatted = fh.format_dims(dims, coord_names) + assert formatted == "" + + +def test_format_dims_unsafe_dim_name(): + dims, coord_names = {"<x>": 3, "y": 2}, [] + formatted = fh.format_dims(dims, coord_names) + assert "&lt;x&gt;" in formatted + + +def test_format_dims_non_index(): + dims, coord_names = {"x": 3, "y": 2}, ["time"] + formatted = fh.format_dims(dims, coord_names) + assert "class='xr-has-index'" not in formatted + + +def test_format_dims_index(): + dims, coord_names = {"x": 3, "y": 2}, ["x"] + formatted = fh.format_dims(dims, coord_names) + assert "class='xr-has-index'" in formatted + + +def test_summarize_attrs_with_unsafe_attr_name_and_value(): + attrs = {"<x>": 3, "y": "<pd.DataFrame>"} + formatted = fh.summarize_attrs(attrs) + assert "<dt><span>&lt;x&gt; :</span></dt>" in formatted + assert "<dt><span>y :</span></dt>" in formatted + assert "<dd>3</dd>" in formatted + assert "<dd>&lt;pd.DataFrame&gt;</dd>" in formatted + + +def test_repr_of_dataarray(dataarray): + formatted = fh.array_repr(dataarray) + assert "dim_0" in formatted + # has an expandable data section + assert formatted.count("class='xr-array-in' type='checkbox' >") == 1 + # coords and attrs don't have an items so they'll be be disabled and collapsed + assert ( + formatted.count("class='xr-section-summary-in' type='checkbox' disabled >") == 2 + ) + + +def test_summary_of_multiindex_coord(multiindex): + idx = multiindex.x.variable.to_index_variable() + formatted = fh._summarize_coord_multiindex("foo", idx) + assert "(level_1, level_2)" in formatted + assert "MultiIndex" in formatted + assert "<span class='xr-has-index'>foo</span>" in formatted + + +def test_repr_of_multiindex(multiindex): + formatted = fh.dataset_repr(multiindex) + assert "(x)" in formatted + + +def test_repr_of_dataset(dataset): + formatted = fh.dataset_repr(dataset) + # coords, attrs, and data_vars are expanded + assert ( + formatted.count("class='xr-section-summary-in' type='checkbox' checked>") == 3 + ) diff --git a/xarray/tests/test_options.py b/xarray/tests/test_options.py index 2aa77ecd6b3..f155acbf494 100644 --- a/xarray/tests/test_options.py +++ b/xarray/tests/test_options.py @@ -67,6 +67,16 @@ def test_nested_options(): assert OPTIONS["display_width"] == original +def test_display_style(): + original = "text" + assert OPTIONS["display_style"] == original + with pytest.raises(ValueError): + xarray.set_options(display_style="invalid_str") + with xarray.set_options(display_style="html"): + assert OPTIONS["display_style"] == "html" + assert OPTIONS["display_style"] == original + + def create_test_dataset_attrs(seed=0): ds = create_test_data(seed) ds.attrs = {"attr1": 5, "attr2": "history", "attr3": {"nested": "more_info"}} @@ -164,3 +174,30 @@ def test_merge_attr_retention(self): # option doesn't affect this result = merge([da1, da2]) assert result.attrs == original_attrs + + def test_display_style_text(self): + ds = create_test_dataset_attrs() + text = ds._repr_html_() + assert text.startswith("<pre>") + assert "&#x27;nested&#x27;" in text + assert "&lt;xarray.Dataset&gt;" in text + + def test_display_style_html(self): + ds = create_test_dataset_attrs() + with xarray.set_options(display_style="html"): + html = ds._repr_html_() + assert html.startswith("<div>") + assert "&#x27;nested&#x27;" in html + + def test_display_dataarray_style_text(self): + da = create_test_dataarray_attrs() + text = da._repr_html_() + assert text.startswith("<pre>") + assert "&lt;xarray.DataArray &#x27;var1&#x27;" in text + + def test_display_dataarray_style_html(self): + da = create_test_dataarray_attrs() + with xarray.set_options(display_style="html"): + html = da._repr_html_() + assert html.startswith("<div>") + assert "#x27;nested&#x27;" in html
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 9d3e64badb8..12bed8f332e 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -36,6 +36,12 @@ New Features\n ``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.\n Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.\n \n+- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve\n+ representation of objects in jupyter. By default this feature is turned off\n+ for now. Enable it with :py:meth:`xarray.set_options(display_style=\"html\")`.\n+ (:pull:`3425`) by `Benoit Bovy <https://github.com/benbovy>`_ and\n+ `Julia Signell <https://github.com/jsignell>`_.\n+\n Bug fixes\n ~~~~~~~~~\n - Fix regression introduced in v0.14.0 that would cause a crash if dask is installed\n" } ]
0014
652dd3ca77dd19bbd1ab21fe556340c1904ec382
[ "xarray/tests/test_options.py::test_file_cache_maxsize", "xarray/tests/test_options.py::TestAttrRetention::test_concat_attr_retention", "xarray/tests/test_options.py::TestAttrRetention::test_dataset_attr_retention", "xarray/tests/test_options.py::test_display_width", "xarray/tests/test_options.py::test_invalid_option_raises", "xarray/tests/test_options.py::test_nested_options", "xarray/tests/test_options.py::test_keep_attrs", "xarray/tests/test_options.py::test_arithmetic_join", "xarray/tests/test_options.py::TestAttrRetention::test_groupby_attr_retention", "xarray/tests/test_options.py::test_enable_cftimeindex", "xarray/tests/test_options.py::TestAttrRetention::test_dataarray_attr_retention" ]
[ "xarray/tests/test_formatting_html.py::test_repr_of_multiindex", "xarray/tests/test_formatting_html.py::test_format_dims_unsafe_dim_name", "xarray/tests/test_formatting_html.py::test_format_dims_index", "xarray/tests/test_formatting_html.py::test_format_dims_no_dims", "xarray/tests/test_options.py::TestAttrRetention::test_display_dataarray_style_html", "xarray/tests/test_formatting_html.py::test_summary_of_multiindex_coord", "xarray/tests/test_formatting_html.py::test_repr_of_dataarray", "xarray/tests/test_formatting_html.py::test_short_data_repr_html", "xarray/tests/test_options.py::test_display_style", "xarray/tests/test_options.py::TestAttrRetention::test_display_style_text", "xarray/tests/test_options.py::TestAttrRetention::test_display_style_html", "xarray/tests/test_formatting_html.py::test_format_dims_non_index", "xarray/tests/test_formatting_html.py::test_repr_of_dataset", "xarray/tests/test_options.py::TestAttrRetention::test_display_dataarray_style_text", "xarray/tests/test_formatting_html.py::test_summarize_attrs_with_unsafe_attr_name_and_value" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "function", "name": "format_dims" }, { "type": "field", "name": "data_repr" }, { "type": "field", "name": "formatting_html" }, { "type": "field", "name": "name" }, { "type": "field", "name": "short_data_repr_html" }, { "type": "field", "name": "values" }, { "type": "field", "name": "variable" }, { "type": "field", "name": "coord_names" }, { "type": "field", "name": "summarize_attrs" }, { "type": "function", "name": "dataset_repr" }, { "type": "file", "name": "xarray/core/formatting_html.py" }, { "type": "field", "name": "dims" }, { "type": "field", "name": "format_dims" }, { "type": "function", "name": "array_repr" }, { "type": "field", "name": "_summarize_coord_multiindex" }, { "type": "field", "name": "size" }, { "type": "field", "name": "to_index_variable" }, { "type": "function", "name": "_summarize_coord_multiindex" }, { "type": "field", "name": "attrs" }, { "type": "field", "name": "hasattr" }, { "type": "function", "name": "short_data_repr_html" }, { "type": "function", "name": "summarize_attrs" }, { "type": "field", "name": "formatting_html" } ] }
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 9d3e64badb8..12bed8f332e 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -36,6 +36,12 @@ New Features\n ``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.\n Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.\n \n+- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve\n+ representation of objects in jupyter. By default this feature is turned off\n+ for now. Enable it with :py:meth:`xarray.set_options(display_style=\"html\")`.\n+ (:pull:`<PRID>`) by `<NAME>`_ and\n+ <NAME>_.\n+\n Bug fixes\n ~~~~~~~~~\n - Fix regression introduced in v0.14.0 that would cause a crash if dask is installed\n" } ]
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 9d3e64badb8..12bed8f332e 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -36,6 +36,12 @@ New Features ``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``. Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken. +- Added new :py:meth:`Dataset._repr_html_` and :py:meth:`DataArray._repr_html_` to improve + representation of objects in jupyter. By default this feature is turned off + for now. Enable it with :py:meth:`xarray.set_options(display_style="html")`. + (:pull:`<PRID>`) by `<NAME>`_ and + <NAME>_. + Bug fixes ~~~~~~~~~ - Fix regression introduced in v0.14.0 that would cause a crash if dask is installed If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'function', 'name': 'format_dims'}, {'type': 'field', 'name': 'data_repr'}, {'type': 'field', 'name': 'formatting_html'}, {'type': 'field', 'name': 'name'}, {'type': 'field', 'name': 'short_data_repr_html'}, {'type': 'field', 'name': 'values'}, {'type': 'field', 'name': 'variable'}, {'type': 'field', 'name': 'coord_names'}, {'type': 'field', 'name': 'summarize_attrs'}, {'type': 'function', 'name': 'dataset_repr'}, {'type': 'file', 'name': 'xarray/core/formatting_html.py'}, {'type': 'field', 'name': 'dims'}, {'type': 'field', 'name': 'format_dims'}, {'type': 'function', 'name': 'array_repr'}, {'type': 'field', 'name': '_summarize_coord_multiindex'}, {'type': 'field', 'name': 'size'}, {'type': 'field', 'name': 'to_index_variable'}, {'type': 'function', 'name': '_summarize_coord_multiindex'}, {'type': 'field', 'name': 'attrs'}, {'type': 'field', 'name': 'hasattr'}, {'type': 'function', 'name': 'short_data_repr_html'}, {'type': 'function', 'name': 'summarize_attrs'}, {'type': 'field', 'name': 'formatting_html'}]
pydata/xarray
pydata__xarray-3636
https://github.com/pydata/xarray/pull/3636
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 00d1c50780e..402a06840e2 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -37,6 +37,9 @@ New Features - Added the ``count`` reduction method to both :py:class:`~core.rolling.DatasetCoarsen` and :py:class:`~core.rolling.DataArrayCoarsen` objects. (:pull:`3500`) By `Deepak Cherian <https://github.com/dcherian>`_ +- :py:meth:`Dataset.swap_dims` and :py:meth:`DataArray.swap_dims` + now allow swapping to dimension names that don't exist yet. (:pull:`3636`) + By `Justus Magin <https://github.com/keewis>`_. - Extend :py:class:`core.accessor_dt.DatetimeAccessor` properties and support `.dt` accessor for timedelta via :py:class:`core.accessor_dt.TimedeltaAccessor` (:pull:`3612`) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 31aa4da57b2..cbd8d243385 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -1480,8 +1480,7 @@ def swap_dims(self, dims_dict: Mapping[Hashable, Hashable]) -> "DataArray": ---------- dims_dict : dict-like Dictionary whose keys are current dimension names and whose values - are new names. Each value must already be a coordinate on this - array. + are new names. Returns ------- @@ -1504,6 +1503,13 @@ def swap_dims(self, dims_dict: Mapping[Hashable, Hashable]) -> "DataArray": Coordinates: x (y) <U1 'a' 'b' * y (y) int64 0 1 + >>> arr.swap_dims({"x": "z"}) + <xarray.DataArray (z: 2)> + array([0, 1]) + Coordinates: + x (z) <U1 'a' 'b' + y (z) int64 0 1 + Dimensions without coordinates: z See Also -------- diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 6be06fed117..a1da99e2b9a 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -2868,8 +2868,7 @@ def swap_dims( ---------- dims_dict : dict-like Dictionary whose keys are current dimension names and whose values - are new names. Each value must already be a variable in the - dataset. + are new names. Returns ------- @@ -2898,6 +2897,16 @@ def swap_dims( Data variables: a (y) int64 5 7 b (y) float64 0.1 2.4 + >>> ds.swap_dims({"x": "z"}) + <xarray.Dataset> + Dimensions: (z: 2) + Coordinates: + x (z) <U1 'a' 'b' + y (z) int64 0 1 + Dimensions without coordinates: z + Data variables: + a (z) int64 5 7 + b (z) float64 0.1 2.4 See Also -------- @@ -2914,7 +2923,7 @@ def swap_dims( "cannot swap from dimension %r because it is " "not an existing dimension" % k ) - if self.variables[v].dims != (k,): + if v in self.variables and self.variables[v].dims != (k,): raise ValueError( "replacement dimension %r is not a 1D " "variable along the old dimension %r" % (v, k) @@ -2923,7 +2932,7 @@ def swap_dims( result_dims = {dims_dict.get(dim, dim) for dim in self.dims} coord_names = self._coord_names.copy() - coord_names.update(dims_dict.values()) + coord_names.update({dim for dim in dims_dict.values() if dim in self.variables}) variables: Dict[Hashable, Variable] = {} indexes: Dict[Hashable, pd.Index] = {}
diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index f957316d8ac..4189c3b504a 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -1530,6 +1530,11 @@ def test_swap_dims(self): actual = array.swap_dims({"x": "y"}) assert_identical(expected, actual) + array = DataArray(np.random.randn(3), {"x": list("abc")}, "x") + expected = DataArray(array.values, {"x": ("y", list("abc"))}, dims="y") + actual = array.swap_dims({"x": "y"}) + assert_identical(expected, actual) + def test_expand_dims_error(self): array = DataArray( np.random.randn(3, 4), diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 7db1911621b..9a029121a10 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -2525,6 +2525,12 @@ def test_swap_dims(self): with raises_regex(ValueError, "replacement dimension"): original.swap_dims({"x": "z"}) + expected = Dataset( + {"y": ("u", list("abc")), "z": 42}, coords={"x": ("u", [1, 2, 3])} + ) + actual = original.swap_dims({"x": "u"}) + assert_identical(expected, actual) + def test_expand_dims_error(self): original = Dataset( {
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 00d1c50780e..402a06840e2 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -37,6 +37,9 @@ New Features\n - Added the ``count`` reduction method to both :py:class:`~core.rolling.DatasetCoarsen`\n and :py:class:`~core.rolling.DataArrayCoarsen` objects. (:pull:`3500`)\n By `Deepak Cherian <https://github.com/dcherian>`_\n+- :py:meth:`Dataset.swap_dims` and :py:meth:`DataArray.swap_dims`\n+ now allow swapping to dimension names that don't exist yet. (:pull:`3636`)\n+ By `Justus Magin <https://github.com/keewis>`_.\n - Extend :py:class:`core.accessor_dt.DatetimeAccessor` properties \n and support `.dt` accessor for timedelta \n via :py:class:`core.accessor_dt.TimedeltaAccessor` (:pull:`3612`)\n" } ]
0015
b3d3b4480b7fb63402eb6c02103bb8d6c7dbf93a
[ "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_center", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_changes_metadata", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-0.25]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_identity", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename_does_not_change_DatetimeIndex_type", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-q2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_map", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-0.25]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_unstack_fill_value", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[q1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-0.25]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_ellipsis_transpose_different_ordered_vars", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-q2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_apply_pending_deprecated_map", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-q2]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[0.25]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_propagate_indexes", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_from_level", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-q1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataset.py::test_coarsen_absent_dims_error[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-0.25]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_ndarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_propagate_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_map", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]" ]
[ "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 00d1c50780e..402a06840e2 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -37,6 +37,9 @@ New Features\n - Added the ``count`` reduction method to both :py:class:`~core.rolling.DatasetCoarsen`\n and :py:class:`~core.rolling.DataArrayCoarsen` objects. (:pull:`<PRID>`)\n By `<NAME>`_\n+- :py:meth:`Dataset.swap_dims` and :py:meth:`DataArray.swap_dims`\n+ now allow swapping to dimension names that don't exist yet. (:pull:`<PRID>`)\n+ By `<NAME>`_.\n - Extend :py:class:`core.accessor_dt.DatetimeAccessor` properties \n and support `.dt` accessor for timedelta \n via :py:class:`core.accessor_dt.TimedeltaAccessor` (:pull:`<PRID>`)\n" } ]
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 00d1c50780e..402a06840e2 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -37,6 +37,9 @@ New Features - Added the ``count`` reduction method to both :py:class:`~core.rolling.DatasetCoarsen` and :py:class:`~core.rolling.DataArrayCoarsen` objects. (:pull:`<PRID>`) By `<NAME>`_ +- :py:meth:`Dataset.swap_dims` and :py:meth:`DataArray.swap_dims` + now allow swapping to dimension names that don't exist yet. (:pull:`<PRID>`) + By `<NAME>`_. - Extend :py:class:`core.accessor_dt.DatetimeAccessor` properties and support `.dt` accessor for timedelta via :py:class:`core.accessor_dt.TimedeltaAccessor` (:pull:`<PRID>`)
pydata/xarray
pydata__xarray-3527
https://github.com/pydata/xarray/pull/3527
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ea3b012cc98..ad430b1bcfc 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -76,6 +76,8 @@ New Features invoked. (:issue:`3378`, :pull:`3446`, :pull:`3515`) By `Deepak Cherian <https://github.com/dcherian>`_ and `Guido Imperiale <https://github.com/crusaderky>`_. +- Add the documented-but-missing :py:meth:`xarray.core.groupby.DatasetGroupBy.quantile`. + (:issue:`3525`, :pull:`3527`). By `Justus Magin <https://github.com/keewis>`_. Bug fixes ~~~~~~~~~ diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index c73ee3cf7c5..38ecc04534a 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -557,6 +557,59 @@ def fillna(self, value): out = ops.fillna(self, value) return out + def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): + """Compute the qth quantile over each array in the groups and + concatenate them together into a new array. + + Parameters + ---------- + q : float in range of [0,1] (or sequence of floats) + Quantile to compute, which must be between 0 and 1 + inclusive. + dim : `...`, str or sequence of str, optional + Dimension(s) over which to apply quantile. + Defaults to the grouped dimension. + interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} + This optional parameter specifies the interpolation method to + use when the desired quantile lies between two data points + ``i < j``: + * linear: ``i + (j - i) * fraction``, where ``fraction`` is + the fractional part of the index surrounded by ``i`` and + ``j``. + * lower: ``i``. + * higher: ``j``. + * nearest: ``i`` or ``j``, whichever is nearest. + * midpoint: ``(i + j) / 2``. + + Returns + ------- + quantiles : Variable + If `q` is a single quantile, then the result is a + scalar. If multiple percentiles are given, first axis of + the result corresponds to the quantile. In either case a + quantile dimension is added to the return array. The other + dimensions are the dimensions that remain after the + reduction of the array. + + See Also + -------- + numpy.nanpercentile, pandas.Series.quantile, Dataset.quantile, + DataArray.quantile + """ + if dim is None: + dim = self._group_dim + + out = self.map( + self._obj.__class__.quantile, + shortcut=False, + q=q, + dim=dim, + interpolation=interpolation, + keep_attrs=keep_attrs, + ) + + return out + def where(self, cond, other=dtypes.NA): """Return elements from `self` or `other` depending on `cond`. @@ -737,60 +790,6 @@ def _combine(self, applied, restore_coord_dims=False, shortcut=False): combined = self._maybe_unstack(combined) return combined - def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): - """Compute the qth quantile over each array in the groups and - concatenate them together into a new array. - - Parameters - ---------- - q : float in range of [0,1] (or sequence of floats) - Quantile to compute, which must be between 0 and 1 - inclusive. - dim : `...`, str or sequence of str, optional - Dimension(s) over which to apply quantile. - Defaults to the grouped dimension. - interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} - This optional parameter specifies the interpolation method to - use when the desired quantile lies between two data points - ``i < j``: - * linear: ``i + (j - i) * fraction``, where ``fraction`` is - the fractional part of the index surrounded by ``i`` and - ``j``. - * lower: ``i``. - * higher: ``j``. - * nearest: ``i`` or ``j``, whichever is nearest. - * midpoint: ``(i + j) / 2``. - - Returns - ------- - quantiles : Variable - If `q` is a single quantile, then the result - is a scalar. If multiple percentiles are given, first axis of - the result corresponds to the quantile and a quantile dimension - is added to the return array. The other dimensions are the - dimensions that remain after the reduction of the array. - - See Also - -------- - numpy.nanpercentile, pandas.Series.quantile, Dataset.quantile, - DataArray.quantile - """ - if dim is None: - dim = self._group_dim - - out = self.map( - self._obj.__class__.quantile, - shortcut=False, - q=q, - dim=dim, - interpolation=interpolation, - keep_attrs=keep_attrs, - ) - - if np.asarray(q, dtype=np.float64).ndim == 0: - out = out.drop_vars("quantile") - return out - def reduce( self, func, dim=None, axis=None, keep_attrs=None, shortcut=True, **kwargs ):
diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py index 581affa3471..97bd31ae050 100644 --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -137,42 +137,58 @@ def test_da_groupby_empty(): def test_da_groupby_quantile(): - array = xr.DataArray([1, 2, 3, 4, 5, 6], [("x", [1, 1, 1, 2, 2, 2])]) + array = xr.DataArray( + data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x" + ) # Scalar quantile - expected = xr.DataArray([2, 5], [("x", [1, 2])]) + expected = xr.DataArray( + data=[2, 5], coords={"x": [1, 2], "quantile": 0.5}, dims="x" + ) actual = array.groupby("x").quantile(0.5) assert_identical(expected, actual) # Vector quantile - expected = xr.DataArray([[1, 3], [4, 6]], [("x", [1, 2]), ("quantile", [0, 1])]) + expected = xr.DataArray( + data=[[1, 3], [4, 6]], + coords={"x": [1, 2], "quantile": [0, 1]}, + dims=("x", "quantile"), + ) actual = array.groupby("x").quantile([0, 1]) assert_identical(expected, actual) # Multiple dimensions array = xr.DataArray( - [[1, 11, 26], [2, 12, 22], [3, 13, 23], [4, 16, 24], [5, 15, 25]], - [("x", [1, 1, 1, 2, 2]), ("y", [0, 0, 1])], + data=[[1, 11, 26], [2, 12, 22], [3, 13, 23], [4, 16, 24], [5, 15, 25]], + coords={"x": [1, 1, 1, 2, 2], "y": [0, 0, 1]}, + dims=("x", "y"), ) actual_x = array.groupby("x").quantile(0, dim=...) - expected_x = xr.DataArray([1, 4], [("x", [1, 2])]) + expected_x = xr.DataArray( + data=[1, 4], coords={"x": [1, 2], "quantile": 0}, dims="x" + ) assert_identical(expected_x, actual_x) actual_y = array.groupby("y").quantile(0, dim=...) - expected_y = xr.DataArray([1, 22], [("y", [0, 1])]) + expected_y = xr.DataArray( + data=[1, 22], coords={"y": [0, 1], "quantile": 0}, dims="y" + ) assert_identical(expected_y, actual_y) actual_xx = array.groupby("x").quantile(0) expected_xx = xr.DataArray( - [[1, 11, 22], [4, 15, 24]], [("x", [1, 2]), ("y", [0, 0, 1])] + data=[[1, 11, 22], [4, 15, 24]], + coords={"x": [1, 2], "y": [0, 0, 1], "quantile": 0}, + dims=("x", "y"), ) assert_identical(expected_xx, actual_xx) actual_yy = array.groupby("y").quantile(0) expected_yy = xr.DataArray( - [[1, 26], [2, 22], [3, 23], [4, 24], [5, 25]], - [("x", [1, 1, 1, 2, 2]), ("y", [0, 1])], + data=[[1, 26], [2, 22], [3, 23], [4, 24], [5, 25]], + coords={"x": [1, 1, 1, 2, 2], "y": [0, 1], "quantile": 0}, + dims=("x", "y"), ) assert_identical(expected_yy, actual_yy) @@ -180,14 +196,14 @@ def test_da_groupby_quantile(): x = [0, 1] foo = xr.DataArray( np.reshape(np.arange(365 * 2), (365, 2)), - coords=dict(time=times, x=x), + coords={"time": times, "x": x}, dims=("time", "x"), ) g = foo.groupby(foo.time.dt.month) actual = g.quantile(0, dim=...) expected = xr.DataArray( - [ + data=[ 0.0, 62.0, 120.0, @@ -201,12 +217,111 @@ def test_da_groupby_quantile(): 610.0, 670.0, ], - [("month", np.arange(1, 13))], + coords={"month": np.arange(1, 13), "quantile": 0}, + dims="month", ) assert_identical(expected, actual) actual = g.quantile(0, dim="time")[:2] - expected = xr.DataArray([[0.0, 1], [62.0, 63]], [("month", [1, 2]), ("x", [0, 1])]) + expected = xr.DataArray( + data=[[0.0, 1], [62.0, 63]], + coords={"month": [1, 2], "x": [0, 1], "quantile": 0}, + dims=("month", "x"), + ) + assert_identical(expected, actual) + + +def test_ds_groupby_quantile(): + ds = xr.Dataset( + data_vars={"a": ("x", [1, 2, 3, 4, 5, 6])}, coords={"x": [1, 1, 1, 2, 2, 2]} + ) + + # Scalar quantile + expected = xr.Dataset( + data_vars={"a": ("x", [2, 5])}, coords={"quantile": 0.5, "x": [1, 2]} + ) + actual = ds.groupby("x").quantile(0.5) + assert_identical(expected, actual) + + # Vector quantile + expected = xr.Dataset( + data_vars={"a": (("x", "quantile"), [[1, 3], [4, 6]])}, + coords={"x": [1, 2], "quantile": [0, 1]}, + ) + actual = ds.groupby("x").quantile([0, 1]) + assert_identical(expected, actual) + + # Multiple dimensions + ds = xr.Dataset( + data_vars={ + "a": ( + ("x", "y"), + [[1, 11, 26], [2, 12, 22], [3, 13, 23], [4, 16, 24], [5, 15, 25]], + ) + }, + coords={"x": [1, 1, 1, 2, 2], "y": [0, 0, 1]}, + ) + + actual_x = ds.groupby("x").quantile(0, dim=...) + expected_x = xr.Dataset({"a": ("x", [1, 4])}, coords={"x": [1, 2], "quantile": 0}) + assert_identical(expected_x, actual_x) + + actual_y = ds.groupby("y").quantile(0, dim=...) + expected_y = xr.Dataset({"a": ("y", [1, 22])}, coords={"y": [0, 1], "quantile": 0}) + assert_identical(expected_y, actual_y) + + actual_xx = ds.groupby("x").quantile(0) + expected_xx = xr.Dataset( + {"a": (("x", "y"), [[1, 11, 22], [4, 15, 24]])}, + coords={"x": [1, 2], "y": [0, 0, 1], "quantile": 0}, + ) + assert_identical(expected_xx, actual_xx) + + actual_yy = ds.groupby("y").quantile(0) + expected_yy = xr.Dataset( + {"a": (("x", "y"), [[1, 26], [2, 22], [3, 23], [4, 24], [5, 25]])}, + coords={"x": [1, 1, 1, 2, 2], "y": [0, 1], "quantile": 0}, + ).transpose() + assert_identical(expected_yy, actual_yy) + + times = pd.date_range("2000-01-01", periods=365) + x = [0, 1] + foo = xr.Dataset( + {"a": (("time", "x"), np.reshape(np.arange(365 * 2), (365, 2)))}, + coords=dict(time=times, x=x), + ) + g = foo.groupby(foo.time.dt.month) + + actual = g.quantile(0, dim=...) + expected = xr.Dataset( + { + "a": ( + "month", + [ + 0.0, + 62.0, + 120.0, + 182.0, + 242.0, + 304.0, + 364.0, + 426.0, + 488.0, + 548.0, + 610.0, + 670.0, + ], + ) + }, + coords={"month": np.arange(1, 13), "quantile": 0}, + ) + assert_identical(expected, actual) + + actual = g.quantile(0, dim="time").isel(month=slice(None, 2)) + expected = xr.Dataset( + data_vars={"a": (("month", "x"), [[0.0, 1], [62.0, 63]])}, + coords={"month": [1, 2], "x": [0, 1], "quantile": 0}, + ) assert_identical(expected, actual)
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex ea3b012cc98..ad430b1bcfc 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -76,6 +76,8 @@ New Features\n invoked. (:issue:`3378`, :pull:`3446`, :pull:`3515`)\n By `Deepak Cherian <https://github.com/dcherian>`_ and\n `Guido Imperiale <https://github.com/crusaderky>`_.\n+- Add the documented-but-missing :py:meth:`xarray.core.groupby.DatasetGroupBy.quantile`.\n+ (:issue:`3525`, :pull:`3527`). By `Justus Magin <https://github.com/keewis>`_.\n \n Bug fixes\n ~~~~~~~~~\n" } ]
0014
c0ef2f616e87e9f924425bcd373ac265f14203cb
[ "xarray/tests/test_groupby.py::test_ds_groupby_map_func_args", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-y]", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-month]", "xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_groupby.py::test_groupby_grouping_errors", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test_groupby.py::test_groupby_dims_property", "xarray/tests/test_groupby.py::test_groupby_reduce_dimension_error", "xarray/tests/test_groupby.py::test_da_groupby_empty", "xarray/tests/test_groupby.py::test_groupby_bins_timeseries", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-x]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-x]", "xarray/tests/test_groupby.py::test_groupby_input_mutation", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-z]", "xarray/tests/test_groupby.py::test_da_groupby_map_func_args", "xarray/tests/test_groupby.py::test_da_groupby_assign_coords", "xarray/tests/test_groupby.py::test_groupby_drops_nans", "xarray/tests/test_groupby.py::test_groupby_duplicate_coordinate_labels", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-z]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-month]", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj1]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-y]", "xarray/tests/test_groupby.py::test_multi_index_groupby_map", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj0]" ]
[ "xarray/tests/test_groupby.py::test_da_groupby_quantile", "xarray/tests/test_groupby.py::test_ds_groupby_quantile" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex ea3b012cc98..ad430b1bcfc 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -76,6 +76,8 @@ New Features\n invoked. (:issue:`<PRID>`, :pull:`<PRID>`, :pull:`<PRID>`)\n By `<NAME>`_ and\n <NAME>_.\n+- Add the documented-but-missing :py:meth:`xarray.core.groupby.DatasetGroupBy.quantile`.\n+ (:issue:`<PRID>`, :pull:`<PRID>`). By `<NAME>`_.\n \n Bug fixes\n ~~~~~~~~~\n" } ]
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ea3b012cc98..ad430b1bcfc 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -76,6 +76,8 @@ New Features invoked. (:issue:`<PRID>`, :pull:`<PRID>`, :pull:`<PRID>`) By `<NAME>`_ and <NAME>_. +- Add the documented-but-missing :py:meth:`xarray.core.groupby.DatasetGroupBy.quantile`. + (:issue:`<PRID>`, :pull:`<PRID>`). By `<NAME>`_. Bug fixes ~~~~~~~~~
pydata/xarray
pydata__xarray-3596
https://github.com/pydata/xarray/pull/3596
diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst index 437f53b1a91..cc9517a98ba 100644 --- a/doc/api-hidden.rst +++ b/doc/api-hidden.rst @@ -379,7 +379,6 @@ Variable.min Variable.no_conflicts Variable.notnull - Variable.pad_with_fill_value Variable.prod Variable.quantile Variable.rank @@ -453,7 +452,6 @@ IndexVariable.min IndexVariable.no_conflicts IndexVariable.notnull - IndexVariable.pad_with_fill_value IndexVariable.prod IndexVariable.quantile IndexVariable.rank diff --git a/doc/api.rst b/doc/api.rst index 4492d882355..b3b6aa9139d 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -220,6 +220,7 @@ Reshaping and reorganizing Dataset.to_stacked_array Dataset.shift Dataset.roll + Dataset.pad Dataset.sortby Dataset.broadcast_like @@ -399,6 +400,7 @@ Reshaping and reorganizing DataArray.to_unstacked_dataset DataArray.shift DataArray.roll + DataArray.pad DataArray.sortby DataArray.broadcast_like diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 24120270444..fa71be23db9 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -125,6 +125,8 @@ Breaking changes New Features ~~~~~~~~~~~~ +- Implement :py:meth:`DataArray.pad` and :py:meth:`Dataset.pad`. (:issue:`2605`, :pull:`3596`). + By `Mark Boer <https://github.com/mark-boer>`_. - :py:meth:`DataArray.sel` and :py:meth:`Dataset.sel` now support :py:class:`pandas.CategoricalIndex`. (:issue:`3669`) By `Keisuke Fujii <https://github.com/fujiisoup>`_. - Support using an existing, opened h5netcdf ``File`` with diff --git a/xarray/core/dask_array_compat.py b/xarray/core/dask_array_compat.py index 05f750a1355..94c50d90e84 100644 --- a/xarray/core/dask_array_compat.py +++ b/xarray/core/dask_array_compat.py @@ -1,3 +1,4 @@ +import warnings from distutils.version import LooseVersion from typing import Iterable @@ -99,6 +100,52 @@ def meta_from_array(x, ndim=None, dtype=None): return meta +def _validate_pad_output_shape(input_shape, pad_width, output_shape): + """ Validates the output shape of dask.array.pad, raising a RuntimeError if they do not match. + In the current versions of dask (2.2/2.4), dask.array.pad with mode='reflect' sometimes returns + an invalid shape. + """ + isint = lambda i: isinstance(i, int) + + if isint(pad_width): + pass + elif len(pad_width) == 2 and all(map(isint, pad_width)): + pad_width = sum(pad_width) + elif ( + len(pad_width) == len(input_shape) + and all(map(lambda x: len(x) == 2, pad_width)) + and all((isint(i) for p in pad_width for i in p)) + ): + pad_width = np.sum(pad_width, axis=1) + else: + # unreachable: dask.array.pad should already have thrown an error + raise ValueError("Invalid value for `pad_width`") + + if not np.array_equal(np.array(input_shape) + pad_width, output_shape): + raise RuntimeError( + "There seems to be something wrong with the shape of the output of dask.array.pad, " + "try upgrading Dask, use a different pad mode e.g. mode='constant' or first convert " + "your DataArray/Dataset to one backed by a numpy array by calling the `compute()` method." + "See: https://github.com/dask/dask/issues/5303" + ) + + +def pad(array, pad_width, mode="constant", **kwargs): + padded = da.pad(array, pad_width, mode=mode, **kwargs) + # workaround for inconsistency between numpy and dask: https://github.com/dask/dask/issues/5303 + if mode == "mean" and issubclass(array.dtype.type, np.integer): + warnings.warn( + 'dask.array.pad(mode="mean") converts integers to floats. xarray converts ' + "these floats back to integers to keep the interface consistent. There is a chance that " + "this introduces rounding errors. If you wish to keep the values as floats, first change " + "the dtype to a float before calling pad.", + UserWarning, + ) + return da.round(padded).astype(array.dtype) + _validate_pad_output_shape(array.shape, pad_width, padded.shape) + return padded + + if LooseVersion(dask_version) >= LooseVersion("2.8.1"): median = da.median else: diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 4e80ef222c2..4d9993d7383 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -3239,6 +3239,174 @@ def map_blocks( return map_blocks(func, self, args, kwargs) + def pad( + self, + pad_width: Mapping[Hashable, Union[int, Tuple[int, int]]] = None, + mode: str = "constant", + stat_length: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + constant_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + end_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + reflect_type: str = None, + **pad_width_kwargs: Any, + ) -> "DataArray": + """Pad this array along one or more dimensions. + + .. warning:: + This function is experimental and its behaviour is likely to change + especially regarding padding of dimension coordinates (or IndexVariables). + + When using one of the modes ("edge", "reflect", "symmetric", "wrap"), + coordinates will be padded with the same mode, otherwise coordinates + are padded using the "constant" mode with fill_value dtypes.NA. + + Parameters + ---------- + pad_width : Mapping with the form of {dim: (pad_before, pad_after)} + Number of values padded along each dimension. + {dim: pad} is a shortcut for pad_before = pad_after = pad + mode : str + One of the following string values (taken from numpy docs) + + 'constant' (default) + Pads with a constant value. + 'edge' + Pads with the edge values of array. + 'linear_ramp' + Pads with the linear ramp between end_value and the + array edge value. + 'maximum' + Pads with the maximum value of all or part of the + vector along each axis. + 'mean' + Pads with the mean value of all or part of the + vector along each axis. + 'median' + Pads with the median value of all or part of the + vector along each axis. + 'minimum' + Pads with the minimum value of all or part of the + vector along each axis. + 'reflect' + Pads with the reflection of the vector mirrored on + the first and last values of the vector along each + axis. + 'symmetric' + Pads with the reflection of the vector mirrored + along the edge of the array. + 'wrap' + Pads with the wrap of the vector along the axis. + The first values are used to pad the end and the + end values are used to pad the beginning. + stat_length : int, tuple or mapping of the form {dim: tuple} + Used in 'maximum', 'mean', 'median', and 'minimum'. Number of + values at edge of each axis used to calculate the statistic value. + {dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)} unique + statistic lengths along each dimension. + ((before, after),) yields same before and after statistic lengths + for each dimension. + (stat_length,) or int is a shortcut for before = after = statistic + length for all axes. + Default is ``None``, to use the entire axis. + constant_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'constant'. The values to set the padded values for each + axis. + ``{dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)}`` unique + pad constants along each dimension. + ``((before, after),)`` yields same before and after constants for each + dimension. + ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for + all dimensions. + Default is 0. + end_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'linear_ramp'. The values used for the ending value of the + linear_ramp and that will form the edge of the padded array. + ``{dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)}`` unique + end values along each dimension. + ``((before, after),)`` yields same before and after end values for each + axis. + ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for + all axes. + Default is 0. + reflect_type : {'even', 'odd'}, optional + Used in 'reflect', and 'symmetric'. The 'even' style is the + default with an unaltered reflection around the edge value. For + the 'odd' style, the extended part of the array is created by + subtracting the reflected values from two times the edge value. + **pad_width_kwargs: + The keyword arguments form of ``pad_width``. + One of ``pad_width`` or ``pad_width_kwargs`` must be provided. + + Returns + ------- + padded : DataArray + DataArray with the padded coordinates and data. + + See also + -------- + DataArray.shift, DataArray.roll, DataArray.bfill, DataArray.ffill, numpy.pad, dask.array.pad + + Notes + ----- + By default when ``mode="constant"`` and ``constant_values=None``, integer types will be + promoted to ``float`` and padded with ``np.nan``. To avoid type promotion + specify ``constant_values=np.nan`` + + Examples + -------- + + >>> arr = xr.DataArray([5, 6, 7], coords=[("x", [0,1,2])]) + >>> arr.pad(x=(1,2), constant_values=0) + <xarray.DataArray (x: 6)> + array([0, 5, 6, 7, 0, 0]) + Coordinates: + * x (x) float64 nan 0.0 1.0 2.0 nan nan + + >>> da = xr.DataArray([[0,1,2,3], [10,11,12,13]], + dims=["x", "y"], + coords={"x": [0,1], "y": [10, 20 ,30, 40], "z": ("x", [100, 200])} + ) + >>> da.pad(x=1) + <xarray.DataArray (x: 4, y: 4)> + array([[nan, nan, nan, nan], + [ 0., 1., 2., 3.], + [10., 11., 12., 13.], + [nan, nan, nan, nan]]) + Coordinates: + * x (x) float64 nan 0.0 1.0 nan + * y (y) int64 10 20 30 40 + z (x) float64 nan 100.0 200.0 nan + >>> da.pad(x=1, constant_values=np.nan) + <xarray.DataArray (x: 4, y: 4)> + array([[-9223372036854775808, -9223372036854775808, -9223372036854775808, + -9223372036854775808], + [ 0, 1, 2, + 3], + [ 10, 11, 12, + 13], + [-9223372036854775808, -9223372036854775808, -9223372036854775808, + -9223372036854775808]]) + Coordinates: + * x (x) float64 nan 0.0 1.0 nan + * y (y) int64 10 20 30 40 + z (x) float64 nan 100.0 200.0 nan + """ + ds = self._to_temp_dataset().pad( + pad_width=pad_width, + mode=mode, + stat_length=stat_length, + constant_values=constant_values, + end_values=end_values, + reflect_type=reflect_type, + **pad_width_kwargs, + ) + return self._from_temp_dataset(ds) + # this needs to be at the end, or mypy will confuse with `str` # https://mypy.readthedocs.io/en/latest/common_issues.html#dealing-with-conflicting-names str = property(StringAccessor) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 52940e98b27..937bebc2bc8 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -5699,5 +5699,171 @@ def map_blocks( return map_blocks(func, self, args, kwargs) + def pad( + self, + pad_width: Mapping[Hashable, Union[int, Tuple[int, int]]] = None, + mode: str = "constant", + stat_length: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + constant_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + end_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + reflect_type: str = None, + **pad_width_kwargs: Any, + ) -> "Dataset": + """Pad this dataset along one or more dimensions. + + .. warning:: + This function is experimental and its behaviour is likely to change + especially regarding padding of dimension coordinates (or IndexVariables). + + When using one of the modes ("edge", "reflect", "symmetric", "wrap"), + coordinates will be padded with the same mode, otherwise coordinates + are padded using the "constant" mode with fill_value dtypes.NA. + + Parameters + ---------- + pad_width : Mapping with the form of {dim: (pad_before, pad_after)} + Number of values padded along each dimension. + {dim: pad} is a shortcut for pad_before = pad_after = pad + mode : str + One of the following string values (taken from numpy docs). + + 'constant' (default) + Pads with a constant value. + 'edge' + Pads with the edge values of array. + 'linear_ramp' + Pads with the linear ramp between end_value and the + array edge value. + 'maximum' + Pads with the maximum value of all or part of the + vector along each axis. + 'mean' + Pads with the mean value of all or part of the + vector along each axis. + 'median' + Pads with the median value of all or part of the + vector along each axis. + 'minimum' + Pads with the minimum value of all or part of the + vector along each axis. + 'reflect' + Pads with the reflection of the vector mirrored on + the first and last values of the vector along each + axis. + 'symmetric' + Pads with the reflection of the vector mirrored + along the edge of the array. + 'wrap' + Pads with the wrap of the vector along the axis. + The first values are used to pad the end and the + end values are used to pad the beginning. + stat_length : int, tuple or mapping of the form {dim: tuple} + Used in 'maximum', 'mean', 'median', and 'minimum'. Number of + values at edge of each axis used to calculate the statistic value. + {dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)} unique + statistic lengths along each dimension. + ((before, after),) yields same before and after statistic lengths + for each dimension. + (stat_length,) or int is a shortcut for before = after = statistic + length for all axes. + Default is ``None``, to use the entire axis. + constant_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'constant'. The values to set the padded values for each + axis. + ``{dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)}`` unique + pad constants along each dimension. + ``((before, after),)`` yields same before and after constants for each + dimension. + ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for + all dimensions. + Default is 0. + end_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'linear_ramp'. The values used for the ending value of the + linear_ramp and that will form the edge of the padded array. + ``{dim_1: (before_1, after_1), ... dim_N: (before_N, after_N)}`` unique + end values along each dimension. + ``((before, after),)`` yields same before and after end values for each + axis. + ``(constant,)`` or ``constant`` is a shortcut for ``before = after = constant`` for + all axes. + Default is 0. + reflect_type : {'even', 'odd'}, optional + Used in 'reflect', and 'symmetric'. The 'even' style is the + default with an unaltered reflection around the edge value. For + the 'odd' style, the extended part of the array is created by + subtracting the reflected values from two times the edge value. + **pad_width_kwargs: + The keyword arguments form of ``pad_width``. + One of ``pad_width`` or ``pad_width_kwargs`` must be provided. + + Returns + ------- + padded : Dataset + Dataset with the padded coordinates and data. + + See also + -------- + Dataset.shift, Dataset.roll, Dataset.bfill, Dataset.ffill, numpy.pad, dask.array.pad + + Notes + ----- + By default when ``mode="constant"`` and ``constant_values=None``, integer types will be + promoted to ``float`` and padded with ``np.nan``. To avoid type promotion + specify ``constant_values=np.nan`` + + Examples + -------- + + >>> ds = xr.Dataset({'foo': ('x', range(5))}) + >>> ds.pad(x=(1,2)) + <xarray.Dataset> + Dimensions: (x: 8) + Dimensions without coordinates: x + Data variables: + foo (x) float64 nan 0.0 1.0 2.0 3.0 4.0 nan nan + """ + pad_width = either_dict_or_kwargs(pad_width, pad_width_kwargs, "pad") + + if mode in ("edge", "reflect", "symmetric", "wrap"): + coord_pad_mode = mode + coord_pad_options = { + "stat_length": stat_length, + "constant_values": constant_values, + "end_values": end_values, + "reflect_type": reflect_type, + } + else: + coord_pad_mode = "constant" + coord_pad_options = {} + + variables = {} + for name, var in self.variables.items(): + var_pad_width = {k: v for k, v in pad_width.items() if k in var.dims} + if not var_pad_width: + variables[name] = var + elif name in self.data_vars: + variables[name] = var.pad( + pad_width=var_pad_width, + mode=mode, + stat_length=stat_length, + constant_values=constant_values, + end_values=end_values, + reflect_type=reflect_type, + ) + else: + variables[name] = var.pad( + pad_width=var_pad_width, + mode=coord_pad_mode, + **coord_pad_options, # type: ignore + ) + + return self._replace_vars_and_dims(variables) + ops.inject_all_ops_and_reduce_methods(Dataset, array_only=False) diff --git a/xarray/core/duck_array_ops.py b/xarray/core/duck_array_ops.py index 6d0abe9a6fc..ff2d0af63ed 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -114,7 +114,7 @@ def notnull(data): isin = _dask_or_eager_func("isin", array_args=slice(2)) take = _dask_or_eager_func("take") broadcast_to = _dask_or_eager_func("broadcast_to") -pad = _dask_or_eager_func("pad") +pad = _dask_or_eager_func("pad", dask_module=dask_array_compat) _concatenate = _dask_or_eager_func("concatenate", list_of_args=True) _stack = _dask_or_eager_func("stack", list_of_args=True) diff --git a/xarray/core/rolling.py b/xarray/core/rolling.py index 61178cfb15f..6e5cf187d5a 100644 --- a/xarray/core/rolling.py +++ b/xarray/core/rolling.py @@ -348,7 +348,7 @@ def _bottleneck_reduce(self, func, **kwargs): else: shift = (-self.window // 2) + 1 valid = (slice(None),) * axis + (slice(-shift, None),) - padded = padded.pad_with_fill_value({self.dim: (0, -shift)}) + padded = padded.pad({self.dim: (0, -shift)}, mode="constant") if isinstance(padded.data, dask_array_type): raise AssertionError("should not be reachable") diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 62f9fde6a2e..ce27b118180 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -1,11 +1,12 @@ import copy import functools import itertools +import numbers import warnings from collections import defaultdict from datetime import timedelta from distutils.version import LooseVersion -from typing import Any, Dict, Hashable, Mapping, TypeVar, Union +from typing import Any, Dict, Hashable, Mapping, Tuple, TypeVar, Union import numpy as np import pandas as pd @@ -32,12 +33,6 @@ infix_dims, ) -try: - import dask.array as da -except ImportError: - pass - - NON_NUMPY_SUPPORTED_ARRAY_TYPES = ( indexing.ExplicitlyIndexed, pd.Index, @@ -1150,66 +1145,114 @@ def shift(self, shifts=None, fill_value=dtypes.NA, **shifts_kwargs): result = result._shift_one_dim(dim, count, fill_value=fill_value) return result - def pad_with_fill_value( - self, pad_widths=None, fill_value=dtypes.NA, **pad_widths_kwargs + def _pad_options_dim_to_index( + self, + pad_option: Mapping[Hashable, Union[int, Tuple[int, int]]], + fill_with_shape=False, + ): + if fill_with_shape: + return [ + (n, n) if d not in pad_option else pad_option[d] + for d, n in zip(self.dims, self.data.shape) + ] + return [(0, 0) if d not in pad_option else pad_option[d] for d in self.dims] + + def pad( + self, + pad_width: Mapping[Hashable, Union[int, Tuple[int, int]]] = None, + mode: str = "constant", + stat_length: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + constant_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + end_values: Union[ + int, Tuple[int, int], Mapping[Hashable, Tuple[int, int]] + ] = None, + reflect_type: str = None, + **pad_width_kwargs: Any, ): """ - Return a new Variable with paddings. + Return a new Variable with padded data. Parameters ---------- - pad_width: Mapping of the form {dim: (before, after)} - Number of values padded to the edges of each dimension. - **pad_widths_kwargs: - Keyword argument for pad_widths + pad_width: Mapping with the form of {dim: (pad_before, pad_after)} + Number of values padded along each dimension. + {dim: pad} is a shortcut for pad_before = pad_after = pad + mode: (str) + See numpy / Dask docs + stat_length : int, tuple or mapping of the form {dim: tuple} + Used in 'maximum', 'mean', 'median', and 'minimum'. Number of + values at edge of each axis used to calculate the statistic value. + constant_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'constant'. The values to set the padded values for each + axis. + end_values : scalar, tuple or mapping of the form {dim: tuple} + Used in 'linear_ramp'. The values used for the ending value of the + linear_ramp and that will form the edge of the padded array. + reflect_type : {'even', 'odd'}, optional + Used in 'reflect', and 'symmetric'. The 'even' style is the + default with an unaltered reflection around the edge value. For + the 'odd' style, the extended part of the array is created by + subtracting the reflected values from two times the edge value. + **pad_width_kwargs: + One of pad_width or pad_width_kwargs must be provided. + + Returns + ------- + padded : Variable + Variable with the same dimensions and attributes but padded data. """ - pad_widths = either_dict_or_kwargs(pad_widths, pad_widths_kwargs, "pad") + pad_width = either_dict_or_kwargs(pad_width, pad_width_kwargs, "pad") - if fill_value is dtypes.NA: - dtype, fill_value = dtypes.maybe_promote(self.dtype) + # change default behaviour of pad with mode constant + if mode == "constant" and ( + constant_values is None or constant_values is dtypes.NA + ): + dtype, constant_values = dtypes.maybe_promote(self.dtype) else: dtype = self.dtype - if isinstance(self.data, dask_array_type): - array = self.data - - # Dask does not yet support pad. We manually implement it. - # https://github.com/dask/dask/issues/1926 - for d, pad in pad_widths.items(): - axis = self.get_axis_num(d) - before_shape = list(array.shape) - before_shape[axis] = pad[0] - before_chunks = list(array.chunks) - before_chunks[axis] = (pad[0],) - after_shape = list(array.shape) - after_shape[axis] = pad[1] - after_chunks = list(array.chunks) - after_chunks[axis] = (pad[1],) - - arrays = [] - if pad[0] > 0: - arrays.append( - da.full( - before_shape, fill_value, dtype=dtype, chunks=before_chunks - ) - ) - arrays.append(array) - if pad[1] > 0: - arrays.append( - da.full( - after_shape, fill_value, dtype=dtype, chunks=after_chunks - ) - ) - if len(arrays) > 1: - array = da.concatenate(arrays, axis=axis) - else: - pads = [(0, 0) if d not in pad_widths else pad_widths[d] for d in self.dims] - array = np.pad( - self.data.astype(dtype, copy=False), - pads, - mode="constant", - constant_values=fill_value, + # create pad_options_kwargs, numpy requires only relevant kwargs to be nonempty + if isinstance(stat_length, dict): + stat_length = self._pad_options_dim_to_index( + stat_length, fill_with_shape=True ) + if isinstance(constant_values, dict): + constant_values = self._pad_options_dim_to_index(constant_values) + if isinstance(end_values, dict): + end_values = self._pad_options_dim_to_index(end_values) + + # workaround for bug in Dask's default value of stat_length https://github.com/dask/dask/issues/5303 + if stat_length is None and mode in ["maximum", "mean", "median", "minimum"]: + stat_length = [(n, n) for n in self.data.shape] # type: ignore + + # change integer values to a tuple of two of those values and change pad_width to index + for k, v in pad_width.items(): + if isinstance(v, numbers.Number): + pad_width[k] = (v, v) + pad_width_by_index = self._pad_options_dim_to_index(pad_width) + + # create pad_options_kwargs, numpy/dask requires only relevant kwargs to be nonempty + pad_option_kwargs = {} + if stat_length is not None: + pad_option_kwargs["stat_length"] = stat_length + if constant_values is not None: + pad_option_kwargs["constant_values"] = constant_values + if end_values is not None: + pad_option_kwargs["end_values"] = end_values + if reflect_type is not None: + pad_option_kwargs["reflect_type"] = reflect_type # type: ignore + + array = duck_array_ops.pad( + self.data.astype(dtype, copy=False), + pad_width_by_index, + mode=mode, + **pad_option_kwargs, + ) + return type(self)(self.dims, array) def _roll_one_dim(self, dim, count): @@ -1926,10 +1969,10 @@ def _coarsen_reshape(self, windows, boundary, side): if pad < 0: pad += window if side[d] == "left": - pad_widths = {d: (0, pad)} + pad_width = {d: (0, pad)} else: - pad_widths = {d: (pad, 0)} - variable = variable.pad_with_fill_value(pad_widths) + pad_width = {d: (pad, 0)} + variable = variable.pad(pad_width, mode="constant") else: raise TypeError( "{} is invalid for boundary. Valid option is 'exact', "
diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index b8a9c5edaf9..b63ff91f28e 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -4177,6 +4177,113 @@ def test_rank(self): y = DataArray([0.75, 0.25, np.nan, 0.5, 1.0], dims=("z",)) assert_equal(y.rank("z", pct=True), y) + def test_pad_constant(self): + ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5)) + actual = ar.pad(dim_0=(1, 3)) + expected = DataArray( + np.pad( + np.arange(3 * 4 * 5).reshape(3, 4, 5).astype(np.float32), + mode="constant", + pad_width=((1, 3), (0, 0), (0, 0)), + constant_values=np.nan, + ) + ) + assert actual.shape == (7, 4, 5) + assert_identical(actual, expected) + + def test_pad_coords(self): + ar = DataArray( + np.arange(3 * 4 * 5).reshape(3, 4, 5), + [("x", np.arange(3)), ("y", np.arange(4)), ("z", np.arange(5))], + ) + actual = ar.pad(x=(1, 3), constant_values=1) + expected = DataArray( + np.pad( + np.arange(3 * 4 * 5).reshape(3, 4, 5), + mode="constant", + pad_width=((1, 3), (0, 0), (0, 0)), + constant_values=1, + ), + [ + ( + "x", + np.pad( + np.arange(3).astype(np.float32), + mode="constant", + pad_width=(1, 3), + constant_values=np.nan, + ), + ), + ("y", np.arange(4)), + ("z", np.arange(5)), + ], + ) + assert_identical(actual, expected) + + @pytest.mark.parametrize("mode", ("minimum", "maximum", "mean", "median")) + @pytest.mark.parametrize( + "stat_length", (None, 3, (1, 3), {"dim_0": (2, 1), "dim_2": (4, 2)}) + ) + def test_pad_stat_length(self, mode, stat_length): + ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5)) + actual = ar.pad(dim_0=(1, 3), dim_2=(2, 2), mode=mode, stat_length=stat_length) + if isinstance(stat_length, dict): + stat_length = (stat_length["dim_0"], (4, 4), stat_length["dim_2"]) + expected = DataArray( + np.pad( + np.arange(3 * 4 * 5).reshape(3, 4, 5), + pad_width=((1, 3), (0, 0), (2, 2)), + mode=mode, + stat_length=stat_length, + ) + ) + assert actual.shape == (7, 4, 9) + assert_identical(actual, expected) + + @pytest.mark.parametrize( + "end_values", (None, 3, (3, 5), {"dim_0": (2, 1), "dim_2": (4, 2)}) + ) + def test_pad_linear_ramp(self, end_values): + ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5)) + actual = ar.pad( + dim_0=(1, 3), dim_2=(2, 2), mode="linear_ramp", end_values=end_values + ) + if end_values is None: + end_values = 0 + elif isinstance(end_values, dict): + end_values = (end_values["dim_0"], (4, 4), end_values["dim_2"]) + expected = DataArray( + np.pad( + np.arange(3 * 4 * 5).reshape(3, 4, 5), + pad_width=((1, 3), (0, 0), (2, 2)), + mode="linear_ramp", + end_values=end_values, + ) + ) + assert actual.shape == (7, 4, 9) + assert_identical(actual, expected) + + @pytest.mark.parametrize("mode", ("reflect", "symmetric")) + @pytest.mark.parametrize("reflect_type", (None, "even", "odd")) + def test_pad_reflect(self, mode, reflect_type): + + ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5)) + actual = ar.pad( + dim_0=(1, 3), dim_2=(2, 2), mode=mode, reflect_type=reflect_type + ) + np_kwargs = { + "array": np.arange(3 * 4 * 5).reshape(3, 4, 5), + "pad_width": ((1, 3), (0, 0), (2, 2)), + "mode": mode, + } + # numpy does not support reflect_type=None + if reflect_type is not None: + np_kwargs["reflect_type"] = reflect_type + expected = DataArray(np.pad(**np_kwargs)) + + assert actual.shape == (7, 4, 9) + assert_identical(actual, expected) + @pytest.fixture(params=[1]) def da(request): diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 44ffafb23b1..ab684434aa6 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -5457,6 +5457,19 @@ def test_ipython_key_completion(self): ds.data_vars[item] # should not raise assert sorted(actual) == sorted(expected) + def test_pad(self): + ds = create_test_data(seed=1) + padded = ds.pad(dim2=(1, 1), constant_values=42) + + assert padded["dim2"].shape == (11,) + assert padded["var1"].shape == (8, 11) + assert padded["var2"].shape == (8, 11) + assert padded["var3"].shape == (10, 8) + assert dict(padded.dims) == {"dim1": 8, "dim2": 11, "dim3": 10, "time": 20} + + np.testing.assert_equal(padded["var1"].isel(dim2=[0, -1]).data, 42) + np.testing.assert_equal(padded["dim2"][[0, -1]].data, np.nan) + # Py.test tests diff --git a/xarray/tests/test_sparse.py b/xarray/tests/test_sparse.py index 21a212c29b3..09ab1be9af9 100644 --- a/xarray/tests/test_sparse.py +++ b/xarray/tests/test_sparse.py @@ -175,7 +175,7 @@ def test_variable_property(prop): marks=xfail(reason="mixed sparse-dense operation"), ), param( - do("pad_with_fill_value", pad_widths={"x": (1, 1)}, fill_value=5), + do("pad", mode="constant", pad_widths={"x": (1, 1)}, fill_value=5), True, marks=xfail(reason="Missing implementation for np.pad"), ), diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 9f63ebb1d42..bc784c6adc2 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -9,7 +9,7 @@ from xarray.core import formatting from xarray.core.npcompat import IS_NEP18_ACTIVE -from .test_variable import VariableSubclassobjects +from .test_variable import _PAD_XR_NP_ARGS, VariableSubclassobjects pint = pytest.importorskip("pint") DimensionalityError = pint.errors.DimensionalityError @@ -2032,42 +2032,32 @@ def test_no_conflicts(self, unit, dtype): assert expected == actual - def test_pad(self, dtype): + @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + def test_pad_constant_values(self, dtype, xr_arg, np_arg): data = np.arange(4 * 3 * 2).reshape(4, 3, 2).astype(dtype) * unit_registry.m v = xr.Variable(["x", "y", "z"], data) - xr_args = [{"x": (2, 1)}, {"y": (0, 3)}, {"x": (3, 1), "z": (2, 0)}] - np_args = [ - ((2, 1), (0, 0), (0, 0)), - ((0, 0), (0, 3), (0, 0)), - ((3, 1), (0, 0), (2, 0)), - ] - for xr_arg, np_arg in zip(xr_args, np_args): - actual = v.pad_with_fill_value(**xr_arg) - expected = xr.Variable( - v.dims, - np.pad( - v.data.astype(float), - np_arg, - mode="constant", - constant_values=np.nan, - ), - ) - xr.testing.assert_identical(expected, actual) - assert_units_equal(expected, actual) - assert isinstance(actual._data, type(v._data)) + actual = v.pad(**xr_arg, mode="constant") + expected = xr.Variable( + v.dims, + np.pad( + v.data.astype(float), np_arg, mode="constant", constant_values=np.nan, + ), + ) + xr.testing.assert_identical(expected, actual) + assert_units_equal(expected, actual) + assert isinstance(actual._data, type(v._data)) # for the boolean array, we pad False data = np.full_like(data, False, dtype=bool).reshape(4, 3, 2) v = xr.Variable(["x", "y", "z"], data) - for xr_arg, np_arg in zip(xr_args, np_args): - actual = v.pad_with_fill_value(fill_value=data.flat[0], **xr_arg) - expected = xr.Variable( - v.dims, - np.pad(v.data, np_arg, mode="constant", constant_values=v.data.flat[0]), - ) - xr.testing.assert_identical(actual, expected) - assert_units_equal(expected, actual) + actual = v.pad(**xr_arg, mode="constant", constant_values=data.flat[0]) + expected = xr.Variable( + v.dims, + np.pad(v.data, np_arg, mode="constant", constant_values=v.data.flat[0]), + ) + xr.testing.assert_identical(actual, expected) + assert_units_equal(expected, actual) @pytest.mark.parametrize( "unit,error", @@ -2089,16 +2079,16 @@ def test_pad(self, dtype): pytest.param(unit_registry.m, None, id="identical_unit"), ), ) - def test_pad_with_fill_value(self, unit, error, dtype): + def test_pad_unit_constant_value(self, unit, error, dtype): array = np.linspace(0, 5, 3 * 10).reshape(3, 10).astype(dtype) * unit_registry.m variable = xr.Variable(("x", "y"), array) fill_value = -100 * unit - func = method("pad_with_fill_value", x=(2, 3), y=(1, 4)) + func = method("pad", mode="constant", x=(2, 3), y=(1, 4)) if error is not None: with pytest.raises(error): - func(variable, fill_value=fill_value) + func(variable, constant_values=fill_value) return @@ -2106,11 +2096,11 @@ def test_pad_with_fill_value(self, unit, error, dtype): expected = attach_units( func( strip_units(variable), - fill_value=strip_units(convert_units(fill_value, units)), + constant_values=strip_units(convert_units(fill_value, units)), ), units, ) - actual = func(variable, fill_value=fill_value) + actual = func(variable, constant_values=fill_value) assert_units_equal(expected, actual) xr.testing.assert_identical(expected, actual) diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index c86ecd0121f..428ad9280e2 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -38,6 +38,14 @@ source_ndarray, ) +_PAD_XR_NP_ARGS = [ + [{"x": (2, 1)}, ((2, 1), (0, 0), (0, 0))], + [{"x": 1}, ((1, 1), (0, 0), (0, 0))], + [{"y": (0, 3)}, ((0, 0), (0, 3), (0, 0))], + [{"x": (3, 1), "z": (2, 0)}, ((3, 1), (0, 0), (2, 0))], + [{"x": (3, 1), "z": 2}, ((3, 1), (0, 0), (2, 2))], +] + class VariableSubclassobjects: def test_properties(self): @@ -785,36 +793,65 @@ def test_getitem_error(self): with raises_regex(IndexError, "Dimensions of indexers mis"): v[:, ind] - def test_pad(self): + @pytest.mark.parametrize( + "mode", + [ + "mean", + pytest.param( + "median", + marks=pytest.mark.xfail(reason="median is not implemented by Dask"), + ), + pytest.param( + "reflect", marks=pytest.mark.xfail(reason="dask.array.pad bug") + ), + "edge", + pytest.param( + "linear_ramp", + marks=pytest.mark.xfail( + reason="pint bug: https://github.com/hgrecco/pint/issues/1026" + ), + ), + "maximum", + "minimum", + "symmetric", + "wrap", + ], + ) + @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + def test_pad(self, mode, xr_arg, np_arg): data = np.arange(4 * 3 * 2).reshape(4, 3, 2) v = self.cls(["x", "y", "z"], data) - xr_args = [{"x": (2, 1)}, {"y": (0, 3)}, {"x": (3, 1), "z": (2, 0)}] - np_args = [ - ((2, 1), (0, 0), (0, 0)), - ((0, 0), (0, 3), (0, 0)), - ((3, 1), (0, 0), (2, 0)), - ] - for xr_arg, np_arg in zip(xr_args, np_args): - actual = v.pad_with_fill_value(**xr_arg) - expected = np.pad( - np.array(v.data.astype(float)), - np_arg, - mode="constant", - constant_values=np.nan, - ) - assert_array_equal(actual, expected) - assert isinstance(actual._data, type(v._data)) + actual = v.pad(mode=mode, **xr_arg) + expected = np.pad(data, np_arg, mode=mode) + + assert_array_equal(actual, expected) + assert isinstance(actual._data, type(v._data)) + + @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + def test_pad_constant_values(self, xr_arg, np_arg): + data = np.arange(4 * 3 * 2).reshape(4, 3, 2) + v = self.cls(["x", "y", "z"], data) + + actual = v.pad(**xr_arg) + expected = np.pad( + np.array(v.data.astype(float)), + np_arg, + mode="constant", + constant_values=np.nan, + ) + assert_array_equal(actual, expected) + assert isinstance(actual._data, type(v._data)) # for the boolean array, we pad False data = np.full_like(data, False, dtype=bool).reshape(4, 3, 2) v = self.cls(["x", "y", "z"], data) - for xr_arg, np_arg in zip(xr_args, np_args): - actual = v.pad_with_fill_value(fill_value=False, **xr_arg) - expected = np.pad( - np.array(v.data), np_arg, mode="constant", constant_values=False - ) - assert_array_equal(actual, expected) + + actual = v.pad(mode="constant", constant_values=False, **xr_arg) + expected = np.pad( + np.array(v.data), np_arg, mode="constant", constant_values=False + ) + assert_array_equal(actual, expected) def test_rolling_window(self): # Just a working test. See test_nputils for the algorithm validation @@ -2054,8 +2091,28 @@ def test_getitem_uint(self): super().test_getitem_fancy() @pytest.mark.xfail - def test_pad(self): - super().test_rolling_window() + @pytest.mark.parametrize( + "mode", + [ + "mean", + "median", + "reflect", + "edge", + "linear_ramp", + "maximum", + "minimum", + "symmetric", + "wrap", + ], + ) + @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + def test_pad(self, mode, xr_arg, np_arg): + super().test_pad(mode, xr_arg, np_arg) + + @pytest.mark.xfail + @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS) + def test_pad_constant_values(self, xr_arg, np_arg): + super().test_pad_constant_values(xr_arg, np_arg) @pytest.mark.xfail def test_rolling_window(self):
[ { "path": "doc/api-hidden.rst", "old_path": "a/doc/api-hidden.rst", "new_path": "b/doc/api-hidden.rst", "metadata": "diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst\nindex 437f53b1a91..cc9517a98ba 100644\n--- a/doc/api-hidden.rst\n+++ b/doc/api-hidden.rst\n@@ -379,7 +379,6 @@\n Variable.min\n Variable.no_conflicts\n Variable.notnull\n- Variable.pad_with_fill_value\n Variable.prod\n Variable.quantile\n Variable.rank\n@@ -453,7 +452,6 @@\n IndexVariable.min\n IndexVariable.no_conflicts\n IndexVariable.notnull\n- IndexVariable.pad_with_fill_value\n IndexVariable.prod\n IndexVariable.quantile\n IndexVariable.rank\n" }, { "path": "doc/api.rst", "old_path": "a/doc/api.rst", "new_path": "b/doc/api.rst", "metadata": "diff --git a/doc/api.rst b/doc/api.rst\nindex 4492d882355..b3b6aa9139d 100644\n--- a/doc/api.rst\n+++ b/doc/api.rst\n@@ -220,6 +220,7 @@ Reshaping and reorganizing\n Dataset.to_stacked_array\n Dataset.shift\n Dataset.roll\n+ Dataset.pad\n Dataset.sortby\n Dataset.broadcast_like\n \n@@ -399,6 +400,7 @@ Reshaping and reorganizing\n DataArray.to_unstacked_dataset\n DataArray.shift\n DataArray.roll\n+ DataArray.pad\n DataArray.sortby\n DataArray.broadcast_like\n \n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 24120270444..fa71be23db9 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -125,6 +125,8 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- Implement :py:meth:`DataArray.pad` and :py:meth:`Dataset.pad`. (:issue:`2605`, :pull:`3596`).\n+ By `Mark Boer <https://github.com/mark-boer>`_.\n - :py:meth:`DataArray.sel` and :py:meth:`Dataset.sel` now support :py:class:`pandas.CategoricalIndex`. (:issue:`3669`)\n By `Keisuke Fujii <https://github.com/fujiisoup>`_.\n - Support using an existing, opened h5netcdf ``File`` with\n" } ]
0015
9fbb4170c1732fe2f3cd57b2b96d770a5bac50ed
[ "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_center", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_number_strings", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_variable.py::TestVariable::test_copy[int-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_set_dims_object_dtype", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis2-dim2-q2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_shift2d", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_not_a_time", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_variable.py::TestVariable::test_quantile[0-x-q1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_variable.py::TestVariable::test_rank", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_size_zero", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_equals_all_dtypes", "xarray/tests/test_variable.py::TestVariable::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_timedelta64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_0d_timedelta", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_variable.py::TestVariable::test_shift[fill_value0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_variable.py::TestVariable::test_squeeze", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_load", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_changes_metadata", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_variable.py::TestVariable::test_0d_str", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_name", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_multiindex_default_level_names", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_rolling_window", "xarray/tests/test_variable.py::TestVariable::test_broadcasting_failures", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_variable.py::TestVariable::test_equals_all_dtypes", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_string", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_variable.py::TestVariable::test_indexing_0d_unicode", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_variable.py::TestAsCompatibleData::test_zeros_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_variable.py::TestVariable::test_replace", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-0.25]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_setitem", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_identity", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_data", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_variable.py::TestVariable::test_big_endian_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_variable.py::TestVariable::test_1d_reduce", "xarray/tests/test_variable.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_dataarray.py::TestDataArray::test_where_lambda", "xarray/tests/test_variable.py::TestVariable::test_copy[float-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_numpy_same_methods", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_variable.py::TestVariable::test_copy_index_with_data", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_unstack_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_float", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_variable.py::TestVariable::test_as_variable", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[int-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[int-True]", "xarray/tests/test_variable.py::TestVariable::test_isel", "xarray/tests/test_dataset.py::TestDataset::test_rename_does_not_change_DatetimeIndex_type", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_variable.py::TestVariable::test_copy_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_broadcasting_math", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_variable.py::TestIndexVariable::test_datetime64", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_object", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_dot_align_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_timedelta64", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_level_names", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_advanced", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_variable.py::TestBackendIndexing::test_NumpyIndexingAdapter", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_variable.py::TestAsCompatibleData::test_converted_types", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis3-dim3-0.25]", "xarray/tests/test_variable.py::TestVariable::test___array__", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_variable.py::TestVariable::test_repr_lazy_data", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_dataset.py::TestDataset::test_categorical_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_variable.py::TestVariable::test_unstack", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataset.py::TestDataset::test_categorical_reindex", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_encoding_preserved", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_uint", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis2-dim2-q1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_variable.py::TestVariable::test_unstack_2d", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_object_conversion", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_variable.py::TestVariable::test_copy[str-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask_size_zero", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis3-dim3-q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_variable.py::TestVariable::test_count", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[str-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_real_and_imag", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_variable.py::TestIndexVariable::test_1d_math", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_with_data_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-q2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_variable.py::TestBackendIndexing::test_MemoryCachedArray", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataset.py::test_rolling_keep_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_variable.py::TestIndexVariable::test_index_and_concat_datetime", "xarray/tests/test_variable.py::TestIndexVariable::test___array__", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_variable.py::TestVariable::test_detect_indexer_type", "xarray/tests/test_variable.py::TestVariable::test_quantile[None-None-q2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_map", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_variable.py::TestVariable::test_copy[str-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_mixed_dtypes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[None-None-0.25]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_variable.py::TestVariable::test_no_conflicts", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_int", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_variable.py::TestVariable::test_index_0d_not_a_time", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask_nd_indexer", "xarray/tests/test_variable.py::TestIndexVariable::test_timedelta64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_unstack_fill_value", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_variable.py::TestVariable::test_pandas_cateogrical_dtype", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_0d_array", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_variable.py::TestVariable::test_concat_fixed_len_str", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_variable.py::TestVariable::test_pandas_data", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_datetime64_with_tz", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_variable.py::TestVariable::test_inplace_math", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_0d_object_array_with_list", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_2d_input", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_index_and_concat_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_unchanged_types", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_variable.py::TestVariable::test_timedelta64_conversion_scalar", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d_fancy", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_string", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[q1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_shift[2]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_attrs", "xarray/tests/test_variable.py::TestVariable::test_quantile[0-x-q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_init", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_periods", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_1d_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_stack_unstack_consistency", "xarray/tests/test_variable.py::TestVariable::test_copy_with_data", "xarray/tests/test_variable.py::TestVariable::test_array_interface", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_cateogrical_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_datetime64_conversion", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-0.25]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_variable.py::TestVariable::test_set_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_ones_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_1d_fancy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_variable.py::TestVariable::test_binary_ops_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_get_level_variable", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_with_data", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_period_index", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_uint_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_variable.py::TestVariable::test_coarsen_keep_attrs", "xarray/tests/test_variable.py::TestVariable::test_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_variable.py::TestVariable::test_index_0d_object", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_variable.py::TestVariable::test_concat", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::test_coarsen_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis2-dim2-0.25]", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_fixed_len_str", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul_align_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_variable.py::TestVariable::test_index_0d_timedelta64", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_ellipsis_transpose_different_ordered_vars", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-q2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_variable.py::TestVariable::test_quantile[None-None-0.25]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_int", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_variable.py::TestVariable::test_coarsen_2d", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_apply_pending_deprecated_map", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_sel_categorical_error", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_dict", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_aggregate_complex", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_roll", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_copy_with_data_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-q2]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_variable.py::TestVariable::test_object_conversion", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[0.25]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis2-dim2-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_variable.py::TestVariable::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_variable.py::TestVariable::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_stack_errors", "xarray/tests/test_variable.py::TestAsCompatibleData::test_masked_array", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_data", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_variable.py::TestVariable::test_aggregate_complex", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_variable.py::TestBackendIndexing::test_CopyOnWriteArray", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_items", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_concat_number_strings", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_quantile[0-x-0.25]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_reduce_funcs", "xarray/tests/test_variable.py::TestVariable::test_coarsen", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask", "xarray/tests/test_variable.py::TestVariable::test_indexer_type", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_variable.py::TestIndexVariable::test_eq_all_dtypes", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[0-x-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_propagate_indexes", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_float", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_copy[int-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_variable.py::TestVariable::test_concat_mixed_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[str-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_variable.py::TestVariable::test_roll_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_from_level", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_variable.py::TestVariable::test_stack", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[-0.1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[float-False]", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_variable.py::TestVariable::test_quantile[axis3-dim3-q1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-q1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_copy_index_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_getitem_uint_1d", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_nd_indexer", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_variable.py::TestVariable::test_getitem_dict", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_0d_time_data", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_to_index", "xarray/tests/test_variable.py::TestVariable::test_pandas_period_index", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[q3]", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataset.py::test_coarsen_absent_dims_error[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_replace", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_0d_time_data", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_variable.py::TestBackendIndexing::test_LazilyOuterIndexedArray", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_get_axis_num", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_variable.py::TestVariable::test_datetime64_conversion_scalar", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_variable.py::TestVariable::test_1d_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_variable.py::TestVariable::test_eq_all_dtypes", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile[axis3-dim3-0.25]", "xarray/tests/test_variable.py::TestVariable::test_pandas_datetime64_with_tz", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index_with_data", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_unsupported_type", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_variable.py::TestVariable::test_quantile[None-None-q1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_variable.py::TestVariable::test_broadcast_equals", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_sel_categorical", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_ndarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_variable.py::TestVariable::test_load", "xarray/tests/test_variable.py::TestVariable::test_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[float-True]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_quantile[q2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_0d_object_array_with_list", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[1.1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat", "xarray/tests/test_variable.py::TestVariable::test_transpose_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_variable.py::TestVariable::test_copy[float-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_0d_array", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_coordinate_alias", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_propagate_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_categorical", "xarray/tests/test_variable.py::TestVariable::test_data_and_values", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_variable.py::TestVariable::test_concat_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_variable.py::TestVariable::test_getitem_fancy", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_numpy_string", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_variable.py::TestVariable::test_getitem_basic", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[q2]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_datetime64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_map", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_shift[2.0]", "xarray/tests/test_variable.py::TestVariable::test_reduce_keepdims", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_multiindex", "xarray/tests/test_variable.py::TestIndexVariable::test_encoding_preserved", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_1d", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]" ]
[ "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-mean]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-wrap]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-minimum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[3-mean]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-mean]", "xarray/tests/test_variable.py::TestVariable::test_pad_constant_values[xr_arg0-np_arg0]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-edge]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[even-symmetric]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[odd-symmetric]", "xarray/tests/test_variable.py::TestVariable::test_pad_constant_values[xr_arg1-np_arg1]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-maximum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-symmetric]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[3-minimum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-mean]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-wrap]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[None-minimum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-minimum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length3-maximum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[3-maximum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-maximum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-symmetric]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_coords", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-maximum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_linear_ramp[end_values3]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-minimum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[None-maximum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-wrap]", "xarray/tests/test_variable.py::TestVariable::test_pad_constant_values[xr_arg4-np_arg4]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-wrap]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[None-reflect]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_linear_ramp[3]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length3-minimum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-edge]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_constant", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_linear_ramp[end_values2]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length2-maximum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-symmetric]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[None-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_linear_ramp[None]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-symmetric]", "xarray/tests/test_dataset.py::TestDataset::test_pad", "xarray/tests/test_variable.py::TestVariable::test_pad_constant_values[xr_arg2-np_arg2]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-wrap]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-edge]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-minimum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[None-symmetric]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[even-reflect]", "xarray/tests/test_variable.py::TestVariable::test_pad_constant_values[xr_arg3-np_arg3]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg0-np_arg0-symmetric]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length3-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length3-mean]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg2-np_arg2-edge]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-edge]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[3-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length2-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length2-minimum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg1-np_arg1-maximum]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_stat_length[stat_length2-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_pad_reflect[odd-reflect]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg4-np_arg4-minimum]", "xarray/tests/test_variable.py::TestVariable::test_pad[xr_arg3-np_arg3-maximum]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "field", "name": "constant_values" }, { "type": "field", "name": "pad_width" }, { "type": "field", "name": "pad_width" }, { "type": "field", "name": "stat_length" }, { "type": "field", "name": "mode" }, { "type": "field", "name": "pad_width" }, { "type": "field", "name": "end_values" }, { "type": "field", "name": "pad_width" }, { "type": "field", "name": "constant_values" }, { "type": "field", "name": "reflect_type" }, { "type": "field", "name": "mode" }, { "type": "field", "name": "mode" }, { "type": "field", "name": "padded" }, { "type": "field", "name": "reflect_type" }, { "type": "field", "name": "end_values" }, { "type": "field", "name": "stat_length" }, { "type": "field", "name": "end_values" }, { "type": "field", "name": "stat_length" }, { "type": "field", "name": "reflect_type" } ] }
[ { "path": "doc/api-hidden.rst", "old_path": "a/doc/api-hidden.rst", "new_path": "b/doc/api-hidden.rst", "metadata": "diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst\nindex 437f53b1a91..cc9517a98ba 100644\n--- a/doc/api-hidden.rst\n+++ b/doc/api-hidden.rst\n@@ -379,7 +379,6 @@\n Variable.min\n Variable.no_conflicts\n Variable.notnull\n- Variable.pad_with_fill_value\n Variable.prod\n Variable.quantile\n Variable.rank\n@@ -453,7 +452,6 @@\n IndexVariable.min\n IndexVariable.no_conflicts\n IndexVariable.notnull\n- IndexVariable.pad_with_fill_value\n IndexVariable.prod\n IndexVariable.quantile\n IndexVariable.rank\n" }, { "path": "doc/api.rst", "old_path": "a/doc/api.rst", "new_path": "b/doc/api.rst", "metadata": "diff --git a/doc/api.rst b/doc/api.rst\nindex 4492d882355..b3b6aa9139d 100644\n--- a/doc/api.rst\n+++ b/doc/api.rst\n@@ -220,6 +220,7 @@ Reshaping and reorganizing\n Dataset.to_stacked_array\n Dataset.shift\n Dataset.roll\n+ Dataset.pad\n Dataset.sortby\n Dataset.broadcast_like\n \n@@ -399,6 +400,7 @@ Reshaping and reorganizing\n DataArray.to_unstacked_dataset\n DataArray.shift\n DataArray.roll\n+ DataArray.pad\n DataArray.sortby\n DataArray.broadcast_like\n \n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 24120270444..fa71be23db9 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -125,6 +125,8 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- Implement :py:meth:`DataArray.pad` and :py:meth:`Dataset.pad`. (:issue:`<PRID>`, :pull:`<PRID>`).\n+ By `<NAME>`_.\n - :py:meth:`DataArray.sel` and :py:meth:`Dataset.sel` now support :py:class:`pandas.CategoricalIndex`. (:issue:`<PRID>`)\n By `<NAME>`_.\n - Support using an existing, opened h5netcdf ``File`` with\n" } ]
diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst index 437f53b1a91..cc9517a98ba 100644 --- a/doc/api-hidden.rst +++ b/doc/api-hidden.rst @@ -379,7 +379,6 @@ Variable.min Variable.no_conflicts Variable.notnull - Variable.pad_with_fill_value Variable.prod Variable.quantile Variable.rank @@ -453,7 +452,6 @@ IndexVariable.min IndexVariable.no_conflicts IndexVariable.notnull - IndexVariable.pad_with_fill_value IndexVariable.prod IndexVariable.quantile IndexVariable.rank diff --git a/doc/api.rst b/doc/api.rst index 4492d882355..b3b6aa9139d 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -220,6 +220,7 @@ Reshaping and reorganizing Dataset.to_stacked_array Dataset.shift Dataset.roll + Dataset.pad Dataset.sortby Dataset.broadcast_like @@ -399,6 +400,7 @@ Reshaping and reorganizing DataArray.to_unstacked_dataset DataArray.shift DataArray.roll + DataArray.pad DataArray.sortby DataArray.broadcast_like diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 24120270444..fa71be23db9 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -125,6 +125,8 @@ Breaking changes New Features ~~~~~~~~~~~~ +- Implement :py:meth:`DataArray.pad` and :py:meth:`Dataset.pad`. (:issue:`<PRID>`, :pull:`<PRID>`). + By `<NAME>`_. - :py:meth:`DataArray.sel` and :py:meth:`Dataset.sel` now support :py:class:`pandas.CategoricalIndex`. (:issue:`<PRID>`) By `<NAME>`_. - Support using an existing, opened h5netcdf ``File`` with If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'field', 'name': 'constant_values'}, {'type': 'field', 'name': 'pad_width'}, {'type': 'field', 'name': 'pad_width'}, {'type': 'field', 'name': 'stat_length'}, {'type': 'field', 'name': 'mode'}, {'type': 'field', 'name': 'pad_width'}, {'type': 'field', 'name': 'end_values'}, {'type': 'field', 'name': 'pad_width'}, {'type': 'field', 'name': 'constant_values'}, {'type': 'field', 'name': 'reflect_type'}, {'type': 'field', 'name': 'mode'}, {'type': 'field', 'name': 'mode'}, {'type': 'field', 'name': 'padded'}, {'type': 'field', 'name': 'reflect_type'}, {'type': 'field', 'name': 'end_values'}, {'type': 'field', 'name': 'stat_length'}, {'type': 'field', 'name': 'end_values'}, {'type': 'field', 'name': 'stat_length'}, {'type': 'field', 'name': 'reflect_type'}]
pydata/xarray
pydata__xarray-3424
https://github.com/pydata/xarray/pull/3424
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 73618782460..7a97e262ac9 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -34,6 +34,9 @@ New Features to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest using `...`. By `Maximilian Roos <https://github.com/max-sixty>`_ +- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the + `dims=...` option to sum over the union of dimensions of all input arrays + (:issue:`3423`) by `Mathias Hauser <https://github.com/mathause>`_. - Added integration tests against `pint <https://pint.readthedocs.io/>`_. (:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_. diff --git a/xarray/core/computation.py b/xarray/core/computation.py index 1393d76f283..96992bd2a3a 100644 --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1055,9 +1055,9 @@ def dot(*arrays, dims=None, **kwargs): ---------- arrays: DataArray (or Variable) objects Arrays to compute. - dims: str or tuple of strings, optional - Which dimensions to sum over. - If not speciified, then all the common dimensions are summed over. + dims: '...', str or tuple of strings, optional + Which dimensions to sum over. Ellipsis ('...') sums over all dimensions. + If not specified, then all the common dimensions are summed over. **kwargs: dict Additional keyword arguments passed to numpy.einsum or dask.array.einsum @@ -1070,7 +1070,7 @@ def dot(*arrays, dims=None, **kwargs): -------- >>> import numpy as np - >>> import xarray as xp + >>> import xarray as xr >>> da_a = xr.DataArray(np.arange(3 * 2).reshape(3, 2), dims=['a', 'b']) >>> da_b = xr.DataArray(np.arange(3 * 2 * 2).reshape(3, 2, 2), ... dims=['a', 'b', 'c']) @@ -1117,6 +1117,14 @@ def dot(*arrays, dims=None, **kwargs): [273, 446, 619]]) Dimensions without coordinates: a, d + >>> xr.dot(da_a, da_b) + <xarray.DataArray (c: 2)> + array([110, 125]) + Dimensions without coordinates: c + + >>> xr.dot(da_a, da_b, dims=...) + <xarray.DataArray ()> + array(235) """ from .dataarray import DataArray from .variable import Variable @@ -1141,7 +1149,9 @@ def dot(*arrays, dims=None, **kwargs): einsum_axes = "abcdefghijklmnopqrstuvwxyz" dim_map = {d: einsum_axes[i] for i, d in enumerate(all_dims)} - if dims is None: + if dims is ...: + dims = all_dims + elif dims is None: # find dimensions that occur more than one times dim_counts = Counter() for arr in arrays: diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 33dcad13204..2e59af57260 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2742,9 +2742,9 @@ def dot( ---------- other : DataArray The other array with which the dot product is performed. - dims: hashable or sequence of hashables, optional - Along which dimensions to be summed over. Default all the common - dimensions are summed over. + dims: '...', hashable or sequence of hashables, optional + Which dimensions to sum over. Ellipsis ('...') sums over all dimensions. + If not specified, then all the common dimensions are summed over. Returns -------
diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py index 383427b479b..1f2634cc9b0 100644 --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -998,6 +998,23 @@ def test_dot(use_dask): assert actual.dims == ("b",) assert (actual.data == np.zeros(actual.shape)).all() + # Ellipsis (...) sums over all dimensions + actual = xr.dot(da_a, da_b, dims=...) + assert actual.dims == () + assert (actual.data == np.einsum("ij,ijk->", a, b)).all() + + actual = xr.dot(da_a, da_b, da_c, dims=...) + assert actual.dims == () + assert (actual.data == np.einsum("ij,ijk,kl-> ", a, b, c)).all() + + actual = xr.dot(da_a, dims=...) + assert actual.dims == () + assert (actual.data == np.einsum("ij-> ", a)).all() + + actual = xr.dot(da_a.sel(a=[]), da_a.sel(a=[]), dims=...) + assert actual.dims == () + assert (actual.data == np.zeros(actual.shape)).all() + # Invalid cases if not use_dask: with pytest.raises(TypeError): diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index ad474d533be..38fe7384df2 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -3925,6 +3925,16 @@ def test_dot(self): expected = DataArray(expected_vals, coords=[x, j], dims=["x", "j"]) assert_equal(expected, actual) + # Ellipsis: all dims are shared + actual = da.dot(da, dims=...) + expected = da.dot(da) + assert_equal(expected, actual) + + # Ellipsis: not all dims are shared + actual = da.dot(dm, dims=...) + expected = da.dot(dm, dims=("j", "x", "y", "z")) + assert_equal(expected, actual) + with pytest.raises(NotImplementedError): da.dot(dm.to_dataset(name="dm")) with pytest.raises(TypeError):
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 73618782460..7a97e262ac9 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -34,6 +34,9 @@ New Features\n to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n using `...`.\n By `Maximilian Roos <https://github.com/max-sixty>`_\n+- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the\n+ `dims=...` option to sum over the union of dimensions of all input arrays\n+ (:issue:`3423`) by `Mathias Hauser <https://github.com/mathause>`_.\n - Added integration tests against `pint <https://pint.readthedocs.io/>`_.\n (:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.\n \n" } ]
0014
74ca69a3b7b53d2b8cc8c88ddaf0fe8c6c7bbf6c
[ "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_computation.py::test_broadcast_compat_data_2d", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_computation.py::test_dataset_join", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_computation.py::test_broadcast_compat_data_1d", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_computation.py::test_apply_groupby_add", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_changes_metadata", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_computation.py::test_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_computation.py::test_apply_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_identity", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_ndarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_computation.py::test_collect_dict_values", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_computation.py::test_vectorize", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_computation.py::test_output_wrong_number", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_computation.py::test_apply_1d_and_0d", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_computation.py::test_apply_output_core_dimension", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_apply", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_computation.py::test_apply_identity", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_computation.py::test_apply_input_core_dimension", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_computation.py::test_output_wrong_dim_size", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_computation.py::test_unified_dim_sizes", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_computation.py::test_apply_two_outputs", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_computation.py::test_apply_two_inputs", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_center", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_computation.py::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_computation.py::test_output_wrong_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]" ]
[ "xarray/tests/test_computation.py::test_dot[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_dot" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 73618782460..7a97e262ac9 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -34,6 +34,9 @@ New Features\n to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n using `...`.\n By `<NAME>`_\n+- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the\n+ `dims=...` option to sum over the union of dimensions of all input arrays\n+ (:issue:`<PRID>`) by `<NAME>`_.\n - Added integration tests against `pint <https://pint.readthedocs.io/>`_.\n (:pull:`<PRID>`) by `<NAME>`_.\n \n" } ]
diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 73618782460..7a97e262ac9 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -34,6 +34,9 @@ New Features to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest using `...`. By `<NAME>`_ +- :py:func:`~xarray.dot`, and :py:func:`~xarray.DataArray.dot` now support the + `dims=...` option to sum over the union of dimensions of all input arrays + (:issue:`<PRID>`) by `<NAME>`_. - Added integration tests against `pint <https://pint.readthedocs.io/>`_. (:pull:`<PRID>`) by `<NAME>`_.
pydata/xarray
pydata__xarray-3459
https://github.com/pydata/xarray/pull/3459
diff --git a/doc/computation.rst b/doc/computation.rst index ae5f4bc5c66..d477cb63d72 100644 --- a/doc/computation.rst +++ b/doc/computation.rst @@ -462,13 +462,13 @@ Datasets support most of the same methods found on data arrays: abs(ds) Datasets also support NumPy ufuncs (requires NumPy v1.13 or newer), or -alternatively you can use :py:meth:`~xarray.Dataset.apply` to apply a function +alternatively you can use :py:meth:`~xarray.Dataset.map` to map a function to each variable in a dataset: .. ipython:: python np.sin(ds) - ds.apply(np.sin) + ds.map(np.sin) Datasets also use looping over variables for *broadcasting* in binary arithmetic. You can do arithmetic between any ``DataArray`` and a dataset: diff --git a/doc/groupby.rst b/doc/groupby.rst index 52a27f4f160..f5943703765 100644 --- a/doc/groupby.rst +++ b/doc/groupby.rst @@ -35,10 +35,11 @@ Let's create a simple example dataset: .. ipython:: python - ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 3))}, - coords={'x': [10, 20, 30, 40], - 'letters': ('x', list('abba'))}) - arr = ds['foo'] + ds = xr.Dataset( + {"foo": (("x", "y"), np.random.rand(4, 3))}, + coords={"x": [10, 20, 30, 40], "letters": ("x", list("abba"))}, + ) + arr = ds["foo"] ds If we groupby the name of a variable or coordinate in a dataset (we can also @@ -93,7 +94,7 @@ Apply ~~~~~ To apply a function to each group, you can use the flexible -:py:meth:`~xarray.DatasetGroupBy.apply` method. The resulting objects are automatically +:py:meth:`~xarray.DatasetGroupBy.map` method. The resulting objects are automatically concatenated back together along the group axis: .. ipython:: python @@ -101,7 +102,7 @@ concatenated back together along the group axis: def standardize(x): return (x - x.mean()) / x.std() - arr.groupby('letters').apply(standardize) + arr.groupby('letters').map(standardize) GroupBy objects also have a :py:meth:`~xarray.DatasetGroupBy.reduce` method and methods like :py:meth:`~xarray.DatasetGroupBy.mean` as shortcuts for applying an @@ -202,7 +203,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen dims=['ny','nx']) da da.groupby('lon').sum(...) - da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False) + da.groupby('lon').map(lambda x: x - x.mean(), shortcut=False) Because multidimensional groups have the ability to generate a very large number of bins, coarse-binning via :py:meth:`~xarray.Dataset.groupby_bins` diff --git a/doc/howdoi.rst b/doc/howdoi.rst index 721d1323e73..91644ba2718 100644 --- a/doc/howdoi.rst +++ b/doc/howdoi.rst @@ -44,7 +44,7 @@ How do I ... * - convert a possibly irregularly sampled timeseries to a regularly sampled timeseries - :py:meth:`DataArray.resample`, :py:meth:`Dataset.resample` (see :ref:`resampling` for more) * - apply a function on all data variables in a Dataset - - :py:meth:`Dataset.apply` + - :py:meth:`Dataset.map` * - write xarray objects with complex values to a netCDF file - :py:func:`Dataset.to_netcdf`, :py:func:`DataArray.to_netcdf` specifying ``engine="h5netcdf", invalid_netcdf=True`` * - make xarray objects look like other xarray objects diff --git a/doc/quick-overview.rst b/doc/quick-overview.rst index 7d84199323d..741b3d1a5fe 100644 --- a/doc/quick-overview.rst +++ b/doc/quick-overview.rst @@ -142,7 +142,7 @@ xarray supports grouped operations using a very similar API to pandas (see :ref: labels = xr.DataArray(['E', 'F', 'E'], [data.coords['y']], name='labels') labels data.groupby(labels).mean('y') - data.groupby(labels).apply(lambda x: x - x.min()) + data.groupby(labels).map(lambda x: x - x.min()) Plotting -------- diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 04fe88e9993..b572b1dda67 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -44,6 +44,13 @@ New Features option for dropping either labels or variables, but using the more specific methods is encouraged. (:pull:`3475`) By `Maximilian Roos <https://github.com/max-sixty>`_ +- :py:meth:`Dataset.map` & :py:meth:`GroupBy.map` & :py:meth:`Resample.map` have been added for + mapping / applying a function over each item in the collection, reflecting the widely used + and least surprising name for this operation. + The existing ``apply`` methods remain for backward compatibility, though using the ``map`` + methods is encouraged. + (:pull:`3459`) + By `Maximilian Roos <https://github.com/max-sixty>`_ - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) to represent all 'other' dimensions. For example, to move one dimension to the front, use `.transpose('x', ...)`. (:pull:`3421`) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index d2d37871ee9..c9ccd88b61e 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -919,7 +919,7 @@ def copy(self, deep: bool = True, data: Any = None) -> "DataArray": Coordinates: * x (x) <U1 'a' 'b' 'c' - See also + See Also -------- pandas.DataFrame.copy """ @@ -1716,7 +1716,7 @@ def stack( codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]], names=['x', 'y']) - See also + See Also -------- DataArray.unstack """ @@ -1764,7 +1764,7 @@ def unstack( >>> arr.identical(roundtripped) True - See also + See Also -------- DataArray.stack """ @@ -1922,6 +1922,11 @@ def drop( """Backward compatible method based on `drop_vars` and `drop_sel` Using either `drop_vars` or `drop_sel` is encouraged + + See Also + -------- + DataArray.drop_vars + DataArray.drop_sel """ ds = self._to_temp_dataset().drop(labels, dim, errors=errors) return self._from_temp_dataset(ds) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 2cadc90334c..dc5a315e72a 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3557,6 +3557,11 @@ def drop(self, labels=None, dim=None, *, errors="raise", **labels_kwargs): """Backward compatible method based on `drop_vars` and `drop_sel` Using either `drop_vars` or `drop_sel` is encouraged + + See Also + -------- + Dataset.drop_vars + Dataset.drop_sel """ if errors not in ["raise", "ignore"]: raise ValueError('errors must be either "raise" or "ignore"') @@ -4108,14 +4113,14 @@ def reduce( variables, coord_names=coord_names, attrs=attrs, indexes=indexes ) - def apply( + def map( self, func: Callable, keep_attrs: bool = None, args: Iterable[Any] = (), **kwargs: Any, ) -> "Dataset": - """Apply a function over the data variables in this dataset. + """Apply a function to each variable in this dataset Parameters ---------- @@ -4135,7 +4140,7 @@ def apply( Returns ------- applied : Dataset - Resulting dataset from applying ``func`` over each data variable. + Resulting dataset from applying ``func`` to each data variable. Examples -------- @@ -4148,7 +4153,7 @@ def apply( Data variables: foo (dim_0, dim_1) float64 -0.3751 -1.951 -1.945 0.2948 0.711 -0.3948 bar (x) int64 -1 2 - >>> ds.apply(np.fabs) + >>> ds.map(np.fabs) <xarray.Dataset> Dimensions: (dim_0: 2, dim_1: 3, x: 2) Dimensions without coordinates: dim_0, dim_1, x @@ -4165,6 +4170,27 @@ def apply( attrs = self.attrs if keep_attrs else None return type(self)(variables, attrs=attrs) + def apply( + self, + func: Callable, + keep_attrs: bool = None, + args: Iterable[Any] = (), + **kwargs: Any, + ) -> "Dataset": + """ + Backward compatible implementation of ``map`` + + See Also + -------- + Dataset.map + """ + warnings.warn( + "Dataset.apply may be deprecated in the future. Using Dataset.map is encouraged", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.map(func, keep_attrs, args, **kwargs) + def assign( self, variables: Mapping[Hashable, Any] = None, **variables_kwargs: Hashable ) -> "Dataset": diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index c8906e34737..8ae65d9b9df 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -608,7 +608,7 @@ def assign_coords(self, coords=None, **coords_kwargs): Dataset.swap_dims """ coords_kwargs = either_dict_or_kwargs(coords, coords_kwargs, "assign_coords") - return self.apply(lambda ds: ds.assign_coords(**coords_kwargs)) + return self.map(lambda ds: ds.assign_coords(**coords_kwargs)) def _maybe_reorder(xarray_obj, dim, positions): @@ -655,8 +655,8 @@ def lookup_order(dimension): new_order = sorted(stacked.dims, key=lookup_order) return stacked.transpose(*new_order, transpose_coords=self._restore_coord_dims) - def apply(self, func, shortcut=False, args=(), **kwargs): - """Apply a function over each array in the group and concatenate them + def map(self, func, shortcut=False, args=(), **kwargs): + """Apply a function to each array in the group and concatenate them together into a new array. `func` is called like `func(ar, *args, **kwargs)` for each array `ar` @@ -702,6 +702,21 @@ def apply(self, func, shortcut=False, args=(), **kwargs): applied = (maybe_wrap_array(arr, func(arr, *args, **kwargs)) for arr in grouped) return self._combine(applied, shortcut=shortcut) + def apply(self, func, shortcut=False, args=(), **kwargs): + """ + Backward compatible implementation of ``map`` + + See Also + -------- + DataArrayGroupBy.map + """ + warnings.warn( + "GroupBy.apply may be deprecated in the future. Using GroupBy.map is encouraged", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.map(func, shortcut=shortcut, args=args, **kwargs) + def _combine(self, applied, restore_coord_dims=False, shortcut=False): """Recombine the applied objects like the original.""" applied_example, applied = peek_at(applied) @@ -765,7 +780,7 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): if dim is None: dim = self._group_dim - out = self.apply( + out = self.map( self._obj.__class__.quantile, shortcut=False, q=q, @@ -820,7 +835,7 @@ def reduce_array(ar): check_reduce_dims(dim, self.dims) - return self.apply(reduce_array, shortcut=shortcut) + return self.map(reduce_array, shortcut=shortcut) ops.inject_reduce_methods(DataArrayGroupBy) @@ -828,8 +843,8 @@ def reduce_array(ar): class DatasetGroupBy(GroupBy, ImplementsDatasetReduce): - def apply(self, func, args=(), shortcut=None, **kwargs): - """Apply a function over each Dataset in the group and concatenate them + def map(self, func, args=(), shortcut=None, **kwargs): + """Apply a function to each Dataset in the group and concatenate them together into a new Dataset. `func` is called like `func(ds, *args, **kwargs)` for each dataset `ds` @@ -862,6 +877,22 @@ def apply(self, func, args=(), shortcut=None, **kwargs): applied = (func(ds, *args, **kwargs) for ds in self._iter_grouped()) return self._combine(applied) + def apply(self, func, args=(), shortcut=None, **kwargs): + """ + Backward compatible implementation of ``map`` + + See Also + -------- + DatasetGroupBy.map + """ + + warnings.warn( + "GroupBy.apply may be deprecated in the future. Using GroupBy.map is encouraged", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.map(func, shortcut=shortcut, args=args, **kwargs) + def _combine(self, applied): """Recombine the applied objects like the original.""" applied_example, applied = peek_at(applied) @@ -914,7 +945,7 @@ def reduce_dataset(ds): check_reduce_dims(dim, self.dims) - return self.apply(reduce_dataset) + return self.map(reduce_dataset) def assign(self, **kwargs): """Assign data variables by group. @@ -923,7 +954,7 @@ def assign(self, **kwargs): -------- Dataset.assign """ - return self.apply(lambda ds: ds.assign(**kwargs)) + return self.map(lambda ds: ds.assign(**kwargs)) ops.inject_reduce_methods(DatasetGroupBy) diff --git a/xarray/core/resample.py b/xarray/core/resample.py index 2cb1bd55e19..fb388490d06 100644 --- a/xarray/core/resample.py +++ b/xarray/core/resample.py @@ -1,3 +1,5 @@ +import warnings + from . import ops from .groupby import DataArrayGroupBy, DatasetGroupBy @@ -173,8 +175,8 @@ def __init__(self, *args, dim=None, resample_dim=None, **kwargs): super().__init__(*args, **kwargs) - def apply(self, func, shortcut=False, args=(), **kwargs): - """Apply a function over each array in the group and concatenate them + def map(self, func, shortcut=False, args=(), **kwargs): + """Apply a function to each array in the group and concatenate them together into a new array. `func` is called like `func(ar, *args, **kwargs)` for each array `ar` @@ -212,7 +214,9 @@ def apply(self, func, shortcut=False, args=(), **kwargs): applied : DataArray or DataArray The result of splitting, applying and combining this array. """ - combined = super().apply(func, shortcut=shortcut, args=args, **kwargs) + # TODO: the argument order for Resample doesn't match that for its parent, + # GroupBy + combined = super().map(func, shortcut=shortcut, args=args, **kwargs) # If the aggregation function didn't drop the original resampling # dimension, then we need to do so before we can rename the proxy @@ -225,6 +229,21 @@ def apply(self, func, shortcut=False, args=(), **kwargs): return combined + def apply(self, func, args=(), shortcut=None, **kwargs): + """ + Backward compatible implementation of ``map`` + + See Also + -------- + DataArrayResample.map + """ + warnings.warn( + "Resample.apply may be deprecated in the future. Using Resample.map is encouraged", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.map(func=func, shortcut=shortcut, args=args, **kwargs) + ops.inject_reduce_methods(DataArrayResample) ops.inject_binary_ops(DataArrayResample) @@ -247,7 +266,7 @@ def __init__(self, *args, dim=None, resample_dim=None, **kwargs): super().__init__(*args, **kwargs) - def apply(self, func, args=(), shortcut=None, **kwargs): + def map(self, func, args=(), shortcut=None, **kwargs): """Apply a function over each Dataset in the groups generated for resampling and concatenate them together into a new Dataset. @@ -282,6 +301,22 @@ def apply(self, func, args=(), shortcut=None, **kwargs): return combined.rename({self._resample_dim: self._dim}) + def apply(self, func, args=(), shortcut=None, **kwargs): + """ + Backward compatible implementation of ``map`` + + See Also + -------- + DataSetResample.map + """ + + warnings.warn( + "Resample.apply may be deprecated in the future. Using Resample.map is encouraged", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.map(func=func, shortcut=shortcut, args=args, **kwargs) + def reduce(self, func, dim=None, keep_attrs=None, **kwargs): """Reduce the items in this group by applying `func` along the pre-defined resampling dimension.
diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index acfe684d220..42fae2c9dd4 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -2417,7 +2417,7 @@ def test_groupby_properties(self): assert_array_equal(expected_groups[key], grouped.groups[key]) assert 3 == len(grouped) - def test_groupby_apply_identity(self): + def test_groupby_map_identity(self): expected = self.make_groupby_example_array() idx = expected.coords["y"] @@ -2428,7 +2428,7 @@ def identity(x): for shortcut in [False, True]: for squeeze in [False, True]: grouped = expected.groupby(g, squeeze=squeeze) - actual = grouped.apply(identity, shortcut=shortcut) + actual = grouped.map(identity, shortcut=shortcut) assert_identical(expected, actual) def test_groupby_sum(self): @@ -2461,7 +2461,7 @@ def test_groupby_sum(self): [["a", "b", "c"]], ["abc"], ) - actual = array["y"].groupby("abc").apply(np.sum) + actual = array["y"].groupby("abc").map(np.sum) assert_allclose(expected, actual) actual = array["y"].groupby("abc").sum(...) assert_allclose(expected, actual) @@ -2532,7 +2532,7 @@ def test_groupby_reduce_attrs(self): expected.attrs["foo"] = "bar" assert_identical(expected, actual) - def test_groupby_apply_center(self): + def test_groupby_map_center(self): def center(x): return x - np.mean(x) @@ -2545,16 +2545,16 @@ def center(x): ) expected_ds["foo"] = (["x", "y"], exp_data) expected_centered = expected_ds["foo"] - assert_allclose(expected_centered, grouped.apply(center)) + assert_allclose(expected_centered, grouped.map(center)) - def test_groupby_apply_ndarray(self): + def test_groupby_map_ndarray(self): # regression test for #326 array = self.make_groupby_example_array() grouped = array.groupby("abc") - actual = grouped.apply(np.asarray) + actual = grouped.map(np.asarray) assert_equal(array, actual) - def test_groupby_apply_changes_metadata(self): + def test_groupby_map_changes_metadata(self): def change_metadata(x): x.coords["x"] = x.coords["x"] * 2 x.attrs["fruit"] = "lemon" @@ -2562,7 +2562,7 @@ def change_metadata(x): array = self.make_groupby_example_array() grouped = array.groupby("abc") - actual = grouped.apply(change_metadata) + actual = grouped.map(change_metadata) expected = array.copy() expected = change_metadata(expected) assert_equal(expected, actual) @@ -2631,7 +2631,7 @@ def test_groupby_restore_dim_order(self): ("a", ("a", "y")), ("b", ("x", "b")), ]: - result = array.groupby(by).apply(lambda x: x.squeeze()) + result = array.groupby(by).map(lambda x: x.squeeze()) assert result.dims == expected_dims def test_groupby_restore_coord_dims(self): @@ -2651,13 +2651,13 @@ def test_groupby_restore_coord_dims(self): ("a", ("a", "y")), ("b", ("x", "b")), ]: - result = array.groupby(by, restore_coord_dims=True).apply( + result = array.groupby(by, restore_coord_dims=True).map( lambda x: x.squeeze() )["c"] assert result.dims == expected_dims with pytest.warns(FutureWarning): - array.groupby("x").apply(lambda x: x.squeeze()) + array.groupby("x").map(lambda x: x.squeeze()) def test_groupby_first_and_last(self): array = DataArray([1, 2, 3, 4, 5], dims="x") @@ -2699,9 +2699,9 @@ def test_groupby_multidim(self): actual_sum = array.groupby(dim).sum(...) assert_identical(expected_sum, actual_sum) - def test_groupby_multidim_apply(self): + def test_groupby_multidim_map(self): array = self.make_groupby_multidim_example_array() - actual = array.groupby("lon").apply(lambda x: x - x.mean()) + actual = array.groupby("lon").map(lambda x: x - x.mean()) expected = DataArray( [[[-2.5, -6.0], [-5.0, -8.5]], [[2.5, 3.0], [8.0, 8.5]]], coords=array.coords, @@ -2722,7 +2722,7 @@ def test_groupby_bins(self): ) # the problem with this is that it overwrites the dimensions of array! # actual = array.groupby('dim_0', bins=bins).sum() - actual = array.groupby_bins("dim_0", bins).apply(lambda x: x.sum()) + actual = array.groupby_bins("dim_0", bins).map(lambda x: x.sum()) assert_identical(expected, actual) # make sure original array dims are unchanged assert len(array.dim_0) == 4 @@ -2744,12 +2744,12 @@ def test_groupby_bins_multidim(self): bins = [0, 15, 20] bin_coords = pd.cut(array["lat"].values.flat, bins).categories expected = DataArray([16, 40], dims="lat_bins", coords={"lat_bins": bin_coords}) - actual = array.groupby_bins("lat", bins).apply(lambda x: x.sum()) + actual = array.groupby_bins("lat", bins).map(lambda x: x.sum()) assert_identical(expected, actual) # modify the array coordinates to be non-monotonic after unstacking array["lat"].data = np.array([[10.0, 20.0], [20.0, 10.0]]) expected = DataArray([28, 28], dims="lat_bins", coords={"lat_bins": bin_coords}) - actual = array.groupby_bins("lat", bins).apply(lambda x: x.sum()) + actual = array.groupby_bins("lat", bins).map(lambda x: x.sum()) assert_identical(expected, actual) def test_groupby_bins_sort(self): @@ -2784,7 +2784,7 @@ def func(arg1, arg2, arg3=0.0): times = pd.date_range("2000", periods=3, freq="D") da = xr.DataArray([1.0, 1.0, 1.0], coords=[times], dims=["time"]) expected = xr.DataArray([3.0, 3.0, 3.0], coords=[times], dims=["time"]) - actual = da.resample(time="D").apply(func, args=(1.0,), arg3=1.0) + actual = da.resample(time="D").map(func, args=(1.0,), arg3=1.0) assert_identical(actual, expected) def test_resample_first(self): diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 50e78c9f685..d001c43da94 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -3310,17 +3310,17 @@ def identity(x): return x for k in ["x", "c", "y"]: - actual = data.groupby(k, squeeze=False).apply(identity) + actual = data.groupby(k, squeeze=False).map(identity) assert_equal(data, actual) def test_groupby_returns_new_type(self): data = Dataset({"z": (["x", "y"], np.random.randn(3, 5))}) - actual = data.groupby("x").apply(lambda ds: ds["z"]) + actual = data.groupby("x").map(lambda ds: ds["z"]) expected = data["z"] assert_identical(expected, actual) - actual = data["z"].groupby("x").apply(lambda x: x.to_dataset()) + actual = data["z"].groupby("x").map(lambda x: x.to_dataset()) expected = data assert_identical(expected, actual) @@ -3639,7 +3639,7 @@ def func(arg1, arg2, arg3=0.0): times = pd.date_range("2000", freq="D", periods=3) ds = xr.Dataset({"foo": ("time", [1.0, 1.0, 1.0]), "time": times}) expected = xr.Dataset({"foo": ("time", [3.0, 3.0, 3.0]), "time": times}) - actual = ds.resample(time="D").apply(func, args=(1.0,), arg3=1.0) + actual = ds.resample(time="D").map(func, args=(1.0,), arg3=1.0) assert_identical(expected, actual) def test_to_array(self): @@ -4515,31 +4515,36 @@ def test_count(self): actual = ds.count() assert_identical(expected, actual) - def test_apply(self): + def test_map(self): data = create_test_data() data.attrs["foo"] = "bar" - assert_identical(data.apply(np.mean), data.mean()) + assert_identical(data.map(np.mean), data.mean()) expected = data.mean(keep_attrs=True) - actual = data.apply(lambda x: x.mean(keep_attrs=True), keep_attrs=True) + actual = data.map(lambda x: x.mean(keep_attrs=True), keep_attrs=True) assert_identical(expected, actual) - assert_identical( - data.apply(lambda x: x, keep_attrs=True), data.drop_vars("time") - ) + assert_identical(data.map(lambda x: x, keep_attrs=True), data.drop_vars("time")) def scale(x, multiple=1): return multiple * x - actual = data.apply(scale, multiple=2) + actual = data.map(scale, multiple=2) assert_equal(actual["var1"], 2 * data["var1"]) assert_identical(actual["numbers"], data["numbers"]) - actual = data.apply(np.asarray) + actual = data.map(np.asarray) expected = data.drop_vars("time") # time is not used on a data var assert_equal(expected, actual) + def test_apply_pending_deprecated_map(self): + data = create_test_data() + data.attrs["foo"] = "bar" + + with pytest.warns(PendingDeprecationWarning): + assert_identical(data.apply(np.mean), data.mean()) + def make_example_math_dataset(self): variables = { "bar": ("x", np.arange(100, 400, 100)), @@ -4566,15 +4571,15 @@ def test_dataset_number_math(self): def test_unary_ops(self): ds = self.make_example_math_dataset() - assert_identical(ds.apply(abs), abs(ds)) - assert_identical(ds.apply(lambda x: x + 4), ds + 4) + assert_identical(ds.map(abs), abs(ds)) + assert_identical(ds.map(lambda x: x + 4), ds + 4) for func in [ lambda x: x.isnull(), lambda x: x.round(), lambda x: x.astype(int), ]: - assert_identical(ds.apply(func), func(ds)) + assert_identical(ds.map(func), func(ds)) assert_identical(ds.isnull(), ~ds.notnull()) @@ -4587,7 +4592,7 @@ def test_unary_ops(self): def test_dataset_array_math(self): ds = self.make_example_math_dataset() - expected = ds.apply(lambda x: x - ds["foo"]) + expected = ds.map(lambda x: x - ds["foo"]) assert_identical(expected, ds - ds["foo"]) assert_identical(expected, -ds["foo"] + ds) assert_identical(expected, ds - ds["foo"].variable) @@ -4596,7 +4601,7 @@ def test_dataset_array_math(self): actual -= ds["foo"] assert_identical(expected, actual) - expected = ds.apply(lambda x: x + ds["bar"]) + expected = ds.map(lambda x: x + ds["bar"]) assert_identical(expected, ds + ds["bar"]) actual = ds.copy(deep=True) actual += ds["bar"] @@ -4612,7 +4617,7 @@ def test_dataset_dataset_math(self): assert_identical(ds, ds + 0 * ds) assert_identical(ds, ds + {"foo": 0, "bar": 0}) - expected = ds.apply(lambda x: 2 * x) + expected = ds.map(lambda x: 2 * x) assert_identical(expected, 2 * ds) assert_identical(expected, ds + ds) assert_identical(expected, ds + ds.data_vars) @@ -4709,7 +4714,7 @@ def test_dataset_transpose(self): assert_identical(expected, actual) actual = ds.transpose("x", "y") - expected = ds.apply(lambda x: x.transpose("x", "y", transpose_coords=True)) + expected = ds.map(lambda x: x.transpose("x", "y", transpose_coords=True)) assert_identical(expected, actual) ds = create_test_data() diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py index e2216547ac8..581affa3471 100644 --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -45,14 +45,14 @@ def test_groupby_dims_property(dataset): assert stacked.groupby("xy").dims == stacked.isel(xy=0).dims -def test_multi_index_groupby_apply(dataset): +def test_multi_index_groupby_map(dataset): # regression test for GH873 ds = dataset.isel(z=1, drop=True)[["foo"]] expected = 2 * ds actual = ( ds.stack(space=["x", "y"]) .groupby("space") - .apply(lambda x: 2 * x) + .map(lambda x: 2 * x) .unstack("space") ) assert_equal(expected, actual) @@ -107,23 +107,23 @@ def test_groupby_input_mutation(): assert_identical(array, array_copy) # should not modify inputs -def test_da_groupby_apply_func_args(): +def test_da_groupby_map_func_args(): def func(arg1, arg2, arg3=0): return arg1 + arg2 + arg3 array = xr.DataArray([1, 1, 1], [("x", [1, 2, 3])]) expected = xr.DataArray([3, 3, 3], [("x", [1, 2, 3])]) - actual = array.groupby("x").apply(func, args=(1,), arg3=1) + actual = array.groupby("x").map(func, args=(1,), arg3=1) assert_identical(expected, actual) -def test_ds_groupby_apply_func_args(): +def test_ds_groupby_map_func_args(): def func(arg1, arg2, arg3=0): return arg1 + arg2 + arg3 dataset = xr.Dataset({"foo": ("x", [1, 1, 1])}, {"x": [1, 2, 3]}) expected = xr.Dataset({"foo": ("x", [3, 3, 3])}, {"x": [1, 2, 3]}) - actual = dataset.groupby("x").apply(func, args=(1,), arg3=1) + actual = dataset.groupby("x").map(func, args=(1,), arg3=1) assert_identical(expected, actual) @@ -285,7 +285,7 @@ def test_groupby_drops_nans(): expected.variable.values[0, 0, :] = np.nan expected.variable.values[-1, -1, :] = np.nan expected.variable.values[3, 0, :] = np.nan - actual = grouped.apply(lambda x: x).transpose(*ds.variable.dims) + actual = grouped.map(lambda x: x).transpose(*ds.variable.dims) assert_identical(actual, expected) # reduction along grouped dimension diff --git a/xarray/tests/test_sparse.py b/xarray/tests/test_sparse.py index 8e2d4b8e064..a31da162487 100644 --- a/xarray/tests/test_sparse.py +++ b/xarray/tests/test_sparse.py @@ -339,7 +339,7 @@ def test_dataarray_property(prop): (do("copy"), True), (do("count"), False), (do("diff", "x"), True), - (do("drop", "x"), True), + (do("drop_vars", "x"), True), (do("expand_dims", {"z": 2}, axis=2), True), (do("get_axis_num", "x"), False), (do("get_index", "x"), False),
[ { "path": "doc/computation.rst", "old_path": "a/doc/computation.rst", "new_path": "b/doc/computation.rst", "metadata": "diff --git a/doc/computation.rst b/doc/computation.rst\nindex ae5f4bc5c66..d477cb63d72 100644\n--- a/doc/computation.rst\n+++ b/doc/computation.rst\n@@ -462,13 +462,13 @@ Datasets support most of the same methods found on data arrays:\n abs(ds)\n \n Datasets also support NumPy ufuncs (requires NumPy v1.13 or newer), or\n-alternatively you can use :py:meth:`~xarray.Dataset.apply` to apply a function\n+alternatively you can use :py:meth:`~xarray.Dataset.map` to map a function\n to each variable in a dataset:\n \n .. ipython:: python\n \n np.sin(ds)\n- ds.apply(np.sin)\n+ ds.map(np.sin)\n \n Datasets also use looping over variables for *broadcasting* in binary\n arithmetic. You can do arithmetic between any ``DataArray`` and a dataset:\n" }, { "path": "doc/groupby.rst", "old_path": "a/doc/groupby.rst", "new_path": "b/doc/groupby.rst", "metadata": "diff --git a/doc/groupby.rst b/doc/groupby.rst\nindex 52a27f4f160..f5943703765 100644\n--- a/doc/groupby.rst\n+++ b/doc/groupby.rst\n@@ -35,10 +35,11 @@ Let's create a simple example dataset:\n \n .. ipython:: python\n \n- ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 3))},\n- coords={'x': [10, 20, 30, 40],\n- 'letters': ('x', list('abba'))})\n- arr = ds['foo']\n+ ds = xr.Dataset(\n+ {\"foo\": ((\"x\", \"y\"), np.random.rand(4, 3))},\n+ coords={\"x\": [10, 20, 30, 40], \"letters\": (\"x\", list(\"abba\"))},\n+ )\n+ arr = ds[\"foo\"]\n ds\n \n If we groupby the name of a variable or coordinate in a dataset (we can also\n@@ -93,7 +94,7 @@ Apply\n ~~~~~\n \n To apply a function to each group, you can use the flexible\n-:py:meth:`~xarray.DatasetGroupBy.apply` method. The resulting objects are automatically\n+:py:meth:`~xarray.DatasetGroupBy.map` method. The resulting objects are automatically\n concatenated back together along the group axis:\n \n .. ipython:: python\n@@ -101,7 +102,7 @@ concatenated back together along the group axis:\n def standardize(x):\n return (x - x.mean()) / x.std()\n \n- arr.groupby('letters').apply(standardize)\n+ arr.groupby('letters').map(standardize)\n \n GroupBy objects also have a :py:meth:`~xarray.DatasetGroupBy.reduce` method and\n methods like :py:meth:`~xarray.DatasetGroupBy.mean` as shortcuts for applying an\n@@ -202,7 +203,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen\n dims=['ny','nx'])\n da\n da.groupby('lon').sum(...)\n- da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False)\n+ da.groupby('lon').map(lambda x: x - x.mean(), shortcut=False)\n \n Because multidimensional groups have the ability to generate a very large\n number of bins, coarse-binning via :py:meth:`~xarray.Dataset.groupby_bins`\n" }, { "path": "doc/howdoi.rst", "old_path": "a/doc/howdoi.rst", "new_path": "b/doc/howdoi.rst", "metadata": "diff --git a/doc/howdoi.rst b/doc/howdoi.rst\nindex 721d1323e73..91644ba2718 100644\n--- a/doc/howdoi.rst\n+++ b/doc/howdoi.rst\n@@ -44,7 +44,7 @@ How do I ...\n * - convert a possibly irregularly sampled timeseries to a regularly sampled timeseries\n - :py:meth:`DataArray.resample`, :py:meth:`Dataset.resample` (see :ref:`resampling` for more)\n * - apply a function on all data variables in a Dataset\n- - :py:meth:`Dataset.apply`\n+ - :py:meth:`Dataset.map`\n * - write xarray objects with complex values to a netCDF file\n - :py:func:`Dataset.to_netcdf`, :py:func:`DataArray.to_netcdf` specifying ``engine=\"h5netcdf\", invalid_netcdf=True``\n * - make xarray objects look like other xarray objects\n" }, { "path": "doc/quick-overview.rst", "old_path": "a/doc/quick-overview.rst", "new_path": "b/doc/quick-overview.rst", "metadata": "diff --git a/doc/quick-overview.rst b/doc/quick-overview.rst\nindex 7d84199323d..741b3d1a5fe 100644\n--- a/doc/quick-overview.rst\n+++ b/doc/quick-overview.rst\n@@ -142,7 +142,7 @@ xarray supports grouped operations using a very similar API to pandas (see :ref:\n labels = xr.DataArray(['E', 'F', 'E'], [data.coords['y']], name='labels')\n labels\n data.groupby(labels).mean('y')\n- data.groupby(labels).apply(lambda x: x - x.min())\n+ data.groupby(labels).map(lambda x: x - x.min())\n \n Plotting\n --------\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 04fe88e9993..b572b1dda67 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -44,6 +44,13 @@ New Features\n option for dropping either labels or variables, but using the more specific methods is encouraged.\n (:pull:`3475`)\n By `Maximilian Roos <https://github.com/max-sixty>`_\n+- :py:meth:`Dataset.map` & :py:meth:`GroupBy.map` & :py:meth:`Resample.map` have been added for \n+ mapping / applying a function over each item in the collection, reflecting the widely used\n+ and least surprising name for this operation.\n+ The existing ``apply`` methods remain for backward compatibility, though using the ``map``\n+ methods is encouraged.\n+ (:pull:`3459`)\n+ By `Maximilian Roos <https://github.com/max-sixty>`_\n - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n to represent all 'other' dimensions. For example, to move one dimension to the front,\n use `.transpose('x', ...)`. (:pull:`3421`)\n" } ]
0014
bb89534687ee5dac54d87c22154d3cfeb030ce21
[ "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_groupby.py::test_da_groupby_empty", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_quantile", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-x]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-z]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_groupby.py::test_groupby_grouping_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-y]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_groupby.py::test_groupby_dims_property", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_groupby.py::test_da_groupby_assign_coords", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_groupby.py::test_groupby_bins_timeseries", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_groupby.py::test_groupby_reduce_dimension_error", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_groupby.py::test_groupby_duplicate_coordinate_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_ellipsis_transpose_different_ordered_vars", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-month]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj0]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-x]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_propagate_indexes", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_groupby.py::test_da_groupby_quantile", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-z]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-month]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-y]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_propagate_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_groupby.py::test_groupby_input_mutation", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]" ]
[ "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_center", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_changes_metadata", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_identity", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_groupby.py::test_da_groupby_map_func_args", "xarray/tests/test_dataset.py::TestDataset::test_map", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataset.py::TestDataset::test_apply_pending_deprecated_map", "xarray/tests/test_groupby.py::test_groupby_drops_nans", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_map_ndarray", "xarray/tests/test_groupby.py::test_ds_groupby_map_func_args", "xarray/tests/test_groupby.py::test_multi_index_groupby_map", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_map", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/computation.rst", "old_path": "a/doc/computation.rst", "new_path": "b/doc/computation.rst", "metadata": "diff --git a/doc/computation.rst b/doc/computation.rst\nindex ae5f4bc5c66..d477cb63d72 100644\n--- a/doc/computation.rst\n+++ b/doc/computation.rst\n@@ -462,13 +462,13 @@ Datasets support most of the same methods found on data arrays:\n abs(ds)\n \n Datasets also support NumPy ufuncs (requires NumPy v1.13 or newer), or\n-alternatively you can use :py:meth:`~xarray.Dataset.apply` to apply a function\n+alternatively you can use :py:meth:`~xarray.Dataset.map` to map a function\n to each variable in a dataset:\n \n .. ipython:: python\n \n np.sin(ds)\n- ds.apply(np.sin)\n+ ds.map(np.sin)\n \n Datasets also use looping over variables for *broadcasting* in binary\n arithmetic. You can do arithmetic between any ``DataArray`` and a dataset:\n" }, { "path": "doc/groupby.rst", "old_path": "a/doc/groupby.rst", "new_path": "b/doc/groupby.rst", "metadata": "diff --git a/doc/groupby.rst b/doc/groupby.rst\nindex 52a27f4f160..f5943703765 100644\n--- a/doc/groupby.rst\n+++ b/doc/groupby.rst\n@@ -35,10 +35,11 @@ Let's create a simple example dataset:\n \n .. ipython:: python\n \n- ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 3))},\n- coords={'x': [10, 20, 30, 40],\n- 'letters': ('x', list('abba'))})\n- arr = ds['foo']\n+ ds = xr.Dataset(\n+ {\"foo\": ((\"x\", \"y\"), np.random.rand(4, 3))},\n+ coords={\"x\": [10, 20, 30, 40], \"letters\": (\"x\", list(\"abba\"))},\n+ )\n+ arr = ds[\"foo\"]\n ds\n \n If we groupby the name of a variable or coordinate in a dataset (we can also\n@@ -93,7 +94,7 @@ Apply\n ~~~~~\n \n To apply a function to each group, you can use the flexible\n-:py:meth:`~xarray.DatasetGroupBy.apply` method. The resulting objects are automatically\n+:py:meth:`~xarray.DatasetGroupBy.map` method. The resulting objects are automatically\n concatenated back together along the group axis:\n \n .. ipython:: python\n@@ -101,7 +102,7 @@ concatenated back together along the group axis:\n def standardize(x):\n return (x - x.mean()) / x.std()\n \n- arr.groupby('letters').apply(standardize)\n+ arr.groupby('letters').map(standardize)\n \n GroupBy objects also have a :py:meth:`~xarray.DatasetGroupBy.reduce` method and\n methods like :py:meth:`~xarray.DatasetGroupBy.mean` as shortcuts for applying an\n@@ -202,7 +203,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen\n dims=['ny','nx'])\n da\n da.groupby('lon').sum(...)\n- da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False)\n+ da.groupby('lon').map(lambda x: x - x.mean(), shortcut=False)\n \n Because multidimensional groups have the ability to generate a very large\n number of bins, coarse-binning via :py:meth:`~xarray.Dataset.groupby_bins`\n" }, { "path": "doc/howdoi.rst", "old_path": "a/doc/howdoi.rst", "new_path": "b/doc/howdoi.rst", "metadata": "diff --git a/doc/howdoi.rst b/doc/howdoi.rst\nindex 721d1323e73..91644ba2718 100644\n--- a/doc/howdoi.rst\n+++ b/doc/howdoi.rst\n@@ -44,7 +44,7 @@ How do I ...\n * - convert a possibly irregularly sampled timeseries to a regularly sampled timeseries\n - :py:meth:`DataArray.resample`, :py:meth:`Dataset.resample` (see :ref:`resampling` for more)\n * - apply a function on all data variables in a Dataset\n- - :py:meth:`Dataset.apply`\n+ - :py:meth:`Dataset.map`\n * - write xarray objects with complex values to a netCDF file\n - :py:func:`Dataset.to_netcdf`, :py:func:`DataArray.to_netcdf` specifying ``engine=\"h5netcdf\", invalid_netcdf=True``\n * - make xarray objects look like other xarray objects\n" }, { "path": "doc/quick-overview.rst", "old_path": "a/doc/quick-overview.rst", "new_path": "b/doc/quick-overview.rst", "metadata": "diff --git a/doc/quick-overview.rst b/doc/quick-overview.rst\nindex 7d84199323d..741b3d1a5fe 100644\n--- a/doc/quick-overview.rst\n+++ b/doc/quick-overview.rst\n@@ -142,7 +142,7 @@ xarray supports grouped operations using a very similar API to pandas (see :ref:\n labels = xr.DataArray(['E', 'F', 'E'], [data.coords['y']], name='labels')\n labels\n data.groupby(labels).mean('y')\n- data.groupby(labels).apply(lambda x: x - x.min())\n+ data.groupby(labels).map(lambda x: x - x.min())\n \n Plotting\n --------\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 04fe88e9993..b572b1dda67 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -44,6 +44,13 @@ New Features\n option for dropping either labels or variables, but using the more specific methods is encouraged.\n (:pull:`<PRID>`)\n By `<NAME>`_\n+- :py:meth:`Dataset.map` & :py:meth:`GroupBy.map` & :py:meth:`Resample.map` have been added for \n+ mapping / applying a function over each item in the collection, reflecting the widely used\n+ and least surprising name for this operation.\n+ The existing ``apply`` methods remain for backward compatibility, though using the ``map``\n+ methods is encouraged.\n+ (:pull:`<PRID>`)\n+ By `<NAME>`_\n - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n to represent all 'other' dimensions. For example, to move one dimension to the front,\n use `.transpose('x', ...)`. (:pull:`<PRID>`)\n" } ]
diff --git a/doc/computation.rst b/doc/computation.rst index ae5f4bc5c66..d477cb63d72 100644 --- a/doc/computation.rst +++ b/doc/computation.rst @@ -462,13 +462,13 @@ Datasets support most of the same methods found on data arrays: abs(ds) Datasets also support NumPy ufuncs (requires NumPy v1.13 or newer), or -alternatively you can use :py:meth:`~xarray.Dataset.apply` to apply a function +alternatively you can use :py:meth:`~xarray.Dataset.map` to map a function to each variable in a dataset: .. ipython:: python np.sin(ds) - ds.apply(np.sin) + ds.map(np.sin) Datasets also use looping over variables for *broadcasting* in binary arithmetic. You can do arithmetic between any ``DataArray`` and a dataset: diff --git a/doc/groupby.rst b/doc/groupby.rst index 52a27f4f160..f5943703765 100644 --- a/doc/groupby.rst +++ b/doc/groupby.rst @@ -35,10 +35,11 @@ Let's create a simple example dataset: .. ipython:: python - ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 3))}, - coords={'x': [10, 20, 30, 40], - 'letters': ('x', list('abba'))}) - arr = ds['foo'] + ds = xr.Dataset( + {"foo": (("x", "y"), np.random.rand(4, 3))}, + coords={"x": [10, 20, 30, 40], "letters": ("x", list("abba"))}, + ) + arr = ds["foo"] ds If we groupby the name of a variable or coordinate in a dataset (we can also @@ -93,7 +94,7 @@ Apply ~~~~~ To apply a function to each group, you can use the flexible -:py:meth:`~xarray.DatasetGroupBy.apply` method. The resulting objects are automatically +:py:meth:`~xarray.DatasetGroupBy.map` method. The resulting objects are automatically concatenated back together along the group axis: .. ipython:: python @@ -101,7 +102,7 @@ concatenated back together along the group axis: def standardize(x): return (x - x.mean()) / x.std() - arr.groupby('letters').apply(standardize) + arr.groupby('letters').map(standardize) GroupBy objects also have a :py:meth:`~xarray.DatasetGroupBy.reduce` method and methods like :py:meth:`~xarray.DatasetGroupBy.mean` as shortcuts for applying an @@ -202,7 +203,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen dims=['ny','nx']) da da.groupby('lon').sum(...) - da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False) + da.groupby('lon').map(lambda x: x - x.mean(), shortcut=False) Because multidimensional groups have the ability to generate a very large number of bins, coarse-binning via :py:meth:`~xarray.Dataset.groupby_bins` diff --git a/doc/howdoi.rst b/doc/howdoi.rst index 721d1323e73..91644ba2718 100644 --- a/doc/howdoi.rst +++ b/doc/howdoi.rst @@ -44,7 +44,7 @@ How do I ... * - convert a possibly irregularly sampled timeseries to a regularly sampled timeseries - :py:meth:`DataArray.resample`, :py:meth:`Dataset.resample` (see :ref:`resampling` for more) * - apply a function on all data variables in a Dataset - - :py:meth:`Dataset.apply` + - :py:meth:`Dataset.map` * - write xarray objects with complex values to a netCDF file - :py:func:`Dataset.to_netcdf`, :py:func:`DataArray.to_netcdf` specifying ``engine="h5netcdf", invalid_netcdf=True`` * - make xarray objects look like other xarray objects diff --git a/doc/quick-overview.rst b/doc/quick-overview.rst index 7d84199323d..741b3d1a5fe 100644 --- a/doc/quick-overview.rst +++ b/doc/quick-overview.rst @@ -142,7 +142,7 @@ xarray supports grouped operations using a very similar API to pandas (see :ref: labels = xr.DataArray(['E', 'F', 'E'], [data.coords['y']], name='labels') labels data.groupby(labels).mean('y') - data.groupby(labels).apply(lambda x: x - x.min()) + data.groupby(labels).map(lambda x: x - x.min()) Plotting -------- diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 04fe88e9993..b572b1dda67 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -44,6 +44,13 @@ New Features option for dropping either labels or variables, but using the more specific methods is encouraged. (:pull:`<PRID>`) By `<NAME>`_ +- :py:meth:`Dataset.map` & :py:meth:`GroupBy.map` & :py:meth:`Resample.map` have been added for + mapping / applying a function over each item in the collection, reflecting the widely used + and least surprising name for this operation. + The existing ``apply`` methods remain for backward compatibility, though using the ``map`` + methods is encouraged. + (:pull:`<PRID>`) + By `<NAME>`_ - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) to represent all 'other' dimensions. For example, to move one dimension to the front, use `.transpose('x', ...)`. (:pull:`<PRID>`)
pydata/xarray
pydata__xarray-3421
https://github.com/pydata/xarray/pull/3421
diff --git a/doc/reshaping.rst b/doc/reshaping.rst index 51202f9be41..455a24f9216 100644 --- a/doc/reshaping.rst +++ b/doc/reshaping.rst @@ -18,12 +18,14 @@ Reordering dimensions --------------------- To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables -on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`: +on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An +ellipsis (`...`) can be use to represent all other dimensions: .. ipython:: python ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])}) ds.transpose('y', 'z', 'x') + ds.transpose(..., 'x') # equivalent ds.transpose() # reverses all dimensions Expand and squeeze dimensions diff --git a/doc/whats-new.rst b/doc/whats-new.rst index dea110b5e46..cced7276ff3 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -25,6 +25,10 @@ Breaking changes New Features ~~~~~~~~~~~~ +- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) + to represent all 'other' dimensions. For example, to move one dimension to the front, + use `.transpose('x', ...)`. (:pull:`3421`) + By `Maximilian Roos <https://github.com/max-sixty>`_ - Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use `...` directly. As before, you can use this to instruct a `groupby` operation to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest diff --git a/setup.cfg b/setup.cfg index eee8b2477b2..fec2ca6bbe4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -117,4 +117,7 @@ tag_prefix = v parentdir_prefix = xarray- [aliases] -test = pytest \ No newline at end of file +test = pytest + +[pytest-watch] +nobeep = True \ No newline at end of file diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 5fccb9236e8..33dcad13204 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -1863,12 +1863,7 @@ def transpose(self, *dims: Hashable, transpose_coords: bool = None) -> "DataArra Dataset.transpose """ if dims: - if set(dims) ^ set(self.dims): - raise ValueError( - "arguments to transpose (%s) must be " - "permuted array dimensions (%s)" % (dims, tuple(self.dims)) - ) - + dims = tuple(utils.infix_dims(dims, self.dims)) variable = self.variable.transpose(*dims) if transpose_coords: coords: Dict[Hashable, Variable] = {} diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 55ac0bc6135..2a0464515c6 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3712,14 +3712,14 @@ def transpose(self, *dims: Hashable) -> "Dataset": DataArray.transpose """ if dims: - if set(dims) ^ set(self.dims): + if set(dims) ^ set(self.dims) and ... not in dims: raise ValueError( "arguments to transpose (%s) must be " "permuted dataset dimensions (%s)" % (dims, tuple(self.dims)) ) ds = self.copy() for name, var in self._variables.items(): - var_dims = tuple(dim for dim in dims if dim in var.dims) + var_dims = tuple(dim for dim in dims if dim in (var.dims + (...,))) ds._variables[name] = var.transpose(*var_dims) return ds diff --git a/xarray/core/utils.py b/xarray/core/utils.py index 6befe0b5efc..492c595a887 100644 --- a/xarray/core/utils.py +++ b/xarray/core/utils.py @@ -10,6 +10,7 @@ AbstractSet, Any, Callable, + Collection, Container, Dict, Hashable, @@ -660,6 +661,30 @@ def __len__(self) -> int: return len(self._data) - num_hidden +def infix_dims(dims_supplied: Collection, dims_all: Collection) -> Iterator: + """ + Resolves a supplied list containing an ellispsis representing other items, to + a generator with the 'realized' list of all items + """ + if ... in dims_supplied: + if len(set(dims_all)) != len(dims_all): + raise ValueError("Cannot use ellipsis with repeated dims") + if len([d for d in dims_supplied if d == ...]) > 1: + raise ValueError("More than one ellipsis supplied") + other_dims = [d for d in dims_all if d not in dims_supplied] + for d in dims_supplied: + if d == ...: + yield from other_dims + else: + yield d + else: + if set(dims_supplied) ^ set(dims_all): + raise ValueError( + f"{dims_supplied} must be a permuted list of {dims_all}, unless `...` is included" + ) + yield from dims_supplied + + def get_temp_dimname(dims: Container[Hashable], new_dim: Hashable) -> Hashable: """ Get an new dimension name based on new_dim, that is not used in dims. If the same name exists, we add an underscore(s) in the head. diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 93ad1eafb97..7d03fd58d39 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -25,6 +25,7 @@ OrderedSet, decode_numpy_dict_values, either_dict_or_kwargs, + infix_dims, ensure_us_time_resolution, ) @@ -1228,6 +1229,7 @@ def transpose(self, *dims) -> "Variable": """ if len(dims) == 0: dims = self.dims[::-1] + dims = tuple(infix_dims(dims, self.dims)) axes = self.get_axis_num(dims) if len(dims) < 2: # no need to transpose if only one dimension return self.copy(deep=False)
diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 88476e5e730..f85a33f7a3c 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -158,18 +158,21 @@ def source_ndarray(array): def assert_equal(a, b): + __tracebackhide__ = True xarray.testing.assert_equal(a, b) xarray.testing._assert_internal_invariants(a) xarray.testing._assert_internal_invariants(b) def assert_identical(a, b): + __tracebackhide__ = True xarray.testing.assert_identical(a, b) xarray.testing._assert_internal_invariants(a) xarray.testing._assert_internal_invariants(b) def assert_allclose(a, b, **kwargs): + __tracebackhide__ = True xarray.testing.assert_allclose(a, b, **kwargs) xarray.testing._assert_internal_invariants(a) xarray.testing._assert_internal_invariants(b) diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index 101bb44660c..ad474d533be 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -2068,6 +2068,10 @@ def test_transpose(self): ) assert_equal(expected, actual) + # same as previous but with ellipsis + actual = da.transpose("z", ..., "x", transpose_coords=True) + assert_equal(expected, actual) + with pytest.raises(ValueError): da.transpose("x", "y") diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index b3ffdf68e3f..647eb733adb 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -4675,6 +4675,10 @@ def test_dataset_transpose(self): ) assert_identical(expected, actual) + actual = ds.transpose(...) + expected = ds + assert_identical(expected, actual) + actual = ds.transpose("x", "y") expected = ds.apply(lambda x: x.transpose("x", "y", transpose_coords=True)) assert_identical(expected, actual) @@ -4690,13 +4694,32 @@ def test_dataset_transpose(self): expected_dims = tuple(d for d in new_order if d in ds[k].dims) assert actual[k].dims == expected_dims - with raises_regex(ValueError, "arguments to transpose"): + # same as above but with ellipsis + new_order = ("dim2", "dim3", "dim1", "time") + actual = ds.transpose("dim2", "dim3", ...) + for k in ds.variables: + expected_dims = tuple(d for d in new_order if d in ds[k].dims) + assert actual[k].dims == expected_dims + + with raises_regex(ValueError, "permuted"): ds.transpose("dim1", "dim2", "dim3") - with raises_regex(ValueError, "arguments to transpose"): + with raises_regex(ValueError, "permuted"): ds.transpose("dim1", "dim2", "dim3", "time", "extra_dim") assert "T" not in dir(ds) + def test_dataset_ellipsis_transpose_different_ordered_vars(self): + # https://github.com/pydata/xarray/issues/1081#issuecomment-544350457 + ds = Dataset( + dict( + a=(("w", "x", "y", "z"), np.ones((2, 3, 4, 5))), + b=(("x", "w", "y", "z"), np.zeros((3, 2, 4, 5))), + ) + ) + result = ds.transpose(..., "z", "y") + assert list(result["a"].dims) == list("wxzy") + assert list(result["b"].dims) == list("xwzy") + def test_dataset_retains_period_index_on_transpose(self): ds = create_test_data() diff --git a/xarray/tests/test_utils.py b/xarray/tests/test_utils.py index c36e8a1775d..5bb9deaf240 100644 --- a/xarray/tests/test_utils.py +++ b/xarray/tests/test_utils.py @@ -275,3 +275,27 @@ def test_either_dict_or_kwargs(): with pytest.raises(ValueError, match=r"foo"): result = either_dict_or_kwargs(dict(a=1), dict(a=1), "foo") + + +@pytest.mark.parametrize( + ["supplied", "all_", "expected"], + [ + (list("abc"), list("abc"), list("abc")), + (["a", ..., "c"], list("abc"), list("abc")), + (["a", ...], list("abc"), list("abc")), + (["c", ...], list("abc"), list("cab")), + ([..., "b"], list("abc"), list("acb")), + ([...], list("abc"), list("abc")), + ], +) +def test_infix_dims(supplied, all_, expected): + result = list(utils.infix_dims(supplied, all_)) + assert result == expected + + +@pytest.mark.parametrize( + ["supplied", "all_"], [([..., ...], list("abc")), ([...], list("aac"))] +) +def test_infix_dims_errors(supplied, all_): + with pytest.raises(ValueError): + list(utils.infix_dims(supplied, all_)) diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index 78723eda013..528027ed149 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -1280,6 +1280,9 @@ def test_transpose(self): w2 = Variable(["d", "b", "c", "a"], np.einsum("abcd->dbca", x)) assert w2.shape == (5, 3, 4, 2) assert_identical(w2, w.transpose("d", "b", "c", "a")) + assert_identical(w2, w.transpose("d", ..., "a")) + assert_identical(w2, w.transpose("d", "b", "c", ...)) + assert_identical(w2, w.transpose(..., "b", "c", "a")) assert_identical(w, w2.transpose("a", "b", "c", "d")) w3 = Variable(["b", "c", "d", "a"], np.einsum("abcd->bcda", x)) assert_identical(w, w3.transpose("a", "b", "c", "d"))
[ { "path": "doc/reshaping.rst", "old_path": "a/doc/reshaping.rst", "new_path": "b/doc/reshaping.rst", "metadata": "diff --git a/doc/reshaping.rst b/doc/reshaping.rst\nindex 51202f9be41..455a24f9216 100644\n--- a/doc/reshaping.rst\n+++ b/doc/reshaping.rst\n@@ -18,12 +18,14 @@ Reordering dimensions\n ---------------------\n \n To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables\n-on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`:\n+on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An \n+ellipsis (`...`) can be use to represent all other dimensions:\n \n .. ipython:: python\n \n ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])})\n ds.transpose('y', 'z', 'x')\n+ ds.transpose(..., 'x') # equivalent\n ds.transpose() # reverses all dimensions\n \n Expand and squeeze dimensions\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex dea110b5e46..cced7276ff3 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -25,6 +25,10 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n+ to represent all 'other' dimensions. For example, to move one dimension to the front,\n+ use `.transpose('x', ...)`. (:pull:`3421`)\n+ By `Maximilian Roos <https://github.com/max-sixty>`_\n - Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use\n `...` directly. As before, you can use this to instruct a `groupby` operation\n to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n" } ]
0014
fb0cf7b5fe56519a933ffcecbce9e9327fe236a6
[ "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_number_strings", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_variable.py::TestVariable::test_copy[int-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_set_dims_object_dtype", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_utils.py::test_is_grib_path", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_rounders", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_shift2d", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_not_a_time", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_variable.py::TestVariable::test_rank", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_size_zero", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_equals_all_dtypes", "xarray/tests/test_variable.py::TestVariable::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_timedelta64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_sorted_uniform", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_pad", "xarray/tests/test_variable.py::TestVariable::test_0d_timedelta", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_utils.py::TestDictionaries::test_ordered_dict_intersection", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_variable.py::TestVariable::test_shift[fill_value0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_variable.py::TestVariable::test_squeeze", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_load", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_variable.py::TestVariable::test_0d_str", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_changes_metadata", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_quantile", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_name", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_multiindex_default_level_names", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_rolling_window", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_ndarray", "xarray/tests/test_variable.py::TestVariable::test_broadcasting_failures", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_field_access", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_variable.py::TestVariable::test_equals_all_dtypes", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_string", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_variable.py::TestVariable::test_indexing_0d_unicode", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_variable.py::TestAsCompatibleData::test_zeros_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_setitem", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_data", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_variable.py::TestVariable::test_big_endian_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_variable.py::TestVariable::test_1d_reduce", "xarray/tests/test_variable.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_variable.py::TestVariable::test_copy[float-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_numpy_same_methods", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_variable.py::TestVariable::test_copy_index_with_data", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_unstack_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_float", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_utils.py::TestDictionaries::test_unsafe", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_variable.py::TestVariable::test_as_variable", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[int-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[int-True]", "xarray/tests/test_variable.py::TestVariable::test_isel", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_utils.py::TestDictionaries::test_frozen", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_variable.py::TestVariable::test_copy_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_broadcasting_math", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_variable.py::TestIndexVariable::test_datetime64", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_object", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_timedelta64", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_level_names", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_utils.py::TestDictionaries::test_equivalent", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_advanced", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_variable.py::TestBackendIndexing::test_NumpyIndexingAdapter", "xarray/tests/test_utils.py::TestArrayEquiv::test_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_variable.py::TestAsCompatibleData::test_converted_types", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test___array__", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_utils.py::TestDictionaries::test_sorted_keys_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_variable.py::TestVariable::test_repr_lazy_data", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_variable.py::TestVariable::test_unstack", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_encoding_preserved", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_uint", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_sorted_not_uniform", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_variable.py::TestVariable::test_unstack_2d", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_object_conversion", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_variable.py::TestVariable::test_copy[str-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask_size_zero", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_variable.py::TestVariable::test_count", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[str-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_real_and_imag", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_variable.py::TestIndexVariable::test_1d_math", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_variable.py::TestBackendIndexing::test_MemoryCachedArray", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_identity", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_variable.py::TestIndexVariable::test_index_and_concat_datetime", "xarray/tests/test_variable.py::TestIndexVariable::test___array__", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_variable.py::TestVariable::test_detect_indexer_type", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_variable.py::TestVariable::test_copy[str-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_mixed_dtypes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_variable.py::TestVariable::test_no_conflicts", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_int", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_not_datetime_type", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_variable.py::TestVariable::test_index_0d_not_a_time", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask_nd_indexer", "xarray/tests/test_variable.py::TestIndexVariable::test_timedelta64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_utils.py::test_safe_cast_to_index", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_variable.py::TestVariable::test_pandas_cateogrical_dtype", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_0d_array", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_variable.py::TestVariable::test_concat_fixed_len_str", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_variable.py::TestVariable::test_pandas_data", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_datetime64_with_tz", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_variable.py::TestVariable::test_inplace_math", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_utils.py::test_multiindex_from_product_levels", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_0d_object_array_with_list", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_2d_input", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_with_mask", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_utils.py::Test_hashable::test_hashable", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_utils.py::test_repr_object", "xarray/tests/test_variable.py::TestVariable::test_index_and_concat_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_strftime", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_unchanged_types", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_variable.py::TestVariable::test_timedelta64_conversion_scalar", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d_fancy", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_string", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_variable.py::TestVariable::test_shift[2]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_init", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_periods", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_utils.py::TestDictionaries::test_safe", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_1d_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_stack_unstack_consistency", "xarray/tests/test_variable.py::TestVariable::test_copy_with_data", "xarray/tests/test_variable.py::TestVariable::test_array_interface", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_cateogrical_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_datetime64_conversion", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_variable.py::TestVariable::test_set_dims", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_ones_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_1d_fancy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_variable.py::TestVariable::test_binary_ops_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_variable.py::TestIndexVariable::test_get_level_variable", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_with_data", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_period_index", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_uint_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_variable.py::TestVariable::test_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_variable.py::TestVariable::test_index_0d_object", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_variable.py::TestVariable::test_concat", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_fixed_len_str", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_variable.py::TestVariable::test_index_0d_timedelta64", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_not_sorted_not_uniform", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_seasons", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_int", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_variable.py::TestVariable::test_coarsen_2d", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_dict", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_aggregate_complex", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_roll", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_copy_with_data_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_apply", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_variable.py::TestVariable::test_object_conversion", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_two_numbers", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_variable.py::TestVariable::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_stack_errors", "xarray/tests/test_variable.py::TestAsCompatibleData::test_masked_array", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_pandas_data", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_variable.py::TestVariable::test_aggregate_complex", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_variable.py::TestBackendIndexing::test_CopyOnWriteArray", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_items", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_variable.py::TestVariable::test_concat_number_strings", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_reduce_funcs", "xarray/tests/test_variable.py::TestVariable::test_coarsen", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask", "xarray/tests/test_variable.py::TestVariable::test_indexer_type", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_utils.py::test_multiindex_from_product_levels_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_relative_tolerance", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_variable.py::TestIndexVariable::test_eq_all_dtypes", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_variable.py::TestIndexVariable::test_index_0d_float", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_copy[int-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_variable.py::TestVariable::test_concat_mixed_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[str-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_variable.py::TestVariable::test_roll_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_variable.py::TestVariable::test_stack", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[float-False]", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_quantile", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_variable.py::TestVariable::test_copy_index_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_variable.py::TestVariable::test_getitem_uint_1d", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_apply", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_variable.py::TestVariable::test_getitem_with_mask_nd_indexer", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_variable.py::TestVariable::test_getitem_dict", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_0d_time_data", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_to_index", "xarray/tests/test_variable.py::TestVariable::test_pandas_period_index", "xarray/tests/test_utils.py::TestAlias::test", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_utils.py::TestDictionaries::test_dict_equiv", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_variable.py::TestVariable::test_0d_time_data", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_variable.py::TestBackendIndexing::test_LazilyOuterIndexedArray", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_variable.py::TestVariable::test_get_axis_num", "xarray/tests/test_utils.py::Test_is_uniform_and_sorted::test_not_sorted_uniform", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_utils.py::test_either_dict_or_kwargs", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_variable.py::TestVariable::test_datetime64_conversion_scalar", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_variable.py::TestVariable::test_1d_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_variable.py::TestVariable::test_eq_all_dtypes", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_variable.py::TestIndexVariable::test_copy_index_with_data", "xarray/tests/test_variable.py::TestVariable::test_pandas_datetime64_with_tz", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_unsupported_type", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_variable.py::TestVariable::test_broadcast_equals", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_real_and_imag", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_variable.py::TestVariable::test_load", "xarray/tests/test_variable.py::TestVariable::test_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_utils.py::test_is_remote_uri", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_copy[float-True]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_0d_object_array_with_list", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat", "xarray/tests/test_variable.py::TestVariable::test_transpose_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_variable.py::TestVariable::test_copy[float-False]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_0d_array", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_utils.py::test_repr_object_magic_methods", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_coordinate_alias", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_variable.py::TestVariable::test_data_and_values", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_variable.py::TestVariable::test_concat_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_variable.py::TestVariable::test_getitem_fancy", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_variable.py::TestVariable::test_index_0d_numpy_string", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_variable.py::TestVariable::test_getitem_basic", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_variable.py::TestAsCompatibleData::test_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_datetime64_conversion", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_variable.py::TestVariable::test_shift[2.0]", "xarray/tests/test_variable.py::TestVariable::test_reduce_keepdims", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_variable.py::TestIndexVariable::test_concat_multiindex", "xarray/tests/test_utils.py::test_hidden_key_dict", "xarray/tests/test_variable.py::TestIndexVariable::test_encoding_preserved", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_variable.py::TestIndexVariable::test_getitem_1d", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_center", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]" ]
[ "xarray/tests/test_utils.py::test_infix_dims[supplied1-all_1-expected1]", "xarray/tests/test_utils.py::test_infix_dims_errors[supplied0-all_0]", "xarray/tests/test_utils.py::test_infix_dims[supplied2-all_2-expected2]", "xarray/tests/test_utils.py::test_infix_dims[supplied4-all_4-expected4]", "xarray/tests/test_utils.py::test_infix_dims[supplied3-all_3-expected3]", "xarray/tests/test_utils.py::test_infix_dims[supplied0-all_0-expected0]", "xarray/tests/test_utils.py::test_infix_dims_errors[supplied1-all_1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_ellipsis_transpose_different_ordered_vars", "xarray/tests/test_utils.py::test_infix_dims[supplied5-all_5-expected5]", "xarray/tests/test_variable.py::TestVariable::test_transpose", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "function", "name": "infix_dims" }, { "type": "field", "name": "infix_dims" }, { "type": "field", "name": "infix_dims" } ] }
[ { "path": "doc/reshaping.rst", "old_path": "a/doc/reshaping.rst", "new_path": "b/doc/reshaping.rst", "metadata": "diff --git a/doc/reshaping.rst b/doc/reshaping.rst\nindex 51202f9be41..455a24f9216 100644\n--- a/doc/reshaping.rst\n+++ b/doc/reshaping.rst\n@@ -18,12 +18,14 @@ Reordering dimensions\n ---------------------\n \n To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables\n-on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`:\n+on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An \n+ellipsis (`...`) can be use to represent all other dimensions:\n \n .. ipython:: python\n \n ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])})\n ds.transpose('y', 'z', 'x')\n+ ds.transpose(..., 'x') # equivalent\n ds.transpose() # reverses all dimensions\n \n Expand and squeeze dimensions\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex dea110b5e46..cced7276ff3 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -25,6 +25,10 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n+ to represent all 'other' dimensions. For example, to move one dimension to the front,\n+ use `.transpose('x', ...)`. (:pull:`<PRID>`)\n+ By `<NAME>`_\n - Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use\n `...` directly. As before, you can use this to instruct a `groupby` operation\n to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n" } ]
diff --git a/doc/reshaping.rst b/doc/reshaping.rst index 51202f9be41..455a24f9216 100644 --- a/doc/reshaping.rst +++ b/doc/reshaping.rst @@ -18,12 +18,14 @@ Reordering dimensions --------------------- To reorder dimensions on a :py:class:`~xarray.DataArray` or across all variables -on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`: +on a :py:class:`~xarray.Dataset`, use :py:meth:`~xarray.DataArray.transpose`. An +ellipsis (`...`) can be use to represent all other dimensions: .. ipython:: python ds = xr.Dataset({'foo': (('x', 'y', 'z'), [[[42]]]), 'bar': (('y', 'z'), [[24]])}) ds.transpose('y', 'z', 'x') + ds.transpose(..., 'x') # equivalent ds.transpose() # reverses all dimensions Expand and squeeze dimensions diff --git a/doc/whats-new.rst b/doc/whats-new.rst index dea110b5e46..cced7276ff3 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -25,6 +25,10 @@ Breaking changes New Features ~~~~~~~~~~~~ +- :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) + to represent all 'other' dimensions. For example, to move one dimension to the front, + use `.transpose('x', ...)`. (:pull:`<PRID>`) + By `<NAME>`_ - Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use `...` directly. As before, you can use this to instruct a `groupby` operation to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'function', 'name': 'infix_dims'}, {'type': 'field', 'name': 'infix_dims'}, {'type': 'field', 'name': 'infix_dims'}]
pydata/xarray
pydata__xarray-3418
https://github.com/pydata/xarray/pull/3418
diff --git a/doc/examples/multidimensional-coords.rst b/doc/examples/multidimensional-coords.rst index a5084043977..55569b7662a 100644 --- a/doc/examples/multidimensional-coords.rst +++ b/doc/examples/multidimensional-coords.rst @@ -107,7 +107,7 @@ function to specify the output coordinates of the group. lat_center = np.arange(1, 90, 2) # group according to those bins and take the mean Tair_lat_mean = (ds.Tair.groupby_bins('xc', lat_bins, labels=lat_center) - .mean(xr.ALL_DIMS)) + .mean(...)) # plot the result @savefig xarray_multidimensional_coords_14_1.png width=5in Tair_lat_mean.plot(); diff --git a/doc/groupby.rst b/doc/groupby.rst index e1d88e289d2..52a27f4f160 100644 --- a/doc/groupby.rst +++ b/doc/groupby.rst @@ -116,7 +116,13 @@ dimensions *other than* the provided one: .. ipython:: python - ds.groupby('x').std(xr.ALL_DIMS) + ds.groupby('x').std(...) + +.. note:: + + We use an ellipsis (`...`) here to indicate we want to reduce over all + other dimensions + First and last ~~~~~~~~~~~~~~ @@ -127,7 +133,7 @@ values for group along the grouped dimension: .. ipython:: python - ds.groupby('letters').first(xr.ALL_DIMS) + ds.groupby('letters').first(...) By default, they skip missing values (control this with ``skipna``). @@ -142,7 +148,7 @@ coordinates. For example: .. ipython:: python - alt = arr.groupby('letters').mean(xr.ALL_DIMS) + alt = arr.groupby('letters').mean(...) alt ds.groupby('letters') - alt @@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen 'lat': (['ny','nx'], [[10,10],[20,20]] ),}, dims=['ny','nx']) da - da.groupby('lon').sum(xr.ALL_DIMS) + da.groupby('lon').sum(...) da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False) Because multidimensional groups have the ability to generate a very large @@ -213,4 +219,4 @@ applying your function, and then unstacking the result: .. ipython:: python stacked = da.stack(gridcell=['ny', 'nx']) - stacked.groupby('gridcell').sum(xr.ALL_DIMS).unstack('gridcell') + stacked.groupby('gridcell').sum(...).unstack('gridcell') diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 9d3e64badb8..c912fd9e1de 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -25,6 +25,11 @@ Breaking changes New Features ~~~~~~~~~~~~ +- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use + `...` directly. As before, you can use this to instruct a `groupby` operation + to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest + using `...`. + By `Maximilian Roos <https://github.com/max-sixty>`_ - Added integration tests against `pint <https://pint.readthedocs.io/>`_. (:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_. diff --git a/xarray/core/common.py b/xarray/core/common.py index 45d860a1797..53aecb47601 100644 --- a/xarray/core/common.py +++ b/xarray/core/common.py @@ -24,10 +24,10 @@ from .options import _get_keep_attrs from .pycompat import dask_array_type from .rolling_exp import RollingExp -from .utils import Frozen, ReprObject, either_dict_or_kwargs +from .utils import Frozen, either_dict_or_kwargs # Used as a sentinel value to indicate a all dimensions -ALL_DIMS = ReprObject("<all-dims>") +ALL_DIMS = ... C = TypeVar("C") diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 12d5cbdc9f3..35a8771a28a 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -47,7 +47,6 @@ ) from .alignment import _broadcast_helper, _get_broadcast_dims_map_common_coords, align from .common import ( - ALL_DIMS, DataWithCoords, ImplementsDatasetReduce, _contains_datetime_like_objects, @@ -4030,7 +4029,7 @@ def reduce( Dataset with this object's DataArrays replaced with new DataArrays of summarized data and the indicated dimension(s) removed. """ - if dim is None or dim is ALL_DIMS: + if dim is None or dim is ...: dims = set(self.dims) elif isinstance(dim, str) or not isinstance(dim, Iterable): dims = {dim} @@ -4995,7 +4994,7 @@ def quantile( if isinstance(dim, str): dims = {dim} - elif dim is None or dim is ALL_DIMS: + elif dim in [None, ...]: dims = set(self.dims) else: dims = set(dim) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index 52eb17df18d..68bd28ddb12 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -7,7 +7,7 @@ from . import dtypes, duck_array_ops, nputils, ops from .arithmetic import SupportsArithmetic -from .common import ALL_DIMS, ImplementsArrayReduce, ImplementsDatasetReduce +from .common import ImplementsArrayReduce, ImplementsDatasetReduce from .concat import concat from .formatting import format_array_flat from .options import _get_keep_attrs @@ -712,7 +712,7 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): q : float in range of [0,1] (or sequence of floats) Quantile to compute, which must be between 0 and 1 inclusive. - dim : xarray.ALL_DIMS, str or sequence of str, optional + dim : `...`, str or sequence of str, optional Dimension(s) over which to apply quantile. Defaults to the grouped dimension. interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} @@ -769,7 +769,7 @@ def reduce( Function which can be called in the form `func(x, axis=axis, **kwargs)` to return the result of collapsing an np.ndarray over an integer valued axis. - dim : xarray.ALL_DIMS, str or sequence of str, optional + dim : `...`, str or sequence of str, optional Dimension(s) over which to apply `func`. axis : int or sequence of int, optional Axis(es) over which to apply `func`. Only one of the 'dimension' @@ -794,9 +794,9 @@ def reduce( if keep_attrs is None: keep_attrs = _get_keep_attrs(default=False) - if dim is not ALL_DIMS and dim not in self.dims: + if dim is not ... and dim not in self.dims: raise ValueError( - "cannot reduce over dimension %r. expected either xarray.ALL_DIMS to reduce over all dimensions or one or more of %r." + "cannot reduce over dimension %r. expected either '...' to reduce over all dimensions or one or more of %r." % (dim, self.dims) ) @@ -867,7 +867,7 @@ def reduce(self, func, dim=None, keep_attrs=None, **kwargs): Function which can be called in the form `func(x, axis=axis, **kwargs)` to return the result of collapsing an np.ndarray over an integer valued axis. - dim : xarray.ALL_DIMS, str or sequence of str, optional + dim : `...`, str or sequence of str, optional Dimension(s) over which to apply `func`. axis : int or sequence of int, optional Axis(es) over which to apply `func`. Only one of the 'dimension' @@ -895,9 +895,9 @@ def reduce(self, func, dim=None, keep_attrs=None, **kwargs): def reduce_dataset(ds): return ds.reduce(func, dim, keep_attrs, **kwargs) - if dim is not ALL_DIMS and dim not in self.dims: + if dim is not ... and dim not in self.dims: raise ValueError( - "cannot reduce over dimension %r. expected either xarray.ALL_DIMS to reduce over all dimensions or one or more of %r." + "cannot reduce over dimension %r. expected either '...' to reduce over all dimensions or one or more of %r." % (dim, self.dims) ) diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 37672cd82d9..93ad1eafb97 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -1450,7 +1450,7 @@ def reduce( Array with summarized data and the indicated dimension(s) removed. """ - if dim is common.ALL_DIMS: + if dim == ...: dim = None if dim is not None and axis is not None: raise ValueError("cannot supply both 'axis' and 'dim' arguments")
diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index ae8f43cb66d..50517ae3c9c 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -435,8 +435,8 @@ def test_groupby(self): u = self.eager_array v = self.lazy_array - expected = u.groupby("x").mean(xr.ALL_DIMS) - actual = v.groupby("x").mean(xr.ALL_DIMS) + expected = u.groupby("x").mean(...) + actual = v.groupby("x").mean(...) self.assertLazyAndAllClose(expected, actual) def test_groupby_first(self): diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index a3a2f55f6cc..b13527bc098 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -13,7 +13,7 @@ from xarray.coding.times import CFDatetimeCoder from xarray.convert import from_cdms2 from xarray.core import dtypes -from xarray.core.common import ALL_DIMS, full_like +from xarray.core.common import full_like from xarray.tests import ( LooseVersion, ReturnItem, @@ -2443,8 +2443,8 @@ def test_groupby_sum(self): "abc": Variable(["abc"], np.array(["a", "b", "c"])), } )["foo"] - assert_allclose(expected_sum_all, grouped.reduce(np.sum, dim=ALL_DIMS)) - assert_allclose(expected_sum_all, grouped.sum(ALL_DIMS)) + assert_allclose(expected_sum_all, grouped.reduce(np.sum, dim=...)) + assert_allclose(expected_sum_all, grouped.sum(...)) expected = DataArray( [ @@ -2456,7 +2456,7 @@ def test_groupby_sum(self): ) actual = array["y"].groupby("abc").apply(np.sum) assert_allclose(expected, actual) - actual = array["y"].groupby("abc").sum(ALL_DIMS) + actual = array["y"].groupby("abc").sum(...) assert_allclose(expected, actual) expected_sum_axis1 = Dataset( @@ -2590,9 +2590,9 @@ def test_groupby_math(self): assert_identical(expected, actual) grouped = array.groupby("abc") - expected_agg = (grouped.mean(ALL_DIMS) - np.arange(3)).rename(None) + expected_agg = (grouped.mean(...) - np.arange(3)).rename(None) actual = grouped - DataArray(range(3), [("abc", ["a", "b", "c"])]) - actual_agg = actual.groupby("abc").mean(ALL_DIMS) + actual_agg = actual.groupby("abc").mean(...) assert_allclose(expected_agg, actual_agg) with raises_regex(TypeError, "only support binary ops"): @@ -2698,7 +2698,7 @@ def test_groupby_multidim(self): ("lon", DataArray([5, 28, 23], coords=[("lon", [30.0, 40.0, 50.0])])), ("lat", DataArray([16, 40], coords=[("lat", [10.0, 20.0])])), ]: - actual_sum = array.groupby(dim).sum(ALL_DIMS) + actual_sum = array.groupby(dim).sum(...) assert_identical(expected_sum, actual_sum) def test_groupby_multidim_apply(self): diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 006d6881b5a..b3ffdf68e3f 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -11,7 +11,6 @@ import xarray as xr from xarray import ( - ALL_DIMS, DataArray, Dataset, IndexVariable, @@ -3327,7 +3326,7 @@ def test_groupby_reduce(self): expected = data.mean("y") expected["yonly"] = expected["yonly"].variable.set_dims({"x": 3}) - actual = data.groupby("x").mean(ALL_DIMS) + actual = data.groupby("x").mean(...) assert_allclose(expected, actual) actual = data.groupby("x").mean("y") @@ -3336,12 +3335,12 @@ def test_groupby_reduce(self): letters = data["letters"] expected = Dataset( { - "xy": data["xy"].groupby(letters).mean(ALL_DIMS), + "xy": data["xy"].groupby(letters).mean(...), "xonly": (data["xonly"].mean().variable.set_dims({"letters": 2})), "yonly": data["yonly"].groupby(letters).mean(), } ) - actual = data.groupby("letters").mean(ALL_DIMS) + actual = data.groupby("letters").mean(...) assert_allclose(expected, actual) def test_groupby_math(self): @@ -3404,14 +3403,14 @@ def test_groupby_math_virtual(self): {"x": ("t", [1, 2, 3])}, {"t": pd.date_range("20100101", periods=3)} ) grouped = ds.groupby("t.day") - actual = grouped - grouped.mean(ALL_DIMS) + actual = grouped - grouped.mean(...) expected = Dataset({"x": ("t", [0, 0, 0])}, ds[["t", "t.day"]]) assert_identical(actual, expected) def test_groupby_nan(self): # nan should be excluded from groupby ds = Dataset({"foo": ("x", [1, 2, 3, 4])}, {"bar": ("x", [1, 1, 2, np.nan])}) - actual = ds.groupby("bar").mean(ALL_DIMS) + actual = ds.groupby("bar").mean(...) expected = Dataset({"foo": ("bar", [1.5, 3]), "bar": [1, 2]}) assert_identical(actual, expected) @@ -3421,7 +3420,7 @@ def test_groupby_order(self): for vn in ["a", "b", "c"]: ds[vn] = DataArray(np.arange(10), dims=["t"]) data_vars_ref = list(ds.data_vars.keys()) - ds = ds.groupby("t").mean(ALL_DIMS) + ds = ds.groupby("t").mean(...) data_vars = list(ds.data_vars.keys()) assert data_vars == data_vars_ref # coords are now at the end of the list, so the test below fails diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py index be494c4ae2b..a6de41beb66 100644 --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -147,11 +147,11 @@ def test_da_groupby_quantile(): [("x", [1, 1, 1, 2, 2]), ("y", [0, 0, 1])], ) - actual_x = array.groupby("x").quantile(0, dim=xr.ALL_DIMS) + actual_x = array.groupby("x").quantile(0, dim=...) expected_x = xr.DataArray([1, 4], [("x", [1, 2])]) assert_identical(expected_x, actual_x) - actual_y = array.groupby("y").quantile(0, dim=xr.ALL_DIMS) + actual_y = array.groupby("y").quantile(0, dim=...) expected_y = xr.DataArray([1, 22], [("y", [0, 1])]) assert_identical(expected_y, actual_y) @@ -177,7 +177,7 @@ def test_da_groupby_quantile(): ) g = foo.groupby(foo.time.dt.month) - actual = g.quantile(0, dim=xr.ALL_DIMS) + actual = g.quantile(0, dim=...) expected = xr.DataArray( [ 0.0, diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index 3ac45a9720f..7deabd46eae 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -417,7 +417,7 @@ def test_convenient_facetgrid_4d(self): def test_coord_with_interval(self): bins = [-1, 0, 1, 2] - self.darray.groupby_bins("dim_0", bins).mean(xr.ALL_DIMS).plot() + self.darray.groupby_bins("dim_0", bins).mean(...).plot() class TestPlot1D(PlotTestCase): @@ -502,7 +502,7 @@ def test_step(self): def test_coord_with_interval_step(self): bins = [-1, 0, 1, 2] - self.darray.groupby_bins("dim_0", bins).mean(xr.ALL_DIMS).plot.step() + self.darray.groupby_bins("dim_0", bins).mean(...).plot.step() assert len(plt.gca().lines[0].get_xdata()) == ((len(bins) - 1) * 2) @@ -544,7 +544,7 @@ def test_plot_nans(self): def test_hist_coord_with_interval(self): ( self.darray.groupby_bins("dim_0", [-1, 0, 1, 2]) - .mean(xr.ALL_DIMS) + .mean(...) .plot.hist(range=(-1, 2)) ) diff --git a/xarray/tests/test_sparse.py b/xarray/tests/test_sparse.py index bd26b96f6d4..73c4b9b8c74 100644 --- a/xarray/tests/test_sparse.py +++ b/xarray/tests/test_sparse.py @@ -756,8 +756,8 @@ def test_dot(self): def test_groupby(self): x1 = self.ds_xr x2 = self.sp_xr - m1 = x1.groupby("x").mean(xr.ALL_DIMS) - m2 = x2.groupby("x").mean(xr.ALL_DIMS) + m1 = x1.groupby("x").mean(...) + m2 = x2.groupby("x").mean(...) assert isinstance(m2.data, sparse.SparseArray) assert np.allclose(m1.data, m2.data.todense()) @@ -772,8 +772,8 @@ def test_groupby_first(self): def test_groupby_bins(self): x1 = self.ds_xr x2 = self.sp_xr - m1 = x1.groupby_bins("x", bins=[0, 3, 7, 10]).sum(xr.ALL_DIMS) - m2 = x2.groupby_bins("x", bins=[0, 3, 7, 10]).sum(xr.ALL_DIMS) + m1 = x1.groupby_bins("x", bins=[0, 3, 7, 10]).sum(...) + m2 = x2.groupby_bins("x", bins=[0, 3, 7, 10]).sum(...) assert isinstance(m2.data, sparse.SparseArray) assert np.allclose(m1.data, m2.data.todense())
[ { "path": "doc/examples/multidimensional-coords.rst", "old_path": "a/doc/examples/multidimensional-coords.rst", "new_path": "b/doc/examples/multidimensional-coords.rst", "metadata": "diff --git a/doc/examples/multidimensional-coords.rst b/doc/examples/multidimensional-coords.rst\nindex a5084043977..55569b7662a 100644\n--- a/doc/examples/multidimensional-coords.rst\n+++ b/doc/examples/multidimensional-coords.rst\n@@ -107,7 +107,7 @@ function to specify the output coordinates of the group.\n lat_center = np.arange(1, 90, 2)\n # group according to those bins and take the mean\n Tair_lat_mean = (ds.Tair.groupby_bins('xc', lat_bins, labels=lat_center)\n-\t .mean(xr.ALL_DIMS))\n+\t .mean(...))\n # plot the result\n @savefig xarray_multidimensional_coords_14_1.png width=5in\n Tair_lat_mean.plot();\n" }, { "path": "doc/groupby.rst", "old_path": "a/doc/groupby.rst", "new_path": "b/doc/groupby.rst", "metadata": "diff --git a/doc/groupby.rst b/doc/groupby.rst\nindex e1d88e289d2..52a27f4f160 100644\n--- a/doc/groupby.rst\n+++ b/doc/groupby.rst\n@@ -116,7 +116,13 @@ dimensions *other than* the provided one:\n \n .. ipython:: python\n \n- ds.groupby('x').std(xr.ALL_DIMS)\n+ ds.groupby('x').std(...)\n+\n+.. note::\n+\n+ We use an ellipsis (`...`) here to indicate we want to reduce over all\n+ other dimensions \n+\n \n First and last\n ~~~~~~~~~~~~~~\n@@ -127,7 +133,7 @@ values for group along the grouped dimension:\n \n .. ipython:: python\n \n- ds.groupby('letters').first(xr.ALL_DIMS)\n+ ds.groupby('letters').first(...)\n \n By default, they skip missing values (control this with ``skipna``).\n \n@@ -142,7 +148,7 @@ coordinates. For example:\n \n .. ipython:: python\n \n- alt = arr.groupby('letters').mean(xr.ALL_DIMS)\n+ alt = arr.groupby('letters').mean(...)\n alt\n ds.groupby('letters') - alt\n \n@@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen\n 'lat': (['ny','nx'], [[10,10],[20,20]] ),},\n dims=['ny','nx'])\n da\n- da.groupby('lon').sum(xr.ALL_DIMS)\n+ da.groupby('lon').sum(...)\n da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False)\n \n Because multidimensional groups have the ability to generate a very large\n@@ -213,4 +219,4 @@ applying your function, and then unstacking the result:\n .. ipython:: python\n \n stacked = da.stack(gridcell=['ny', 'nx'])\n- stacked.groupby('gridcell').sum(xr.ALL_DIMS).unstack('gridcell')\n+ stacked.groupby('gridcell').sum(...).unstack('gridcell')\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 9d3e64badb8..c912fd9e1de 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -25,6 +25,11 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use\n+ `...` directly. As before, you can use this to instruct a `groupby` operation\n+ to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n+ using `...`.\n+ By `Maximilian Roos <https://github.com/max-sixty>`_\n - Added integration tests against `pint <https://pint.readthedocs.io/>`_.\n (:pull:`3238`) by `Justus Magin <https://github.com/keewis>`_.\n \n" } ]
0014
652dd3ca77dd19bbd1ab21fe556340c1904ec382
[ "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::TestDataset::test_quantile", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_groupby.py::test_da_groupby_empty", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-y]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-month]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-x]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_reduce_dimension_error", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_groupby.py::test_groupby_duplicate_coordinate_labels", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_groupby.py::test_groupby_bins_timeseries", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_changes_metadata", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_center", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_groupby.py::test_multi_index_groupby_apply", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_apply", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_groupby.py::test_da_groupby_apply_func_args", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_groupby.py::test_groupby_dims_property", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_groupby.py::test_groupby_input_mutation", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_groupby.py::test_da_groupby_assign_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_groupby.py::test_groupby_grouping_errors", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-month]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-x]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-z]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_identity", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-y]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_ndarray", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_groupby.py::test_groupby_repr_datetime[obj1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_groupby.py::test_groupby_repr[obj0-z]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_groupby.py::test_ds_groupby_apply_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::TestDataset::test_apply", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]" ]
[ "xarray/tests/test_groupby.py::test_da_groupby_quantile", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/examples/multidimensional-coords.rst", "old_path": "a/doc/examples/multidimensional-coords.rst", "new_path": "b/doc/examples/multidimensional-coords.rst", "metadata": "diff --git a/doc/examples/multidimensional-coords.rst b/doc/examples/multidimensional-coords.rst\nindex a5084043977..55569b7662a 100644\n--- a/doc/examples/multidimensional-coords.rst\n+++ b/doc/examples/multidimensional-coords.rst\n@@ -107,7 +107,7 @@ function to specify the output coordinates of the group.\n lat_center = np.arange(1, 90, 2)\n # group according to those bins and take the mean\n Tair_lat_mean = (ds.Tair.groupby_bins('xc', lat_bins, labels=lat_center)\n-\t .mean(xr.ALL_DIMS))\n+\t .mean(...))\n # plot the result\n @savefig xarray_multidimensional_coords_14_1.png width=5in\n Tair_lat_mean.plot();\n" }, { "path": "doc/groupby.rst", "old_path": "a/doc/groupby.rst", "new_path": "b/doc/groupby.rst", "metadata": "diff --git a/doc/groupby.rst b/doc/groupby.rst\nindex e1d88e289d2..52a27f4f160 100644\n--- a/doc/groupby.rst\n+++ b/doc/groupby.rst\n@@ -116,7 +116,13 @@ dimensions *other than* the provided one:\n \n .. ipython:: python\n \n- ds.groupby('x').std(xr.ALL_DIMS)\n+ ds.groupby('x').std(...)\n+\n+.. note::\n+\n+ We use an ellipsis (`...`) here to indicate we want to reduce over all\n+ other dimensions \n+\n \n First and last\n ~~~~~~~~~~~~~~\n@@ -127,7 +133,7 @@ values for group along the grouped dimension:\n \n .. ipython:: python\n \n- ds.groupby('letters').first(xr.ALL_DIMS)\n+ ds.groupby('letters').first(...)\n \n By default, they skip missing values (control this with ``skipna``).\n \n@@ -142,7 +148,7 @@ coordinates. For example:\n \n .. ipython:: python\n \n- alt = arr.groupby('letters').mean(xr.ALL_DIMS)\n+ alt = arr.groupby('letters').mean(...)\n alt\n ds.groupby('letters') - alt\n \n@@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen\n 'lat': (['ny','nx'], [[10,10],[20,20]] ),},\n dims=['ny','nx'])\n da\n- da.groupby('lon').sum(xr.ALL_DIMS)\n+ da.groupby('lon').sum(...)\n da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False)\n \n Because multidimensional groups have the ability to generate a very large\n@@ -213,4 +219,4 @@ applying your function, and then unstacking the result:\n .. ipython:: python\n \n stacked = da.stack(gridcell=['ny', 'nx'])\n- stacked.groupby('gridcell').sum(xr.ALL_DIMS).unstack('gridcell')\n+ stacked.groupby('gridcell').sum(...).unstack('gridcell')\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 9d3e64badb8..c912fd9e1de 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -25,6 +25,11 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use\n+ `...` directly. As before, you can use this to instruct a `groupby` operation\n+ to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest\n+ using `...`.\n+ By `<NAME>`_\n - Added integration tests against `pint <https://pint.readthedocs.io/>`_.\n (:pull:`<PRID>`) by `<NAME>`_.\n \n" } ]
diff --git a/doc/examples/multidimensional-coords.rst b/doc/examples/multidimensional-coords.rst index a5084043977..55569b7662a 100644 --- a/doc/examples/multidimensional-coords.rst +++ b/doc/examples/multidimensional-coords.rst @@ -107,7 +107,7 @@ function to specify the output coordinates of the group. lat_center = np.arange(1, 90, 2) # group according to those bins and take the mean Tair_lat_mean = (ds.Tair.groupby_bins('xc', lat_bins, labels=lat_center) - .mean(xr.ALL_DIMS)) + .mean(...)) # plot the result @savefig xarray_multidimensional_coords_14_1.png width=5in Tair_lat_mean.plot(); diff --git a/doc/groupby.rst b/doc/groupby.rst index e1d88e289d2..52a27f4f160 100644 --- a/doc/groupby.rst +++ b/doc/groupby.rst @@ -116,7 +116,13 @@ dimensions *other than* the provided one: .. ipython:: python - ds.groupby('x').std(xr.ALL_DIMS) + ds.groupby('x').std(...) + +.. note:: + + We use an ellipsis (`...`) here to indicate we want to reduce over all + other dimensions + First and last ~~~~~~~~~~~~~~ @@ -127,7 +133,7 @@ values for group along the grouped dimension: .. ipython:: python - ds.groupby('letters').first(xr.ALL_DIMS) + ds.groupby('letters').first(...) By default, they skip missing values (control this with ``skipna``). @@ -142,7 +148,7 @@ coordinates. For example: .. ipython:: python - alt = arr.groupby('letters').mean(xr.ALL_DIMS) + alt = arr.groupby('letters').mean(...) alt ds.groupby('letters') - alt @@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen 'lat': (['ny','nx'], [[10,10],[20,20]] ),}, dims=['ny','nx']) da - da.groupby('lon').sum(xr.ALL_DIMS) + da.groupby('lon').sum(...) da.groupby('lon').apply(lambda x: x - x.mean(), shortcut=False) Because multidimensional groups have the ability to generate a very large @@ -213,4 +219,4 @@ applying your function, and then unstacking the result: .. ipython:: python stacked = da.stack(gridcell=['ny', 'nx']) - stacked.groupby('gridcell').sum(xr.ALL_DIMS).unstack('gridcell') + stacked.groupby('gridcell').sum(...).unstack('gridcell') diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 9d3e64badb8..c912fd9e1de 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -25,6 +25,11 @@ Breaking changes New Features ~~~~~~~~~~~~ +- Changed `xr.ALL_DIMS` to equal python's `Ellipsis` (`...`), and changed internal usages to use + `...` directly. As before, you can use this to instruct a `groupby` operation + to reduce over all dimensions. While we have no plans to remove `xr.ALL_DIMS`, we suggest + using `...`. + By `<NAME>`_ - Added integration tests against `pint <https://pint.readthedocs.io/>`_. (:pull:`<PRID>`) by `<NAME>`_.
pydata/xarray
pydata__xarray-3475
https://github.com/pydata/xarray/pull/3475
diff --git a/doc/data-structures.rst b/doc/data-structures.rst index d5567f4863e..93cdc7e9765 100644 --- a/doc/data-structures.rst +++ b/doc/data-structures.rst @@ -393,14 +393,14 @@ methods (like pandas) for transforming datasets into new objects. For removing variables, you can select and drop an explicit list of variables by indexing with a list of names or using the -:py:meth:`~xarray.Dataset.drop` methods to return a new ``Dataset``. These +:py:meth:`~xarray.Dataset.drop_vars` methods to return a new ``Dataset``. These operations keep around coordinates: .. ipython:: python ds[['temperature']] ds[['temperature', 'temperature_double']] - ds.drop('temperature') + ds.drop_vars('temperature') To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method. Any variables using that dimension are dropped: diff --git a/doc/indexing.rst b/doc/indexing.rst index 9ee8f1dddf8..ace960689a8 100644 --- a/doc/indexing.rst +++ b/doc/indexing.rst @@ -232,14 +232,14 @@ Using indexing to *assign* values to a subset of dataset (e.g., Dropping labels and dimensions ------------------------------ -The :py:meth:`~xarray.Dataset.drop` method returns a new object with the listed +The :py:meth:`~xarray.Dataset.drop_sel` method returns a new object with the listed index labels along a dimension dropped: .. ipython:: python - ds.drop(space=['IN', 'IL']) + ds.drop_sel(space=['IN', 'IL']) -``drop`` is both a ``Dataset`` and ``DataArray`` method. +``drop_sel`` is both a ``Dataset`` and ``DataArray`` method. Use :py:meth:`~xarray.Dataset.drop_dims` to drop a full dimension from a Dataset. Any variables with these dimensions are also dropped: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index dcaab011e67..0906058469d 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -38,6 +38,12 @@ Breaking changes New Features ~~~~~~~~~~~~ +- :py:meth:`Dataset.drop_sel` & :py:meth:`DataArray.drop_sel` have been added for dropping labels. + :py:meth:`Dataset.drop_vars` & :py:meth:`DataArray.drop_vars` have been added for + dropping variables (including coordinates). The existing ``drop`` methods remain as a backward compatible + option for dropping either lables or variables, but using the more specific methods is encouraged. + (:pull:`3475`) + By `Maximilian Roos <https://github.com/max-sixty>`_ - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) to represent all 'other' dimensions. For example, to move one dimension to the front, use `.transpose('x', ...)`. (:pull:`3421`) @@ -3752,6 +3758,7 @@ Enhancements explicitly listed variables or index labels: .. ipython:: python + :okwarning: # drop variables ds = xray.Dataset({'x': 0, 'y': 1}) diff --git a/xarray/core/concat.py b/xarray/core/concat.py index c26153eb0d8..5b4fc078236 100644 --- a/xarray/core/concat.py +++ b/xarray/core/concat.py @@ -388,7 +388,7 @@ def ensure_common_dims(vars): result = result.set_coords(coord_names) result.encoding = result_encoding - result = result.drop(unlabeled_dims, errors="ignore") + result = result.drop_vars(unlabeled_dims, errors="ignore") if coord is not None: # add concat dimension last to ensure that its in the final Dataset diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 35ee90fb5c8..d2d37871ee9 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -16,7 +16,6 @@ TypeVar, Union, cast, - overload, ) import numpy as np @@ -53,7 +52,7 @@ from .formatting import format_item from .indexes import Indexes, default_indexes from .options import OPTIONS -from .utils import Default, ReprObject, _default, _check_inplace, either_dict_or_kwargs +from .utils import Default, ReprObject, _check_inplace, _default, either_dict_or_kwargs from .variable import ( IndexVariable, Variable, @@ -249,7 +248,7 @@ class DataArray(AbstractArray, DataWithCoords): Dictionary for holding arbitrary metadata. """ - _accessors: Optional[Dict[str, Any]] + _accessors: Optional[Dict[str, Any]] # noqa _coords: Dict[Any, Variable] _indexes: Optional[Dict[Hashable, pd.Index]] _name: Optional[Hashable] @@ -1890,41 +1889,72 @@ def transpose(self, *dims: Hashable, transpose_coords: bool = None) -> "DataArra def T(self) -> "DataArray": return self.transpose() - # Drop coords - @overload - def drop( - self, labels: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise" + def drop_vars( + self, names: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise" ) -> "DataArray": - ... + """Drop variables from this DataArray. + + Parameters + ---------- + names : hashable or iterable of hashables + Name(s) of variables to drop. + errors: {'raise', 'ignore'}, optional + If 'raise' (default), raises a ValueError error if any of the variable + passed are not in the dataset. If 'ignore', any given names that are in the + DataArray are dropped and no error is raised. + + Returns + ------- + dropped : Dataset + + """ + ds = self._to_temp_dataset().drop_vars(names, errors=errors) + return self._from_temp_dataset(ds) - # Drop index labels along dimension - @overload # noqa: F811 def drop( - self, labels: Any, dim: Hashable, *, errors: str = "raise" # array-like + self, + labels: Mapping = None, + dim: Hashable = None, + *, + errors: str = "raise", + **labels_kwargs, ) -> "DataArray": - ... + """Backward compatible method based on `drop_vars` and `drop_sel` - def drop(self, labels, dim=None, *, errors="raise"): # noqa: F811 - """Drop coordinates or index labels from this DataArray. + Using either `drop_vars` or `drop_sel` is encouraged + """ + ds = self._to_temp_dataset().drop(labels, dim, errors=errors) + return self._from_temp_dataset(ds) + + def drop_sel( + self, + labels: Mapping[Hashable, Any] = None, + *, + errors: str = "raise", + **labels_kwargs, + ) -> "DataArray": + """Drop index labels from this DataArray. Parameters ---------- - labels : hashable or sequence of hashables - Name(s) of coordinates or index labels to drop. - If dim is not None, labels can be any array-like. - dim : hashable, optional - Dimension along which to drop index labels. By default (if - ``dim is None``), drops coordinates rather than index labels. + labels : Mapping[Hashable, Any] + Index labels to drop errors: {'raise', 'ignore'}, optional If 'raise' (default), raises a ValueError error if - any of the coordinates or index labels passed are not - in the array. If 'ignore', any given labels that are in the - array are dropped and no error is raised. + any of the index labels passed are not + in the dataset. If 'ignore', any given labels that are in the + dataset are dropped and no error is raised. + **labels_kwargs : {dim: label, ...}, optional + The keyword arguments form of ``dim`` and ``labels`` + Returns ------- dropped : DataArray """ - ds = self._to_temp_dataset().drop(labels, dim, errors=errors) + if labels_kwargs or isinstance(labels, dict): + labels = either_dict_or_kwargs(labels, labels_kwargs, "drop") + + ds = self._to_temp_dataset().drop_sel(labels, errors=errors) return self._from_temp_dataset(ds) def dropna( diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 978242e5f6b..2cadc90334c 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -25,7 +25,6 @@ TypeVar, Union, cast, - overload, ) import numpy as np @@ -80,6 +79,7 @@ hashable, is_dict_like, is_list_like, + is_scalar, maybe_wrap_array, ) from .variable import IndexVariable, Variable, as_variable, broadcast_variables @@ -3519,39 +3519,98 @@ def _assert_all_in_dataset( "cannot be found in this dataset" ) - # Drop variables - @overload # noqa: F811 - def drop( - self, labels: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise" + def drop_vars( + self, names: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise" ) -> "Dataset": - ... + """Drop variables from this dataset. - # Drop index labels along dimension - @overload # noqa: F811 - def drop( - self, labels: Any, dim: Hashable, *, errors: str = "raise" # array-like - ) -> "Dataset": - ... + Parameters + ---------- + names : hashable or iterable of hashables + Name(s) of variables to drop. + errors: {'raise', 'ignore'}, optional + If 'raise' (default), raises a ValueError error if any of the variable + passed are not in the dataset. If 'ignore', any given names that are in the + dataset are dropped and no error is raised. - def drop( # noqa: F811 - self, labels=None, dim=None, *, errors="raise", **labels_kwargs - ): - """Drop variables or index labels from this dataset. + Returns + ------- + dropped : Dataset + + """ + # the Iterable check is required for mypy + if is_scalar(names) or not isinstance(names, Iterable): + names = {names} + else: + names = set(names) + if errors == "raise": + self._assert_all_in_dataset(names) + + variables = {k: v for k, v in self._variables.items() if k not in names} + coord_names = {k for k in self._coord_names if k in variables} + indexes = {k: v for k, v in self.indexes.items() if k not in names} + return self._replace_with_new_dims( + variables, coord_names=coord_names, indexes=indexes + ) + + def drop(self, labels=None, dim=None, *, errors="raise", **labels_kwargs): + """Backward compatible method based on `drop_vars` and `drop_sel` + + Using either `drop_vars` or `drop_sel` is encouraged + """ + if errors not in ["raise", "ignore"]: + raise ValueError('errors must be either "raise" or "ignore"') + + if is_dict_like(labels) and not isinstance(labels, dict): + warnings.warn( + "dropping coordinates using `drop` is be deprecated; use drop_vars.", + FutureWarning, + stacklevel=2, + ) + return self.drop_vars(labels, errors=errors) + + if labels_kwargs or isinstance(labels, dict): + if dim is not None: + raise ValueError("cannot specify dim and dict-like arguments.") + labels = either_dict_or_kwargs(labels, labels_kwargs, "drop") + + if dim is None and (is_list_like(labels) or is_scalar(labels)): + warnings.warn( + "dropping variables using `drop` will be deprecated; using drop_vars is encouraged.", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.drop_vars(labels, errors=errors) + if dim is not None: + warnings.warn( + "dropping labels using list-like labels is deprecated; using " + "dict-like arguments with `drop_sel`, e.g. `ds.drop_sel(dim=[labels]).", + DeprecationWarning, + stacklevel=2, + ) + return self.drop_sel({dim: labels}, errors=errors, **labels_kwargs) + + warnings.warn( + "dropping labels using `drop` will be deprecated; using drop_sel is encouraged.", + PendingDeprecationWarning, + stacklevel=2, + ) + return self.drop_sel(labels, errors=errors) + + def drop_sel(self, labels=None, *, errors="raise", **labels_kwargs): + """Drop index labels from this dataset. Parameters ---------- - labels : hashable or iterable of hashables - Name(s) of variables or index labels to drop. - dim : None or hashable, optional - Dimension along which to drop index labels. By default (if - ``dim is None``), drops variables rather than index labels. + labels : Mapping[Hashable, Any] + Index labels to drop errors: {'raise', 'ignore'}, optional If 'raise' (default), raises a ValueError error if - any of the variable or index labels passed are not + any of the index labels passed are not in the dataset. If 'ignore', any given labels that are in the dataset are dropped and no error is raised. **labels_kwargs : {dim: label, ...}, optional - The keyword arguments form of ``dim`` and ``labels``. + The keyword arguments form of ``dim`` and ``labels` Returns ------- @@ -3562,7 +3621,7 @@ def drop( # noqa: F811 >>> data = np.random.randn(2, 3) >>> labels = ['a', 'b', 'c'] >>> ds = xr.Dataset({'A': (['x', 'y'], data), 'y': labels}) - >>> ds.drop(y=['a', 'c']) + >>> ds.drop_sel(y=['a', 'c']) <xarray.Dataset> Dimensions: (x: 2, y: 1) Coordinates: @@ -3570,7 +3629,7 @@ def drop( # noqa: F811 Dimensions without coordinates: x Data variables: A (x, y) float64 -0.3454 0.1734 - >>> ds.drop(y='b') + >>> ds.drop_sel(y='b') <xarray.Dataset> Dimensions: (x: 2, y: 2) Coordinates: @@ -3582,61 +3641,22 @@ def drop( # noqa: F811 if errors not in ["raise", "ignore"]: raise ValueError('errors must be either "raise" or "ignore"') - if is_dict_like(labels) and not isinstance(labels, dict): - warnings.warn( - "dropping coordinates using key values of dict-like labels is " - "deprecated; use drop_vars or a list of coordinates.", - FutureWarning, - stacklevel=2, - ) - if dim is not None and is_list_like(labels): - warnings.warn( - "dropping dimensions using list-like labels is deprecated; use " - "dict-like arguments.", - DeprecationWarning, - stacklevel=2, - ) + labels = either_dict_or_kwargs(labels, labels_kwargs, "drop") - if labels_kwargs or isinstance(labels, dict): - labels_kwargs = either_dict_or_kwargs(labels, labels_kwargs, "drop") - if dim is not None: - raise ValueError("cannot specify dim and dict-like arguments.") - ds = self - for dim, labels in labels_kwargs.items(): - ds = ds._drop_labels(labels, dim, errors=errors) - return ds - elif dim is None: - if isinstance(labels, str) or not isinstance(labels, Iterable): - labels = {labels} - else: - labels = set(labels) - return self._drop_vars(labels, errors=errors) - else: - return self._drop_labels(labels, dim, errors=errors) - - def _drop_labels(self, labels=None, dim=None, errors="raise"): - # Don't cast to set, as it would harm performance when labels - # is a large numpy array - if utils.is_scalar(labels): - labels = [labels] - labels = np.asarray(labels) - try: - index = self.indexes[dim] - except KeyError: - raise ValueError("dimension %r does not have coordinate labels" % dim) - new_index = index.drop(labels, errors=errors) - return self.loc[{dim: new_index}] - - def _drop_vars(self, names: set, errors: str = "raise") -> "Dataset": - if errors == "raise": - self._assert_all_in_dataset(names) - - variables = {k: v for k, v in self._variables.items() if k not in names} - coord_names = {k for k in self._coord_names if k in variables} - indexes = {k: v for k, v in self.indexes.items() if k not in names} - return self._replace_with_new_dims( - variables, coord_names=coord_names, indexes=indexes - ) + ds = self + for dim, labels_for_dim in labels.items(): + # Don't cast to set, as it would harm performance when labels + # is a large numpy array + if utils.is_scalar(labels_for_dim): + labels_for_dim = [labels_for_dim] + labels_for_dim = np.asarray(labels_for_dim) + try: + index = self.indexes[dim] + except KeyError: + raise ValueError("dimension %r does not have coordinate labels" % dim) + new_index = index.drop(labels_for_dim, errors=errors) + ds = ds.loc[{dim: new_index}] + return ds def drop_dims( self, drop_dims: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise" @@ -3679,7 +3699,7 @@ def drop_dims( ) drop_vars = {k for k, v in self._variables.items() if set(v.dims) & drop_dims} - return self._drop_vars(drop_vars) + return self.drop_vars(drop_vars) def transpose(self, *dims: Hashable) -> "Dataset": """Return a new Dataset object with all array dimensions transposed. diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index 209ac14184b..c8906e34737 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -775,7 +775,7 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): ) if np.asarray(q, dtype=np.float64).ndim == 0: - out = out.drop("quantile") + out = out.drop_vars("quantile") return out def reduce( diff --git a/xarray/core/merge.py b/xarray/core/merge.py index daf0c3b059f..10c7804d718 100644 --- a/xarray/core/merge.py +++ b/xarray/core/merge.py @@ -859,6 +859,6 @@ def dataset_update_method( if c not in value.dims and c in dataset.coords ] if coord_names: - other[key] = value.drop(coord_names) + other[key] = value.drop_vars(coord_names) return merge_core([dataset, other], priority_arg=1, indexes=dataset.indexes) diff --git a/xarray/core/resample.py b/xarray/core/resample.py index 998964273be..2cb1bd55e19 100644 --- a/xarray/core/resample.py +++ b/xarray/core/resample.py @@ -47,7 +47,7 @@ def _upsample(self, method, *args, **kwargs): if k == self._dim: continue if self._dim in v.dims: - self._obj = self._obj.drop(k) + self._obj = self._obj.drop_vars(k) if method == "asfreq": return self.mean(self._dim) @@ -146,7 +146,7 @@ def _interpolate(self, kind="linear"): dummy = self._obj.copy() for k, v in self._obj.coords.items(): if k != self._dim and self._dim in v.dims: - dummy = dummy.drop(k) + dummy = dummy.drop_vars(k) return dummy.interp( assume_sorted=True, method=kind, @@ -218,7 +218,7 @@ def apply(self, func, shortcut=False, args=(), **kwargs): # dimension, then we need to do so before we can rename the proxy # dimension we used. if self._dim in combined.coords: - combined = combined.drop(self._dim) + combined = combined.drop_vars(self._dim) if self._resample_dim in combined.dims: combined = combined.rename({self._resample_dim: self._dim})
diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 9b000b82b03..de3a7eadab0 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -800,7 +800,7 @@ def equals_latlon(obj): assert "coordinates" not in ds["lat"].attrs assert "coordinates" not in ds["lon"].attrs - modified = original.drop(["temp", "precip"]) + modified = original.drop_vars(["temp", "precip"]) with self.roundtrip(modified) as actual: assert_identical(actual, modified) with create_tmp_file() as tmp_file: @@ -2177,7 +2177,7 @@ def test_cross_engine_read_write_netcdf4(self): # Drop dim3, because its labels include strings. These appear to be # not properly read with python-netCDF4, which converts them into # unicode instead of leaving them as bytes. - data = create_test_data().drop("dim3") + data = create_test_data().drop_vars("dim3") data.attrs["foo"] = "bar" valid_engines = ["netcdf4", "h5netcdf"] for write_engine in valid_engines: @@ -2344,7 +2344,7 @@ def test_open_twice(self): def test_open_fileobj(self): # open in-memory datasets instead of local file paths - expected = create_test_data().drop("dim3") + expected = create_test_data().drop_vars("dim3") expected.attrs["foo"] = "bar" with create_tmp_file() as tmp_file: expected.to_netcdf(tmp_file, engine="h5netcdf") @@ -4190,7 +4190,7 @@ def test_open_dataarray_options(self): with create_tmp_file() as tmp: data.to_netcdf(tmp) - expected = data.drop("y") + expected = data.drop_vars("y") with open_dataarray(tmp, drop_variables=["y"]) as loaded: assert_identical(expected, loaded) diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index 34115b29b23..fa8ae9991d7 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -1129,11 +1129,11 @@ def test_map_blocks_to_array(map_ds): [ lambda x: x, lambda x: x.to_dataset(), - lambda x: x.drop("x"), + lambda x: x.drop_vars("x"), lambda x: x.expand_dims(k=[1, 2, 3]), lambda x: x.assign_coords(new_coord=("y", x.y * 2)), lambda x: x.astype(np.int32), - # TODO: [lambda x: x.isel(x=1).drop("x"), map_da], + # TODO: [lambda x: x.isel(x=1).drop_vars("x"), map_da], ], ) def test_map_blocks_da_transformations(func, map_da): @@ -1147,9 +1147,9 @@ def test_map_blocks_da_transformations(func, map_da): "func", [ lambda x: x, - lambda x: x.drop("cxy"), - lambda x: x.drop("a"), - lambda x: x.drop("x"), + lambda x: x.drop_vars("cxy"), + lambda x: x.drop_vars("a"), + lambda x: x.drop_vars("x"), lambda x: x.expand_dims(k=[1, 2, 3]), lambda x: x.rename({"a": "new1", "b": "new2"}), # TODO: [lambda x: x.isel(x=1)], diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index 2c823b0c20a..acfe684d220 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -906,7 +906,7 @@ def test_sel_dataarray(self): assert_array_equal(actual, da.isel(x=[0, 1, 2])) assert "new_dim" in actual.dims assert "new_dim" in actual.coords - assert_equal(actual["new_dim"].drop("x"), ind["new_dim"]) + assert_equal(actual["new_dim"].drop_vars("x"), ind["new_dim"]) def test_sel_invalid_slice(self): array = DataArray(np.arange(10), [("x", np.arange(10))]) @@ -1660,7 +1660,7 @@ def test_expand_dims_with_greater_dim_size(self): coords=expected_coords, dims=list(expected_coords.keys()), attrs={"key": "entry"}, - ).drop(["y", "dim_0"]) + ).drop_vars(["y", "dim_0"]) assert_identical(expected, actual) # Test with kwargs instead of passing dict to dim arg. @@ -1677,7 +1677,7 @@ def test_expand_dims_with_greater_dim_size(self): }, dims=["dim_1", "x", "dim_0"], attrs={"key": "entry"}, - ).drop("dim_0") + ).drop_vars("dim_0") assert_identical(other_way_expected, other_way) def test_set_index(self): @@ -1993,7 +1993,7 @@ def test_stack_unstack(self): ) pd.util.testing.assert_index_equal(a, b) - actual = orig.stack(z=["x", "y"]).unstack("z").drop(["x", "y"]) + actual = orig.stack(z=["x", "y"]).unstack("z").drop_vars(["x", "y"]) assert_identical(orig, actual) dims = ["a", "b", "c", "d", "e"] @@ -2001,11 +2001,11 @@ def test_stack_unstack(self): stacked = orig.stack(ab=["a", "b"], cd=["c", "d"]) unstacked = stacked.unstack(["ab", "cd"]) - roundtripped = unstacked.drop(["a", "b", "c", "d"]).transpose(*dims) + roundtripped = unstacked.drop_vars(["a", "b", "c", "d"]).transpose(*dims) assert_identical(orig, roundtripped) unstacked = stacked.unstack() - roundtripped = unstacked.drop(["a", "b", "c", "d"]).transpose(*dims) + roundtripped = unstacked.drop_vars(["a", "b", "c", "d"]).transpose(*dims) assert_identical(orig, roundtripped) def test_stack_unstack_decreasing_coordinate(self): @@ -2109,40 +2109,43 @@ def test_drop_coordinates(self): expected = DataArray(np.random.randn(2, 3), dims=["x", "y"]) arr = expected.copy() arr.coords["z"] = 2 - actual = arr.drop("z") + actual = arr.drop_vars("z") assert_identical(expected, actual) with pytest.raises(ValueError): - arr.drop("not found") + arr.drop_vars("not found") - actual = expected.drop("not found", errors="ignore") + actual = expected.drop_vars("not found", errors="ignore") assert_identical(actual, expected) with raises_regex(ValueError, "cannot be found"): - arr.drop("w") + arr.drop_vars("w") - actual = expected.drop("w", errors="ignore") + actual = expected.drop_vars("w", errors="ignore") assert_identical(actual, expected) renamed = arr.rename("foo") with raises_regex(ValueError, "cannot be found"): - renamed.drop("foo") + renamed.drop_vars("foo") - actual = renamed.drop("foo", errors="ignore") + actual = renamed.drop_vars("foo", errors="ignore") assert_identical(actual, renamed) def test_drop_index_labels(self): arr = DataArray(np.random.randn(2, 3), coords={"y": [0, 1, 2]}, dims=["x", "y"]) - actual = arr.drop([0, 1], dim="y") + actual = arr.drop_sel(y=[0, 1]) expected = arr[:, 2:] assert_identical(actual, expected) with raises_regex((KeyError, ValueError), "not .* in axis"): - actual = arr.drop([0, 1, 3], dim="y") + actual = arr.drop_sel(y=[0, 1, 3]) - actual = arr.drop([0, 1, 3], dim="y", errors="ignore") + actual = arr.drop_sel(y=[0, 1, 3], errors="ignore") assert_identical(actual, expected) + with pytest.warns(DeprecationWarning): + arr.drop([0, 1, 3], dim="y", errors="ignore") + def test_dropna(self): x = np.random.randn(4, 4) x[::2, 0] = np.nan @@ -3360,7 +3363,7 @@ def test_to_pandas(self): da = DataArray(np.random.randn(*shape), dims=dims) with warnings.catch_warnings(): warnings.filterwarnings("ignore", r"\W*Panel is deprecated") - roundtripped = DataArray(da.to_pandas()).drop(dims) + roundtripped = DataArray(da.to_pandas()).drop_vars(dims) assert_identical(da, roundtripped) with raises_regex(ValueError, "cannot convert"): @@ -3411,11 +3414,13 @@ def test_to_and_from_series(self): assert_array_equal(expected.index.values, actual.index.values) assert "foo" == actual.name # test roundtrip - assert_identical(self.dv, DataArray.from_series(actual).drop(["x", "y"])) + assert_identical(self.dv, DataArray.from_series(actual).drop_vars(["x", "y"])) # test name is None actual.name = None expected_da = self.dv.rename(None) - assert_identical(expected_da, DataArray.from_series(actual).drop(["x", "y"])) + assert_identical( + expected_da, DataArray.from_series(actual).drop_vars(["x", "y"]) + ) @requires_sparse def test_from_series_sparse(self): @@ -3478,7 +3483,7 @@ def test_to_and_from_dict(self): # and the most bare bones representation still roundtrips d = {"name": "foo", "dims": ("x", "y"), "data": array.values} - assert_identical(array.drop("x"), DataArray.from_dict(d)) + assert_identical(array.drop_vars("x"), DataArray.from_dict(d)) # missing a dims in the coords d = { diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index b9fa20fab26..50e78c9f685 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -322,7 +322,7 @@ def __repr__(self): def test_info(self): ds = create_test_data(seed=123) - ds = ds.drop("dim3") # string type prints differently in PY2 vs PY3 + ds = ds.drop_vars("dim3") # string type prints differently in PY2 vs PY3 ds.attrs["unicode_attr"] = "ba®" ds.attrs["string_attr"] = "bar" @@ -509,7 +509,9 @@ def test_constructor_compat(self): {"c": (("x", "y"), np.zeros((2, 3))), "x": [0, 1]}, ) - actual = Dataset({"a": original["a"][:, 0], "b": original["a"][0].drop("x")}) + actual = Dataset( + {"a": original["a"][:, 0], "b": original["a"][0].drop_vars("x")} + ) assert_identical(expected, actual) data = {"x": DataArray(0, coords={"y": 3}), "y": ("z", [1, 1, 1])} @@ -775,9 +777,9 @@ def test_coords_set(self): one_coord.reset_coords("x") actual = all_coords.reset_coords("zzz", drop=True) - expected = all_coords.drop("zzz") + expected = all_coords.drop_vars("zzz") assert_identical(expected, actual) - expected = two_coords.drop("zzz") + expected = two_coords.drop_vars("zzz") assert_identical(expected, actual) def test_coords_to_dataset(self): @@ -954,7 +956,7 @@ def test_dask_is_lazy(self): ds.fillna(0) ds.rename({"dim1": "foobar"}) ds.set_coords("var1") - ds.drop("var1") + ds.drop_vars("var1") def test_isel(self): data = create_test_data() @@ -1097,7 +1099,7 @@ def test_isel_fancy(self): actual = data.isel(dim1=stations["dim1s"], dim2=stations["dim2s"]) assert "station" in actual.coords assert "station" in actual.dims - assert_identical(actual["station"].drop(["dim2"]), stations["station"]) + assert_identical(actual["station"].drop_vars(["dim2"]), stations["station"]) with raises_regex(ValueError, "conflicting values for "): data.isel( @@ -1123,7 +1125,7 @@ def test_isel_fancy(self): assert "dim2" in actual.coords assert "a" in actual["dim2"].dims - assert_identical(actual["a"].drop(["dim2"]), stations["a"]) + assert_identical(actual["a"].drop_vars(["dim2"]), stations["a"]) assert_identical(actual["b"], stations["b"]) expected_var1 = data["var1"].variable[ stations["dim1s"].variable, stations["dim2s"].variable @@ -1132,7 +1134,7 @@ def test_isel_fancy(self): stations["dim1s"].variable, stations["dim2s"].variable ] expected_var3 = data["var3"].variable[slice(None), stations["dim1s"].variable] - assert_equal(actual["a"].drop("dim2"), stations["a"]) + assert_equal(actual["a"].drop_vars("dim2"), stations["a"]) assert_array_equal(actual["var1"], expected_var1) assert_array_equal(actual["var2"], expected_var2) assert_array_equal(actual["var3"], expected_var3) @@ -1200,7 +1202,7 @@ def test_isel_dataarray(self): indexing_da = indexing_da < 3 actual = data.isel(dim2=indexing_da) assert_identical( - actual["dim2"].drop("non_dim").drop("non_dim2"), data["dim2"][:2] + actual["dim2"].drop_vars("non_dim").drop_vars("non_dim2"), data["dim2"][:2] ) assert_identical(actual["non_dim"], indexing_da["non_dim"][:2]) assert_identical(actual["non_dim2"], indexing_da["non_dim2"]) @@ -1286,8 +1288,10 @@ def test_sel_dataarray(self): expected = data.isel(dim2=[0, 1, 2]).rename({"dim2": "new_dim"}) assert "new_dim" in actual.dims assert "new_dim" in actual.coords - assert_equal(actual.drop("new_dim").drop("dim2"), expected.drop("new_dim")) - assert_equal(actual["new_dim"].drop("dim2"), ind["new_dim"]) + assert_equal( + actual.drop_vars("new_dim").drop_vars("dim2"), expected.drop_vars("new_dim") + ) + assert_equal(actual["new_dim"].drop_vars("dim2"), ind["new_dim"]) # with conflicted coordinate (silently ignored) ind = DataArray( @@ -1304,10 +1308,12 @@ def test_sel_dataarray(self): coords={"new_dim": ["a", "b", "c"], "dim2": 3}, ) actual = data.sel(dim2=ind) - assert_equal(actual["new_dim"].drop("dim2"), ind["new_dim"].drop("dim2")) + assert_equal( + actual["new_dim"].drop_vars("dim2"), ind["new_dim"].drop_vars("dim2") + ) expected = data.isel(dim2=[0, 1, 2]) expected["dim2"] = (("new_dim"), expected["dim2"].values) - assert_equal(actual["dim2"].drop("new_dim"), expected["dim2"]) + assert_equal(actual["dim2"].drop_vars("new_dim"), expected["dim2"]) assert actual["var1"].dims == ("dim1", "new_dim") # with non-dimensional coordinate @@ -1322,7 +1328,7 @@ def test_sel_dataarray(self): ) actual = data.sel(dim2=ind) expected = data.isel(dim2=[0, 1, 2]) - assert_equal(actual.drop("new_dim"), expected) + assert_equal(actual.drop_vars("new_dim"), expected) assert np.allclose(actual["new_dim"].values, ind["new_dim"].values) def test_sel_dataarray_mindex(self): @@ -1554,8 +1560,8 @@ def test_sel_fancy(self): expected_ary = data["foo"][[0, 1, 2], [0, 2, 1]] actual = data.sel(x=idx_x, y=idx_y) assert_array_equal(expected_ary, actual["foo"]) - assert_identical(actual["a"].drop("x"), idx_x["a"]) - assert_identical(actual["b"].drop("y"), idx_y["b"]) + assert_identical(actual["a"].drop_vars("x"), idx_x["a"]) + assert_identical(actual["b"].drop_vars("y"), idx_y["b"]) with pytest.raises(KeyError): data.sel(x=[2.5], y=[2.0], method="pad", tolerance=1e-3) @@ -2094,36 +2100,50 @@ def test_variable_indexing(self): def test_drop_variables(self): data = create_test_data() - assert_identical(data, data.drop([])) + assert_identical(data, data.drop_vars([])) expected = Dataset({k: data[k] for k in data.variables if k != "time"}) - actual = data.drop("time") + actual = data.drop_vars("time") assert_identical(expected, actual) - actual = data.drop(["time"]) + actual = data.drop_vars(["time"]) assert_identical(expected, actual) with raises_regex(ValueError, "cannot be found"): - data.drop("not_found_here") + data.drop_vars("not_found_here") + + actual = data.drop_vars("not_found_here", errors="ignore") + assert_identical(data, actual) + + actual = data.drop_vars(["not_found_here"], errors="ignore") + assert_identical(data, actual) + + actual = data.drop_vars(["time", "not_found_here"], errors="ignore") + assert_identical(expected, actual) + + # deprecated approach with `drop` works (straight copy paste from above) - actual = data.drop("not_found_here", errors="ignore") + with pytest.warns(PendingDeprecationWarning): + actual = data.drop("not_found_here", errors="ignore") assert_identical(data, actual) - actual = data.drop(["not_found_here"], errors="ignore") + with pytest.warns(PendingDeprecationWarning): + actual = data.drop(["not_found_here"], errors="ignore") assert_identical(data, actual) - actual = data.drop(["time", "not_found_here"], errors="ignore") + with pytest.warns(PendingDeprecationWarning): + actual = data.drop(["time", "not_found_here"], errors="ignore") assert_identical(expected, actual) def test_drop_index_labels(self): data = Dataset({"A": (["x", "y"], np.random.randn(2, 3)), "x": ["a", "b"]}) with pytest.warns(DeprecationWarning): - actual = data.drop(["a"], "x") + actual = data.drop(["a"], dim="x") expected = data.isel(x=[1]) assert_identical(expected, actual) with pytest.warns(DeprecationWarning): - actual = data.drop(["a", "b"], "x") + actual = data.drop(["a", "b"], dim="x") expected = data.isel(x=slice(0, 0)) assert_identical(expected, actual) @@ -2147,30 +2167,30 @@ def test_drop_index_labels(self): # DataArrays as labels are a nasty corner case as they are not # Iterable[Hashable] - DataArray.__iter__ yields scalar DataArrays. - actual = data.drop(DataArray(["a", "b", "c"]), "x", errors="ignore") + actual = data.drop_sel(x=DataArray(["a", "b", "c"]), errors="ignore") expected = data.isel(x=slice(0, 0)) assert_identical(expected, actual) + with pytest.warns(DeprecationWarning): + data.drop(DataArray(["a", "b", "c"]), dim="x", errors="ignore") + assert_identical(expected, actual) with raises_regex(ValueError, "does not have coordinate labels"): - data.drop(1, "y") + data.drop_sel(y=1) def test_drop_labels_by_keyword(self): - # Tests for #2910: Support for a additional `drop()` API. data = Dataset( {"A": (["x", "y"], np.random.randn(2, 6)), "x": ["a", "b"], "y": range(6)} ) # Basic functionality. assert len(data.coords["x"]) == 2 - # In the future, this will break. with pytest.warns(DeprecationWarning): ds1 = data.drop(["a"], dim="x") - ds2 = data.drop(x="a") - ds3 = data.drop(x=["a"]) - ds4 = data.drop(x=["a", "b"]) - ds5 = data.drop(x=["a", "b"], y=range(0, 6, 2)) + ds2 = data.drop_sel(x="a") + ds3 = data.drop_sel(x=["a"]) + ds4 = data.drop_sel(x=["a", "b"]) + ds5 = data.drop_sel(x=["a", "b"], y=range(0, 6, 2)) - # In the future, this will result in different behavior. arr = DataArray(range(3), dims=["c"]) with pytest.warns(FutureWarning): data.drop(arr.coords) @@ -2187,10 +2207,11 @@ def test_drop_labels_by_keyword(self): # Error handling if user tries both approaches. with pytest.raises(ValueError): data.drop(labels=["a"], x="a") - with pytest.raises(ValueError): - data.drop(dim="x", x="a") with pytest.raises(ValueError): data.drop(labels=["a"], dim="x", x="a") + warnings.filterwarnings("ignore", r"\W*drop") + with pytest.raises(ValueError): + data.drop(dim="x", x="a") def test_drop_dims(self): data = xr.Dataset( @@ -2203,15 +2224,15 @@ def test_drop_dims(self): ) actual = data.drop_dims("x") - expected = data.drop(["A", "B", "x"]) + expected = data.drop_vars(["A", "B", "x"]) assert_identical(expected, actual) actual = data.drop_dims("y") - expected = data.drop("A") + expected = data.drop_vars("A") assert_identical(expected, actual) actual = data.drop_dims(["x", "y"]) - expected = data.drop(["A", "B", "x"]) + expected = data.drop_vars(["A", "B", "x"]) assert_identical(expected, actual) with pytest.raises((ValueError, KeyError)): @@ -2230,7 +2251,7 @@ def test_drop_dims(self): actual = data.drop_dims("z", errors="wrong_value") actual = data.drop_dims(["x", "y", "z"], errors="ignore") - expected = data.drop(["A", "B", "x"]) + expected = data.drop_vars(["A", "B", "x"]) assert_identical(expected, actual) def test_copy(self): @@ -2571,7 +2592,7 @@ def test_expand_dims_mixed_int_and_coords(self): original["x"].values * np.ones([4, 3, 3]), coords=dict(d=range(4), e=["l", "m", "n"], a=np.linspace(0, 1, 3)), dims=["d", "e", "a"], - ).drop("d"), + ).drop_vars("d"), "y": xr.DataArray( original["y"].values * np.ones([4, 3, 4, 3]), coords=dict( @@ -2581,7 +2602,7 @@ def test_expand_dims_mixed_int_and_coords(self): a=np.linspace(0, 1, 3), ), dims=["d", "e", "b", "a"], - ).drop("d"), + ).drop_vars("d"), }, coords={"c": np.linspace(0, 1, 5)}, ) @@ -3059,7 +3080,7 @@ def test_setitem_with_coords(self): np.arange(10), dims="dim3", coords={"numbers": ("dim3", np.arange(10))} ) expected = ds.copy() - expected["var3"] = other.drop("numbers") + expected["var3"] = other.drop_vars("numbers") actual = ds.copy() actual["var3"] = other assert_identical(expected, actual) @@ -4504,7 +4525,9 @@ def test_apply(self): actual = data.apply(lambda x: x.mean(keep_attrs=True), keep_attrs=True) assert_identical(expected, actual) - assert_identical(data.apply(lambda x: x, keep_attrs=True), data.drop("time")) + assert_identical( + data.apply(lambda x: x, keep_attrs=True), data.drop_vars("time") + ) def scale(x, multiple=1): return multiple * x @@ -4514,7 +4537,7 @@ def scale(x, multiple=1): assert_identical(actual["numbers"], data["numbers"]) actual = data.apply(np.asarray) - expected = data.drop("time") # time is not used on a data var + expected = data.drop_vars("time") # time is not used on a data var assert_equal(expected, actual) def make_example_math_dataset(self): @@ -4616,7 +4639,7 @@ def test_dataset_math_auto_align(self): assert_identical(expected, actual) actual = ds.isel(y=slice(1)) + ds.isel(y=slice(1, None)) - expected = 2 * ds.drop(ds.y, dim="y") + expected = 2 * ds.drop_sel(y=ds.y) assert_equal(actual, expected) actual = ds + ds[["bar"]] diff --git a/xarray/tests/test_duck_array_ops.py b/xarray/tests/test_duck_array_ops.py index 9df2f167cf2..f678af2fec5 100644 --- a/xarray/tests/test_duck_array_ops.py +++ b/xarray/tests/test_duck_array_ops.py @@ -441,7 +441,8 @@ def test_argmin_max(dim_num, dtype, contains_nan, dask, func, skipna, aggdim): ) expected = getattr(da, func)(dim=aggdim, skipna=skipna) assert_allclose( - actual.drop(list(actual.coords)), expected.drop(list(expected.coords)) + actual.drop_vars(list(actual.coords)), + expected.drop_vars(list(expected.coords)), ) diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index b9dc9a71acc..b93325d7eab 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -553,7 +553,7 @@ def test_datetime_single_string(): actual = da.interp(time="2000-01-01T12:00") expected = xr.DataArray(0.5) - assert_allclose(actual.drop("time"), expected) + assert_allclose(actual.drop_vars("time"), expected) @requires_cftime diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index 7deabd46eae..6e283ea01da 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -1837,7 +1837,11 @@ def test_default_labels(self): assert substring_in_axes(self.darray.name, ax) def test_test_empty_cell(self): - g = self.darray.isel(row=1).drop("row").plot(col="col", hue="hue", col_wrap=2) + g = ( + self.darray.isel(row=1) + .drop_vars("row") + .plot(col="col", hue="hue", col_wrap=2) + ) bottomright = g.axes[-1, -1] assert not bottomright.has_data() assert not bottomright.get_visible() diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 9d14104bb50..80063f8b4bc 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -1093,7 +1093,7 @@ def test_content_manipulation(self, func, dtype): "func", ( pytest.param( - method("drop", labels=np.array([1, 5]), dim="x"), + method("drop_sel", labels=dict(x=np.array([1, 5]))), marks=pytest.mark.xfail( reason="selecting using incompatible units does not raise" ), @@ -1128,9 +1128,9 @@ def test_content_manipulation_with_units(self, func, unit, error, dtype): expected = attach_units( func(strip_units(data_array), **stripped_kwargs), - {"data": quantity.units if func.name == "drop" else unit, "x": x.units}, + {"data": quantity.units if func.name == "drop_sel" else unit, "x": x.units}, ) - if error is not None and func.name == "drop": + if error is not None and func.name == "drop_sel": with pytest.raises(error): func(data_array, **kwargs) else:
[ { "path": "doc/data-structures.rst", "old_path": "a/doc/data-structures.rst", "new_path": "b/doc/data-structures.rst", "metadata": "diff --git a/doc/data-structures.rst b/doc/data-structures.rst\nindex d5567f4863e..93cdc7e9765 100644\n--- a/doc/data-structures.rst\n+++ b/doc/data-structures.rst\n@@ -393,14 +393,14 @@ methods (like pandas) for transforming datasets into new objects.\n \n For removing variables, you can select and drop an explicit list of\n variables by indexing with a list of names or using the\n-:py:meth:`~xarray.Dataset.drop` methods to return a new ``Dataset``. These\n+:py:meth:`~xarray.Dataset.drop_vars` methods to return a new ``Dataset``. These\n operations keep around coordinates:\n \n .. ipython:: python\n \n ds[['temperature']]\n ds[['temperature', 'temperature_double']]\n- ds.drop('temperature')\n+ ds.drop_vars('temperature')\n \n To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method.\n Any variables using that dimension are dropped:\n" }, { "path": "doc/indexing.rst", "old_path": "a/doc/indexing.rst", "new_path": "b/doc/indexing.rst", "metadata": "diff --git a/doc/indexing.rst b/doc/indexing.rst\nindex 9ee8f1dddf8..ace960689a8 100644\n--- a/doc/indexing.rst\n+++ b/doc/indexing.rst\n@@ -232,14 +232,14 @@ Using indexing to *assign* values to a subset of dataset (e.g.,\n Dropping labels and dimensions\n ------------------------------\n \n-The :py:meth:`~xarray.Dataset.drop` method returns a new object with the listed\n+The :py:meth:`~xarray.Dataset.drop_sel` method returns a new object with the listed\n index labels along a dimension dropped:\n \n .. ipython:: python\n \n- ds.drop(space=['IN', 'IL'])\n+ ds.drop_sel(space=['IN', 'IL'])\n \n-``drop`` is both a ``Dataset`` and ``DataArray`` method.\n+``drop_sel`` is both a ``Dataset`` and ``DataArray`` method.\n \n Use :py:meth:`~xarray.Dataset.drop_dims` to drop a full dimension from a Dataset.\n Any variables with these dimensions are also dropped:\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex dcaab011e67..0906058469d 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -38,6 +38,12 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- :py:meth:`Dataset.drop_sel` & :py:meth:`DataArray.drop_sel` have been added for dropping labels.\n+ :py:meth:`Dataset.drop_vars` & :py:meth:`DataArray.drop_vars` have been added for \n+ dropping variables (including coordinates). The existing ``drop`` methods remain as a backward compatible \n+ option for dropping either lables or variables, but using the more specific methods is encouraged.\n+ (:pull:`3475`)\n+ By `Maximilian Roos <https://github.com/max-sixty>`_\n - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n to represent all 'other' dimensions. For example, to move one dimension to the front,\n use `.transpose('x', ...)`. (:pull:`3421`)\n@@ -3752,6 +3758,7 @@ Enhancements\n explicitly listed variables or index labels:\n \n .. ipython:: python\n+ :okwarning:\n \n # drop variables\n ds = xray.Dataset({'x': 0, 'y': 1})\n" } ]
0014
4dce93f134e8296ea730104b46ce3372b90304ac
[ "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_equal[arr12-arr22]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataarray_diff_n1", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-False]", "xarray/tests/test_dataset.py::TestDataset::test_stack", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_dataset.py::test_dir_non_string[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2]", "xarray/tests/test_dataset.py::TestDataset::test_sel", "xarray/tests/test_dataarray.py::TestDataArray::test_align_mixed_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-True]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-max]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-float-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2.0]", "xarray/tests/test_dataset.py::TestDataset::test_coords_properties", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_dtype_dims", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_time_dim", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-bool_-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_attr_sources_multiindex", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-max]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_name", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_sequence", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_first", "xarray/tests/test_dataset.py::TestDataset::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-bool_-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_assign_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-bool_-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_where", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_dropna", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-True]", "xarray/tests/test_dataset.py::test_rolling_construct[3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_struct_array_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords8]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-std]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_bad_resample_dim", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-mean]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[sum-False-float32]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_with_coords", "xarray/tests/test_dataset.py::TestDataset::test_groupby_nan", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-2]", "xarray/tests/test_duck_array_ops.py::test_isnull[array1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math_virtual", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_changes_metadata", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-float32-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_where_other", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_old_name", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_0d", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[prod-False-float]", "xarray/tests/test_dataset.py::TestDataset::test_quantile", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_warning", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataarray.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_exclude", "xarray/tests/test_dataset.py::TestDataset::test_constructor", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dict", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-int-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_bad_dim", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_da_resample_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-max]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_empty_index", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-int-1]", "xarray/tests/test_dataset.py::TestDataset::test_resample_loffset", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_ndarray", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-bool_-1]", "xarray/tests/test_dataarray.py::test_isin[repeating_ints]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_series_categorical_index", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_copy_with_data", "xarray/tests/test_dataset.py::TestDataset::test_shift[fill_value0]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-float-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_coords", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_cumsum_2d", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_same_name", "xarray/tests/test_dataset.py::test_trapz_datetime[np-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_old_api", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_and_identical", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_selection_multiindex", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-int-1]", "xarray/tests/test_backends.py::test_invalid_netcdf_raises[scipy]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[prod-False-int]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum_default", "xarray/tests/test_dataset.py::TestDataset::test_to_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-float32-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-True]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_ds_resample_apply_func_args", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_nocopy", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem_dataarray", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_resample_min_count", "xarray/tests/test_backends.py::TestEncodingInvalid::test_extract_h5nc_encoding", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_invalid_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_whole", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_with_keep_attrs", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-std]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_drop", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::TestDataset::test_ipython_key_completion", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_construct[2-False]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_pandas", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-min]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-float32-2]", "xarray/tests/test_backends.py::test_invalid_netcdf_raises[netcdf4]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_default_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_dot", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign_dataarray", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_pandas_single", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-2]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_set_coords_update_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-max]", "xarray/tests/test_dataset.py::TestDataset::test_time_season", "xarray/tests/test_dataarray.py::TestDataArray::test_empty_dataarrays_return_empty_result", "xarray/tests/test_dataarray.py::TestDataArray::test_align_copy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_basics", "xarray/tests/test_duck_array_ops.py::test_cumsum_1d", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-float32-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords0]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_scalar_coordinate", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims_bottleneck", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-float-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-1-True]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-float32-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_tail", "xarray/tests/test_dataset.py::TestDataset::test_groupby_reduce", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-int-2]", "xarray/tests/test_dataset.py::test_integrate[True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_rename", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice_truncate", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_dataarray", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_original_non_unique_index", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_skipna", "xarray/tests/test_dataarray.py::TestDataArray::test__title_for_slice", "xarray/tests/test_dataset.py::TestDataset::test_reindex_variables_copied", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-True-1]", "xarray/tests/test_duck_array_ops.py::TestOps::test_first", "xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords9]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[prod-False-float32]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-2]", "xarray/tests/test_dataarray.py::test_name_in_masking", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-bool_-1]", "xarray/tests/test_dataset.py::TestDataset::test_properties", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-std]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-1]", "xarray/tests/test_duck_array_ops.py::TestOps::test_concatenate_type_promotion", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_align_non_unique", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_isnull[array2]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_time", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[sum-False-int]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-float-2]", "xarray/tests/test_dataset.py::test_dir_unicode[None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_resample_and_first", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_time_dim", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_coords_to_dataset", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_coordinates", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_variable_indexing", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_multidim", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_auto_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-mean]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_non_string", "xarray/tests/test_dataarray.py::TestDataArray::test_fillna", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-bool_-1]", "xarray/tests/test_duck_array_ops.py::test_min_count_dataset[prod]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_dim_order", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-int-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-float32-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-std]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_reorder_levels", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-mean]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_getitem_hashable", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-median]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-var]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords6]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords6]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_method", "xarray/tests/test_dataarray.py::TestDataArray::test_set_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-median]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_index_math", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor", "xarray/tests/test_dataset.py::TestDataset::test_constructor_1d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_isnull[array4]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-bool_-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_0d", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_dtype", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-var]", "xarray/tests/test_dataset.py::test_isin[test_elements2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_argmin", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-max]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_loc", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_array_interface", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-min]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-int-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray_datetime", "xarray/tests/test_dataset.py::TestDataset::test_unstack_errors", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_lazy_load", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords_none", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-sum]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variables_default_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas_name_matches_coordinate", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n2", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_unstacked_dataset_raises_value_error", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-bool_-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_non_unique_columns", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-bool_-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_alignment", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-False]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_dataset_getitem", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_full_like", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_align", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-sum]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-float32-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_auto_align", "xarray/tests/test_dataset.py::TestDataset::test_align_exclude", "xarray/tests/test_dataset.py::test_differentiate[2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_multiindex_level", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords9]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords3]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_indexes", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_math", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_identity", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_empty", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_cumops", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-1]", "xarray/tests/test_dataset.py::test_differentiate_datetime[False]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[fill_value0]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-int-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_update_overwrite_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_non_overlapping_dataarrays_return_empty_result", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_attribute_access", "xarray/tests/test_dataset.py::TestDataset::test_dataset_array_math", "xarray/tests/test_dataset.py::TestDataset::test_unstack", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::test_isin[test_elements1]", "xarray/tests/test_dataset.py::TestDataset::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename_same_name", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_single_boolean", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_properties", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_update_index", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-int-2]", "xarray/tests/test_dataset.py::TestDataset::test_rename", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coordinate_diff", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_slow", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-1]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_some_not_equal", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_indexes", "xarray/tests/test_dataset.py::TestDataset::test_rename_vars", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords5]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_to_index", "xarray/tests/test_dataarray.py::TestDataArray::test_full_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-1]", "xarray/tests/test_dataarray.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-min]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_errors", "xarray/tests/test_dataarray.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_join_setting", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_exclude", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_wrong_shape", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_restore_coord_dims", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_resample_keep_attrs", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-float32-1]", "xarray/tests/test_dataarray.py::test_rolling_doc[1]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[fill_value0]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-bool_-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_deprecated", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_quantile", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords4]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-max]", "xarray/tests/test_dataset.py::TestDataset::test_align_override", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_align_new_indexes", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_thin", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-float-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_properties[1]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-2]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-var]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_tolerance", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-median]", "xarray/tests/test_dataset.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_setitem", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_drop", "xarray/tests/test_dataset.py::TestDataset::test_data_vars_properties", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[2.0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_cumprod_2d", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-False]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_types[val10-val20-val30-null0]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_coords", "xarray/tests/test_dataset.py::test_differentiate[1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_keepdims", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_no_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_equals", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-mean]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-2-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_squeeze_drop", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int--5]", "xarray/tests/test_dataarray.py::TestDataArray::test_contains", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_name", "xarray/tests/test_backends.py::TestEncodingInvalid::test_extract_nc4_variable_encoding", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_join_setting", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_misaligned", "xarray/tests/test_duck_array_ops.py::test_isnull[array0]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dataframe", "xarray/tests/test_dataarray.py::TestDataArray::test_pickle", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-1-True]", "xarray/tests/test_dataset.py::TestDataset::test_rename_inplace", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_order", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-1]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-mean]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_like_no_index", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[sum-False-float]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_count", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_dataset_retains_period_index_on_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data_errors", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_float", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_merge_mismatched_shape", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-float32-1]", "xarray/tests/test_dataset.py::TestDataset::test_broadcast_like", "xarray/tests/test_dataset.py::test_rolling_construct[4-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_dtype", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_from_self_described", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_empty_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-True-1]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_types[foo-bar-baz-nan]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_first_and_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_n_neg", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset", "xarray/tests/test_dataarray.py::TestDataArray::test_coords_replacement_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-std]", "xarray/tests/test_dataset.py::TestDataset::test_stack_unstack_fast", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins_sort", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_iter[1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_split", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_name", "xarray/tests/test_dataarray.py::TestDataArray::test_align_exclude", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-1-False]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-float-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_dropna", "xarray/tests/test_dataset.py::test_isin[test_elements0]", "xarray/tests/test_dataarray.py::TestDataArray::test_math_automatic_alignment", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-float-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-float-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_docs", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_dimension_override", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_method", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_unstack_pandas_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-var]", "xarray/tests/test_dataset.py::TestDataset::test_set_index", "xarray/tests/test_dataarray.py::TestDataArray::test_roll_no_coords", "xarray/tests/test_dataset.py::TestDataset::test_constructor_with_coords", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_remove_unused", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays0]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-True-1]", "xarray/tests/test_duck_array_ops.py::TestOps::test_all_nan_arrays", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-max]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-2-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_is_null", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max_error", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-2-True]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-bool_-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-min]", "xarray/tests/test_dataarray.py::test_rolling_construct[3-True]", "xarray/tests/test_dataset.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-bool_-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_equals_and_identical", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2.0]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_combine_first", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-sum]", "xarray/tests/test_dataset.py::test_rolling_construct[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-mean]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_int", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-1]", "xarray/tests/test_dataset.py::test_trapz_datetime[np-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataset.py::TestDataset::test_rename_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-bool_-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[3-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[sum-False-bool_]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-False-var]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_strings", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-sum]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem_fancy", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like_fill_value[fill_value0]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_roll_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_fillna", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-1-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-True-2]", "xarray/tests/test_dataset.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataarray.py::test_rolling_construct[4-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-None-True]", "xarray/tests/test_dataset.py::test_coarsen[1-trim-left-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop_no_indexes", "xarray/tests/test_dataset.py::TestDataset::test_dataset_ellipsis_transpose_different_ordered_vars", "xarray/tests/test_dataset.py::TestDataset::test_copy", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[2-int-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_cumsum_test_dims", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-1]", "xarray/tests/test_dataarray.py::test_weakref", "xarray/tests/test_dataset.py::TestDataset::test_reduce", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_misaligned", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_math_not_aligned", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_regressions", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_sortby", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-float-1]", "xarray/tests/test_dataset.py::test_differentiate[2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_duck_array_ops.py::TestOps::test_where_type_promotion", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_dtypes", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_number_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-float-1]", "xarray/tests/test_dataset.py::TestDataset::test_virtual_variable_multiindex", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_multidim_apply", "xarray/tests/test_dataset.py::TestDataset::test_broadcast", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-True]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray_mindex", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-int-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float--5]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_assign_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-2-True]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-sum]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-False-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign", "xarray/tests/test_dataarray.py::TestDataArray::test_reduce_out", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_equals_failures", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_error", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_auto_align", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-max]", "xarray/tests/test_duck_array_ops.py::TestOps::test_last", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_exception_label_str", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-bool_-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-None-True]", "xarray/tests/test_dataset.py::test_no_dict", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-float32-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-mean]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-min-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reorder_levels", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[4-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-var]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-bool_-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_sel_invalid_slice", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-max-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_get_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_dataset_math", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_no_coords", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-1-False-1]", "xarray/tests/test_dataset.py::test_constructor_raises_with_invalid_coords[unaligned_coords0]", "xarray/tests/test_dataarray.py::test_rolling_iter[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-4-None-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_align_exact", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-True-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_to_unstacked_dataset_different_dimension", "xarray/tests/test_dataset.py::TestDataset::test_equals_failures", "xarray/tests/test_dataarray.py::TestDataArray::test_matmul", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-max-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_combine_first", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_init_value", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-std]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-std]", "xarray/tests/test_dataarray.py::test_raise_no_warning_for_nan_in_binary_ops", "xarray/tests/test_dataset.py::TestDataset::test_resample_ds_da_are_the_same", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_fancy", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_copy_with_data", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-std]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_no_axis", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-1-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_getitem", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-True-median]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-3-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_binary_op_propagate_indexes", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_construct[1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-int-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack_decreasing_coordinate", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-min]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_returns_new_type", "xarray/tests/test_dataarray.py::TestDataArray::test_align", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-std]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-float32-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_bins", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-False-min]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_coords", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-None-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_scalars", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-sum-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_slice_virtual_variable", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_where", "xarray/tests/test_dataset.py::test_integrate[False]", "xarray/tests/test_dataarray.py::TestDataArray::test_encoding", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_duck_array_ops.py::test_isnull[array3]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-min]", "xarray/tests/test_duck_array_ops.py::TestOps::test_count", "xarray/tests/test_dataset.py::test_rolling_construct[4-False]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-mean-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_mean_uint_dtype", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-None-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-None-False]", "xarray/tests/test_duck_array_ops.py::test_min_count[x-sum-False-int-1]", "xarray/tests/test_dataset.py::TestDataset::test_real_and_imag", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_equal[arr10-arr20]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_override_error[darrays1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_where_string", "xarray/tests/test_dataset.py::test_dir_expected_attrs[None]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-None-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_empty_series", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-int-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_dims", "xarray/tests/test_dataset.py::TestDataset::test_reindex_like", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_datetime_to_numeric_datetime64", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-1-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_coords_setitem_with_new_dimension", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_equals", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-2-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-max]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-float-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-3-False-2]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_equal[arr11-arr21]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_thin", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-True-median]", "xarray/tests/test_dataset.py::test_subclass_slots", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-3-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-int-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index_size_zero", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-var]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-float32-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-3-False-1]", "xarray/tests/test_duck_array_ops.py::TestOps::test_stack_type_promotion", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-True]", "xarray/tests/test_dataarray.py::test_no_dict", "xarray/tests/test_dataset.py::TestDataset::test_attr_access", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-var-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_rank", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-3-3-False]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-median]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_align_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_construct[3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-False]", "xarray/tests/test_dataset.py::test_coarsen_coords[1-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-int-1]", "xarray/tests/test_dataset.py::TestDataset::test_unary_ops", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-mean-False-float32-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-sum-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_mean_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_sortby", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-std]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-4-2-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-median]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-True-1]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_types[1.0-2.0-3.0-nan]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_nonunique_consistency", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-1-False]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-float-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-2-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_pickle", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_both_non_unique_index", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-1-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_errors", "xarray/tests/test_dataset.py::test_differentiate[1-False]", "xarray/tests/test_dataset.py::TestDataset::test_filter_by_attrs", "xarray/tests/test_dataset.py::TestDataset::test_to_stacked_array_invalid_sample_dims", "xarray/tests/test_dataset.py::TestDataset::test_reduce_keep_attrs", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords3]", "xarray/tests/test_dataset.py::TestDataset::test_delitem", "xarray/tests/test_duck_array_ops.py::test_min_count[None-prod-False-float32-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords0-unaligned_coords4]", "xarray/tests/test_dataarray.py::TestDataArray::test_setattr_raises", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-None-False]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[1-None-False]", "xarray/tests/test_duck_array_ops.py::TestArrayNotNullEquiv::test_types[foo-bar-baz-None]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_method", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-std]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_sum", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-False-var]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_update", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-False-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-2-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_where_drop", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-None-None-min]", "xarray/tests/test_dataarray.py::TestDataArray::test_constructor_invalid", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-3-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_count_correct", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_kwargs_python36plus", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-bool_-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-1-None-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_iter", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-None-min]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_label", "xarray/tests/test_dataarray.py::TestDataArray::test_sizes", "xarray/tests/test_dataset.py::test_isin_dataset", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-False-1]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords7]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-2-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_like", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-False-2]", "xarray/tests/test_dataset.py::TestDataset::test_roll_multidim", "xarray/tests/test_dataarray.py::TestDataArray::test_real_and_imag", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-1-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_tail", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-int-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-1-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-2-3-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_rank", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-True-sum]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-var-False-float32-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-4-3-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_drop", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-2-False-2]", "xarray/tests/test_dataset.py::test_error_message_on_set_supplied", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-max]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_min_count_dataset[sum]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-1-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-4-2-False-1]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-2-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataset_retains_keys", "xarray/tests/test_dataset.py::test_rolling_reduce[var-4-3-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-1-True]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_exclude", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-4-1-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_setitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-2-1-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-3-3-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-None-False-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_construct[2-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_binary_op_propagate_indexes", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-mean-False-float-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_virtual_time_components", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict_with_nan_nat", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-2-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_squeeze", "xarray/tests/test_dataset.py::TestDataset::test_reduce_only_one_axis", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-bool_-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[1-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_modify_inplace", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-2-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-None-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_attrs", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_count", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-2-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-4-None-True-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-True-max-False-bool_-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-max-False-float-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[3-None-True]", "xarray/tests/test_dataarray.py::TestDataArray::test_head", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-float32-1]", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-2-2-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_shift[fill_value1-float-0]", "xarray/tests/test_dataarray.py::TestDataArray::test_isel_types", "xarray/tests/test_dataset.py::test_rolling_pandas_compat[2-3-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-True]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z1-None-False-var]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-mean-False-float32-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-1-True-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_expand_dims_roundtrip", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-None-False]", "xarray/tests/test_dataset.py::TestDataset::test_reduce_non_numeric", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataarray.py::TestDataArray::test_to_masked_array", "xarray/tests/test_dataset.py::test_rolling_reduce[std-3-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_swap_dims", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-min-False-float32-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-3-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_diff_n1_simple", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-3-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-None-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_reindex_fill_value[2]", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-1-None-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-2-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_existing_scalar_coord", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-None-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-1-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-3-True-2]", "xarray/tests/test_duck_array_ops.py::test_min_count[None-sum-False-int-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-float32-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_coord_coords", "xarray/tests/test_dataset.py::TestDataset::test_merge_multiindex_level", "xarray/tests/test_dataset.py::test_rolling_reduce[max-4-None-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-2-3-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_shift[2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-1-1-True-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-3-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_upsample_nd", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_getitem", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-1-None-False-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-3-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-4-3-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-3-3-False]", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords0]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-3-None-False-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_head", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-2-True-1]", "xarray/tests/test_duck_array_ops.py::test_multiple_dims[prod-False-bool_]", "xarray/tests/test_dataset.py::test_rolling_properties[1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[sum-1-2-True-2]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-True-var-False-int-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dict_with_numpy_attrs", "xarray/tests/test_dataset.py::test_rolling_reduce[mean-3-1-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-min-False-float-2]", "xarray/tests/test_dataset.py::TestDataset::test_assign_attrs", "xarray/tests/test_duck_array_ops.py::test_min_count[x-prod-False-int-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-2-True]", "xarray/tests/test_dataset.py::TestDataset::test_coords_modify", "xarray/tests/test_dataset.py::TestDataset::test_resample_by_last_discarding_attrs", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-None-mean]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-1-True-1]", "xarray/tests/test_dataset.py::TestDataset::test_asarray", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-3-3-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[std-1-None-False-1]", "xarray/tests/test_dataset.py::TestDataset::test_dataset_transpose", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-4-1-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-3-True-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_reset_coords", "xarray/tests/test_dataarray.py::TestDataArray::test_groupby_apply_center", "xarray/tests/test_dataarray.py::test_rolling_reduce[mean-4-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[var-3-1-False-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-2-True-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-3-None-False-1]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-min-False-float32-1]", "xarray/tests/test_dataset.py::TestDataset::test_groupby_math", "xarray/tests/test_dataset.py::test_rolling_reduce[var-2-2-False-2]", "xarray/tests/test_dataarray.py::test_rolling_pandas_compat[4-1-False]", "xarray/tests/test_duck_array_ops.py::test_reduce[None-False-sum-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_broadcast_arrays_nocopy", "xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment", "xarray/tests/test_backends.py::TestCommon::test_robust_getitem", "xarray/tests/test_dataset.py::test_dataset_constructor_aligns_to_explicit_coords[coords1-unaligned_coords8]", "xarray/tests/test_dataarray.py::TestDataArray::test_swap_dims", "xarray/tests/test_dataarray.py::TestDataArray::test_loc_assign", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[sum-1-3-False]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_error", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-sum-False-int-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[std-2-None-True-2]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-3-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-1-1-True-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_align_without_indexes_errors", "xarray/tests/test_dataarray.py::test_rolling_wrapped_bottleneck[1-1-None-min]", "xarray/tests/test_dataarray.py::test_rolling_reduce_nonnumeric[max-2-1-False]", "xarray/tests/test_dataarray.py::test_rolling_reduce[max-2-1-False-2]", "xarray/tests/test_dataset.py::test_coarsen[1-pad-right-False]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-True-mean]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-1-None-sum]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-2-3-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[max-2-None-False-2]", "xarray/tests/test_dataset.py::test_rolling_reduce[median-4-3-True-1]", "xarray/tests/test_dataset.py::test_rolling_wrapped_bottleneck[1-z2-None-True-std]", "xarray/tests/test_duck_array_ops.py::test_reduce[x-False-var-False-bool_-1]", "xarray/tests/test_dataarray.py::test_rolling_reduce[sum-3-None-True-1]", "xarray/tests/test_dataset.py::test_rolling_reduce[min-1-None-True-1]" ]
[ "xarray/tests/test_dataarray.py::TestDataArray::test_sel_dataarray", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-int-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-float32-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-True-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-True-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-min-False-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_expand_dims_mixed_int_and_coords", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-bool_-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-bool_-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_pandas", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-max-False-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_dict", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-True-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-max-False-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_dataarray", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-True-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-False-float32-2]", "xarray/tests/test_dataset.py::TestDataset::test_constructor_compat", "xarray/tests/test_dataset.py::TestDataset::test_dataset_math_auto_align", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-True-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-min-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-True-str-2]", "xarray/tests/test_dataset.py::TestDataset::test_isel_fancy", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-True-bool_-1]", "xarray/tests/test_dataset.py::TestDataset::test_drop_index_labels", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-min-False-False-float32-2]", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_coordinates", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-min-False-False-str-2]", "xarray/tests/test_dataset.py::TestDataset::test_coords_set", "xarray/tests/test_dataset.py::TestDataset::test_sel_dataarray", "xarray/tests/test_dataarray.py::TestDataArray::test_drop_index_labels", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-True-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-min-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-max-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-int-1]", "xarray/tests/test_dataset.py::TestDataset::test_info", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-bool_-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-True-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-bool_-1]", "xarray/tests/test_dataset.py::TestDataset::test_drop_variables", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-True-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-float32-1]", "xarray/tests/test_dataset.py::TestDataset::test_setitem_with_coords", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-float-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_expand_dims_with_greater_dim_size", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-True-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-max-False-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_drop_labels_by_keyword", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-float-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-int-1]", "xarray/tests/test_dataset.py::TestDataset::test_sel_fancy", "xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_series", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-bool_-2]", "xarray/tests/test_dataset.py::TestDataset::test_apply", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-min-False-False-float32-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-bool_-1]", "xarray/tests/test_dataset.py::TestDataset::test_drop_dims", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-float32-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-True-min-False-False-int-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-float32-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-max-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-bool_-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-False-str-1]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-min-False-True-bool_-1]", "xarray/tests/test_dataarray.py::TestDataArray::test_stack_unstack", "xarray/tests/test_duck_array_ops.py::test_argmin_max[y-False-max-False-False-float-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-True-max-False-False-str-2]", "xarray/tests/test_duck_array_ops.py::test_argmin_max[x-False-max-False-False-int-1]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "field", "name": "PendingDeprecationWarning" } ] }
[ { "path": "doc/data-structures.rst", "old_path": "a/doc/data-structures.rst", "new_path": "b/doc/data-structures.rst", "metadata": "diff --git a/doc/data-structures.rst b/doc/data-structures.rst\nindex d5567f4863e..93cdc7e9765 100644\n--- a/doc/data-structures.rst\n+++ b/doc/data-structures.rst\n@@ -393,14 +393,14 @@ methods (like pandas) for transforming datasets into new objects.\n \n For removing variables, you can select and drop an explicit list of\n variables by indexing with a list of names or using the\n-:py:meth:`~xarray.Dataset.drop` methods to return a new ``Dataset``. These\n+:py:meth:`~xarray.Dataset.drop_vars` methods to return a new ``Dataset``. These\n operations keep around coordinates:\n \n .. ipython:: python\n \n ds[['temperature']]\n ds[['temperature', 'temperature_double']]\n- ds.drop('temperature')\n+ ds.drop_vars('temperature')\n \n To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method.\n Any variables using that dimension are dropped:\n" }, { "path": "doc/indexing.rst", "old_path": "a/doc/indexing.rst", "new_path": "b/doc/indexing.rst", "metadata": "diff --git a/doc/indexing.rst b/doc/indexing.rst\nindex 9ee8f1dddf8..ace960689a8 100644\n--- a/doc/indexing.rst\n+++ b/doc/indexing.rst\n@@ -232,14 +232,14 @@ Using indexing to *assign* values to a subset of dataset (e.g.,\n Dropping labels and dimensions\n ------------------------------\n \n-The :py:meth:`~xarray.Dataset.drop` method returns a new object with the listed\n+The :py:meth:`~xarray.Dataset.drop_sel` method returns a new object with the listed\n index labels along a dimension dropped:\n \n .. ipython:: python\n \n- ds.drop(space=['IN', 'IL'])\n+ ds.drop_sel(space=['IN', 'IL'])\n \n-``drop`` is both a ``Dataset`` and ``DataArray`` method.\n+``drop_sel`` is both a ``Dataset`` and ``DataArray`` method.\n \n Use :py:meth:`~xarray.Dataset.drop_dims` to drop a full dimension from a Dataset.\n Any variables with these dimensions are also dropped:\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex dcaab011e67..0906058469d 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -38,6 +38,12 @@ Breaking changes\n \n New Features\n ~~~~~~~~~~~~\n+- :py:meth:`Dataset.drop_sel` & :py:meth:`DataArray.drop_sel` have been added for dropping labels.\n+ :py:meth:`Dataset.drop_vars` & :py:meth:`DataArray.drop_vars` have been added for \n+ dropping variables (including coordinates). The existing ``drop`` methods remain as a backward compatible \n+ option for dropping either lables or variables, but using the more specific methods is encouraged.\n+ (:pull:`<PRID>`)\n+ By `<NAME>`_\n - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`)\n to represent all 'other' dimensions. For example, to move one dimension to the front,\n use `.transpose('x', ...)`. (:pull:`<PRID>`)\n@@ -3752,6 +3758,7 @@ Enhancements\n explicitly listed variables or index labels:\n \n .. ipython:: python\n+ :okwarning:\n \n # drop variables\n ds = xray.Dataset({'x': 0, 'y': 1})\n" } ]
diff --git a/doc/data-structures.rst b/doc/data-structures.rst index d5567f4863e..93cdc7e9765 100644 --- a/doc/data-structures.rst +++ b/doc/data-structures.rst @@ -393,14 +393,14 @@ methods (like pandas) for transforming datasets into new objects. For removing variables, you can select and drop an explicit list of variables by indexing with a list of names or using the -:py:meth:`~xarray.Dataset.drop` methods to return a new ``Dataset``. These +:py:meth:`~xarray.Dataset.drop_vars` methods to return a new ``Dataset``. These operations keep around coordinates: .. ipython:: python ds[['temperature']] ds[['temperature', 'temperature_double']] - ds.drop('temperature') + ds.drop_vars('temperature') To remove a dimension, you can use :py:meth:`~xarray.Dataset.drop_dims` method. Any variables using that dimension are dropped: diff --git a/doc/indexing.rst b/doc/indexing.rst index 9ee8f1dddf8..ace960689a8 100644 --- a/doc/indexing.rst +++ b/doc/indexing.rst @@ -232,14 +232,14 @@ Using indexing to *assign* values to a subset of dataset (e.g., Dropping labels and dimensions ------------------------------ -The :py:meth:`~xarray.Dataset.drop` method returns a new object with the listed +The :py:meth:`~xarray.Dataset.drop_sel` method returns a new object with the listed index labels along a dimension dropped: .. ipython:: python - ds.drop(space=['IN', 'IL']) + ds.drop_sel(space=['IN', 'IL']) -``drop`` is both a ``Dataset`` and ``DataArray`` method. +``drop_sel`` is both a ``Dataset`` and ``DataArray`` method. Use :py:meth:`~xarray.Dataset.drop_dims` to drop a full dimension from a Dataset. Any variables with these dimensions are also dropped: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index dcaab011e67..0906058469d 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -38,6 +38,12 @@ Breaking changes New Features ~~~~~~~~~~~~ +- :py:meth:`Dataset.drop_sel` & :py:meth:`DataArray.drop_sel` have been added for dropping labels. + :py:meth:`Dataset.drop_vars` & :py:meth:`DataArray.drop_vars` have been added for + dropping variables (including coordinates). The existing ``drop`` methods remain as a backward compatible + option for dropping either lables or variables, but using the more specific methods is encouraged. + (:pull:`<PRID>`) + By `<NAME>`_ - :py:meth:`Dataset.transpose` and :py:meth:`DataArray.transpose` now support an ellipsis (`...`) to represent all 'other' dimensions. For example, to move one dimension to the front, use `.transpose('x', ...)`. (:pull:`<PRID>`) @@ -3752,6 +3758,7 @@ Enhancements explicitly listed variables or index labels: .. ipython:: python + :okwarning: # drop variables ds = xray.Dataset({'x': 0, 'y': 1}) If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'field', 'name': 'PendingDeprecationWarning'}]
pydata/xarray
pydata__xarray-3276
https://github.com/pydata/xarray/pull/3276
diff --git a/doc/api.rst b/doc/api.rst index 256a1dbf3af..40f9add3c57 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -30,6 +30,7 @@ Top-level functions zeros_like ones_like dot + map_blocks Dataset ======= @@ -499,6 +500,8 @@ Dataset methods Dataset.persist Dataset.load Dataset.chunk + Dataset.unify_chunks + Dataset.map_blocks Dataset.filter_by_attrs Dataset.info @@ -529,6 +532,8 @@ DataArray methods DataArray.persist DataArray.load DataArray.chunk + DataArray.unify_chunks + DataArray.map_blocks GroupBy objects =============== @@ -629,6 +634,7 @@ Testing testing.assert_equal testing.assert_identical testing.assert_allclose + testing.assert_chunks_equal Exceptions ========== diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 520f1f79870..b6e12f01f4b 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -49,6 +49,11 @@ Breaking changes New functions/methods ~~~~~~~~~~~~~~~~~~~~~ +- Added :py:func:`~xarray.map_blocks`, modeled after :py:func:`dask.array.map_blocks`. + Also added :py:meth:`Dataset.unify_chunks`, :py:meth:`DataArray.unify_chunks` and + :py:meth:`testing.assert_chunks_equal`. By `Deepak Cherian <https://github.com/dcherian>`_ + and `Guido Imperiale <https://github.com/crusaderky>`_. + Enhancements ~~~~~~~~~~~~ diff --git a/xarray/__init__.py b/xarray/__init__.py index cdca708e28c..394dd0f80bc 100644 --- a/xarray/__init__.py +++ b/xarray/__init__.py @@ -17,6 +17,7 @@ from .core.dataarray import DataArray from .core.merge import merge, MergeError from .core.options import set_options +from .core.parallel import map_blocks from .backends.api import ( open_dataset, diff --git a/xarray/coding/times.py b/xarray/coding/times.py index 1508fb50b38..ed6908117a2 100644 --- a/xarray/coding/times.py +++ b/xarray/coding/times.py @@ -22,7 +22,6 @@ unpack_for_encoding, ) - # standard calendars recognized by cftime _STANDARD_CALENDARS = {"standard", "gregorian", "proleptic_gregorian"} diff --git a/xarray/core/dask_array_compat.py b/xarray/core/dask_array_compat.py new file mode 100644 index 00000000000..c3dbdd27098 --- /dev/null +++ b/xarray/core/dask_array_compat.py @@ -0,0 +1,91 @@ +from distutils.version import LooseVersion + +import dask.array as da +import numpy as np +from dask import __version__ as dask_version + +if LooseVersion(dask_version) >= LooseVersion("2.0.0"): + meta_from_array = da.utils.meta_from_array +else: + # Copied from dask v2.4.0 + # Used under the terms of Dask's license, see licenses/DASK_LICENSE. + import numbers + + def meta_from_array(x, ndim=None, dtype=None): + """ Normalize an array to appropriate meta object + + Parameters + ---------- + x: array-like, callable + Either an object that looks sufficiently like a Numpy array, + or a callable that accepts shape and dtype keywords + ndim: int + Number of dimensions of the array + dtype: Numpy dtype + A valid input for ``np.dtype`` + + Returns + ------- + array-like with zero elements of the correct dtype + """ + # If using x._meta, x must be a Dask Array, some libraries (e.g. zarr) + # implement a _meta attribute that are incompatible with Dask Array._meta + if hasattr(x, "_meta") and isinstance(x, da.Array): + x = x._meta + + if dtype is None and x is None: + raise ValueError("You must specify the meta or dtype of the array") + + if np.isscalar(x): + x = np.array(x) + + if x is None: + x = np.ndarray + + if isinstance(x, type): + x = x(shape=(0,) * (ndim or 0), dtype=dtype) + + if ( + not hasattr(x, "shape") + or not hasattr(x, "dtype") + or not isinstance(x.shape, tuple) + ): + return x + + if isinstance(x, list) or isinstance(x, tuple): + ndims = [ + 0 + if isinstance(a, numbers.Number) + else a.ndim + if hasattr(a, "ndim") + else len(a) + for a in x + ] + a = [a if nd == 0 else meta_from_array(a, nd) for a, nd in zip(x, ndims)] + return a if isinstance(x, list) else tuple(x) + + if ndim is None: + ndim = x.ndim + + try: + meta = x[tuple(slice(0, 0, None) for _ in range(x.ndim))] + if meta.ndim != ndim: + if ndim > x.ndim: + meta = meta[ + (Ellipsis,) + tuple(None for _ in range(ndim - meta.ndim)) + ] + meta = meta[tuple(slice(0, 0, None) for _ in range(meta.ndim))] + elif ndim == 0: + meta = meta.sum() + else: + meta = meta.reshape((0,) * ndim) + except Exception: + meta = np.empty((0,) * ndim, dtype=dtype or x.dtype) + + if np.isscalar(meta): + meta = np.array(meta) + + if dtype and meta.dtype != dtype: + meta = meta.astype(dtype) + + return meta diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index d536d0de2c5..1b1d23bc2fc 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -14,6 +14,7 @@ Optional, Sequence, Tuple, + TypeVar, Union, cast, overload, @@ -63,6 +64,8 @@ ) if TYPE_CHECKING: + T_DSorDA = TypeVar("T_DSorDA", "DataArray", Dataset) + try: from dask.delayed import Delayed except ImportError: @@ -3038,6 +3041,79 @@ def integrate( ds = self._to_temp_dataset().integrate(dim, datetime_unit) return self._from_temp_dataset(ds) + def unify_chunks(self) -> "DataArray": + """ Unify chunk size along all chunked dimensions of this DataArray. + + Returns + ------- + + DataArray with consistent chunk sizes for all dask-array variables + + See Also + -------- + + dask.array.core.unify_chunks + """ + ds = self._to_temp_dataset().unify_chunks() + return self._from_temp_dataset(ds) + + def map_blocks( + self, + func: "Callable[..., T_DSorDA]", + args: Sequence[Any] = (), + kwargs: Mapping[str, Any] = None, + ) -> "T_DSorDA": + """ + Apply a function to each chunk of this DataArray. This method is experimental + and its signature may change. + + Parameters + ---------- + func: callable + User-provided function that accepts a DataArray as its first parameter. The + function will receive a subset of this DataArray, corresponding to one chunk + along each chunked dimension. ``func`` will be executed as + ``func(obj_subset, *args, **kwargs)``. + + The function will be first run on mocked-up data, that looks like this array + but has sizes 0, to determine properties of the returned object such as + dtype, variable names, new dimensions and new indexes (if any). + + This function must return either a single DataArray or a single Dataset. + + This function cannot change size of existing dimensions, or add new chunked + dimensions. + args: Sequence + Passed verbatim to func after unpacking, after the sliced DataArray. xarray + objects, if any, will not be split by chunks. Passing dask collections is + not allowed. + kwargs: Mapping + Passed verbatim to func after unpacking. xarray objects, if any, will not be + split by chunks. Passing dask collections is not allowed. + + Returns + ------- + A single DataArray or Dataset with dask backend, reassembled from the outputs of + the function. + + Notes + ----- + This method is designed for when one needs to manipulate a whole xarray object + within each chunk. In the more common case where one can work on numpy arrays, + it is recommended to use apply_ufunc. + + If none of the variables in this DataArray is backed by dask, calling this + method is equivalent to calling ``func(self, *args, **kwargs)``. + + See Also + -------- + dask.array.map_blocks, xarray.apply_ufunc, xarray.map_blocks, + xarray.Dataset.map_blocks + """ + from .parallel import map_blocks + + return map_blocks(func, self, args, kwargs) + # this needs to be at the end, or mypy will confuse with `str` # https://mypy.readthedocs.io/en/latest/common_issues.html#dealing-with-conflicting-names str = property(StringAccessor) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 7b4c7b441bd..42990df6f65 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -21,6 +21,7 @@ Sequence, Set, Tuple, + TypeVar, Union, cast, overload, @@ -85,6 +86,8 @@ from .dataarray import DataArray from .merge import CoercibleMapping + T_DSorDA = TypeVar("T_DSorDA", DataArray, "Dataset") + try: from dask.delayed import Delayed except ImportError: @@ -1670,7 +1673,10 @@ def chunks(self) -> Mapping[Hashable, Tuple[int, ...]]: if v.chunks is not None: for dim, c in zip(v.dims, v.chunks): if dim in chunks and c != chunks[dim]: - raise ValueError("inconsistent chunks") + raise ValueError( + f"Object has inconsistent chunks along dimension {dim}. " + "This can be fixed by calling unify_chunks()." + ) chunks[dim] = c return Frozen(SortedKeysDict(chunks)) @@ -1855,7 +1861,7 @@ def isel( self, indexers: Mapping[Hashable, Any] = None, drop: bool = False, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Returns a new dataset with each array indexed along the specified dimension(s). @@ -1938,7 +1944,7 @@ def sel( method: str = None, tolerance: Number = None, drop: bool = False, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Returns a new dataset with each array indexed by tick labels along the specified dimension(s). @@ -2011,7 +2017,7 @@ def sel( def head( self, indexers: Union[Mapping[Hashable, int], int] = None, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Returns a new dataset with the first `n` values of each array for the specified dimension(s). @@ -2058,7 +2064,7 @@ def head( def tail( self, indexers: Union[Mapping[Hashable, int], int] = None, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Returns a new dataset with the last `n` values of each array for the specified dimension(s). @@ -2108,7 +2114,7 @@ def tail( def thin( self, indexers: Union[Mapping[Hashable, int], int] = None, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Returns a new dataset with each array indexed along every `n`th value for the specified dimension(s) @@ -2246,7 +2252,7 @@ def reindex( tolerance: Number = None, copy: bool = True, fill_value: Any = dtypes.NA, - **indexers_kwargs: Any + **indexers_kwargs: Any, ) -> "Dataset": """Conform this object onto a new set of indexes, filling in missing values with ``fill_value``. The default fill value is NaN. @@ -2447,7 +2453,7 @@ def interp( method: str = "linear", assume_sorted: bool = False, kwargs: Mapping[str, Any] = None, - **coords_kwargs: Any + **coords_kwargs: Any, ) -> "Dataset": """ Multidimensional interpolation of Dataset. @@ -2673,7 +2679,7 @@ def rename( self, name_dict: Mapping[Hashable, Hashable] = None, inplace: bool = None, - **names: Hashable + **names: Hashable, ) -> "Dataset": """Returns a new object with renamed variables and dimensions. @@ -2876,7 +2882,7 @@ def expand_dims( self, dim: Union[None, Hashable, Sequence[Hashable], Mapping[Hashable, Any]] = None, axis: Union[None, int, Sequence[int]] = None, - **dim_kwargs: Any + **dim_kwargs: Any, ) -> "Dataset": """Return a new object with an additional axis (or axes) inserted at the corresponding position in the array shape. The new object is a @@ -3022,7 +3028,7 @@ def set_index( indexes: Mapping[Hashable, Union[Hashable, Sequence[Hashable]]] = None, append: bool = False, inplace: bool = None, - **indexes_kwargs: Union[Hashable, Sequence[Hashable]] + **indexes_kwargs: Union[Hashable, Sequence[Hashable]], ) -> "Dataset": """Set Dataset (multi-)indexes using one or more existing coordinates or variables. @@ -3124,7 +3130,7 @@ def reorder_levels( self, dim_order: Mapping[Hashable, Sequence[int]] = None, inplace: bool = None, - **dim_order_kwargs: Sequence[int] + **dim_order_kwargs: Sequence[int], ) -> "Dataset": """Rearrange index levels using input order. @@ -3190,7 +3196,7 @@ def _stack_once(self, dims, new_dim): def stack( self, dimensions: Mapping[Hashable, Sequence[Hashable]] = None, - **dimensions_kwargs: Sequence[Hashable] + **dimensions_kwargs: Sequence[Hashable], ) -> "Dataset": """ Stack any number of existing dimensions into a single new dimension. @@ -3891,7 +3897,7 @@ def interpolate_na( method: str = "linear", limit: int = None, use_coordinate: Union[bool, Hashable] = True, - **kwargs: Any + **kwargs: Any, ) -> "Dataset": """Interpolate values according to different methods. @@ -3942,7 +3948,7 @@ def interpolate_na( method=method, limit=limit, use_coordinate=use_coordinate, - **kwargs + **kwargs, ) return new @@ -4023,7 +4029,7 @@ def reduce( keepdims: bool = False, numeric_only: bool = False, allow_lazy: bool = False, - **kwargs: Any + **kwargs: Any, ) -> "Dataset": """Reduce this dataset by applying `func` along some dimension(s). @@ -4098,7 +4104,7 @@ def reduce( keep_attrs=keep_attrs, keepdims=keepdims, allow_lazy=allow_lazy, - **kwargs + **kwargs, ) coord_names = {k for k in self.coords if k in variables} @@ -4113,7 +4119,7 @@ def apply( func: Callable, keep_attrs: bool = None, args: Iterable[Any] = (), - **kwargs: Any + **kwargs: Any, ) -> "Dataset": """Apply a function over the data variables in this dataset. @@ -5366,5 +5372,108 @@ def filter_by_attrs(self, **kwargs): selection.append(var_name) return self[selection] + def unify_chunks(self) -> "Dataset": + """ Unify chunk size along all chunked dimensions of this Dataset. + + Returns + ------- + + Dataset with consistent chunk sizes for all dask-array variables + + See Also + -------- + + dask.array.core.unify_chunks + """ + + try: + self.chunks + except ValueError: # "inconsistent chunks" + pass + else: + # No variables with dask backend, or all chunks are already aligned + return self.copy() + + # import dask is placed after the quick exit test above to allow + # running this method if dask isn't installed and there are no chunks + import dask.array + + ds = self.copy() + + dims_pos_map = {dim: index for index, dim in enumerate(ds.dims)} + + dask_array_names = [] + dask_unify_args = [] + for name, variable in ds.variables.items(): + if isinstance(variable.data, dask.array.Array): + dims_tuple = [dims_pos_map[dim] for dim in variable.dims] + dask_array_names.append(name) + dask_unify_args.append(variable.data) + dask_unify_args.append(dims_tuple) + + _, rechunked_arrays = dask.array.core.unify_chunks(*dask_unify_args) + + for name, new_array in zip(dask_array_names, rechunked_arrays): + ds.variables[name]._data = new_array + + return ds + + def map_blocks( + self, + func: "Callable[..., T_DSorDA]", + args: Sequence[Any] = (), + kwargs: Mapping[str, Any] = None, + ) -> "T_DSorDA": + """ + Apply a function to each chunk of this Dataset. This method is experimental and + its signature may change. + + Parameters + ---------- + func: callable + User-provided function that accepts a Dataset as its first parameter. The + function will receive a subset of this Dataset, corresponding to one chunk + along each chunked dimension. ``func`` will be executed as + ``func(obj_subset, *args, **kwargs)``. + + The function will be first run on mocked-up data, that looks like this + Dataset but has sizes 0, to determine properties of the returned object such + as dtype, variable names, new dimensions and new indexes (if any). + + This function must return either a single DataArray or a single Dataset. + + This function cannot change size of existing dimensions, or add new chunked + dimensions. + args: Sequence + Passed verbatim to func after unpacking, after the sliced DataArray. xarray + objects, if any, will not be split by chunks. Passing dask collections is + not allowed. + kwargs: Mapping + Passed verbatim to func after unpacking. xarray objects, if any, will not be + split by chunks. Passing dask collections is not allowed. + + Returns + ------- + A single DataArray or Dataset with dask backend, reassembled from the outputs of + the function. + + Notes + ----- + This method is designed for when one needs to manipulate a whole xarray object + within each chunk. In the more common case where one can work on numpy arrays, + it is recommended to use apply_ufunc. + + If none of the variables in this Dataset is backed by dask, calling this method + is equivalent to calling ``func(self, *args, **kwargs)``. + + See Also + -------- + dask.array.map_blocks, xarray.apply_ufunc, xarray.map_blocks, + xarray.DataArray.map_blocks + """ + from .parallel import map_blocks + + return map_blocks(func, self, args, kwargs) + ops.inject_all_ops_and_reduce_methods(Dataset, array_only=False) diff --git a/xarray/core/parallel.py b/xarray/core/parallel.py new file mode 100644 index 00000000000..48bb9ccfc3d --- /dev/null +++ b/xarray/core/parallel.py @@ -0,0 +1,339 @@ +try: + import dask + import dask.array + from dask.highlevelgraph import HighLevelGraph + from .dask_array_compat import meta_from_array + +except ImportError: + pass + +import itertools +import operator +from typing import ( + Any, + Callable, + Dict, + Hashable, + Mapping, + Sequence, + Tuple, + TypeVar, + Union, +) + +import numpy as np + +from .dataarray import DataArray +from .dataset import Dataset + +T_DSorDA = TypeVar("T_DSorDA", DataArray, Dataset) + + +def dataset_to_dataarray(obj: Dataset) -> DataArray: + if not isinstance(obj, Dataset): + raise TypeError("Expected Dataset, got %s" % type(obj)) + + if len(obj.data_vars) > 1: + raise TypeError( + "Trying to convert Dataset with more than one data variable to DataArray" + ) + + return next(iter(obj.data_vars.values())) + + +def make_meta(obj): + """If obj is a DataArray or Dataset, return a new object of the same type and with + the same variables and dtypes, but where all variables have size 0 and numpy + backend. + If obj is neither a DataArray nor Dataset, return it unaltered. + """ + if isinstance(obj, DataArray): + obj_array = obj + obj = obj._to_temp_dataset() + elif isinstance(obj, Dataset): + obj_array = None + else: + return obj + + meta = Dataset() + for name, variable in obj.variables.items(): + meta_obj = meta_from_array(variable.data, ndim=variable.ndim) + meta[name] = (variable.dims, meta_obj, variable.attrs) + meta.attrs = obj.attrs + meta = meta.set_coords(obj.coords) + + if obj_array is not None: + return obj_array._from_temp_dataset(meta) + return meta + + +def infer_template( + func: Callable[..., T_DSorDA], obj: Union[DataArray, Dataset], *args, **kwargs +) -> T_DSorDA: + """Infer return object by running the function on meta objects. + """ + meta_args = [make_meta(arg) for arg in (obj,) + args] + + try: + template = func(*meta_args, **kwargs) + except Exception as e: + raise Exception( + "Cannot infer object returned from running user provided function." + ) from e + + if not isinstance(template, (Dataset, DataArray)): + raise TypeError( + "Function must return an xarray DataArray or Dataset. Instead it returned " + f"{type(template)}" + ) + + return template + + +def make_dict(x: Union[DataArray, Dataset]) -> Dict[Hashable, Any]: + """Map variable name to numpy(-like) data + (Dataset.to_dict() is too complicated). + """ + if isinstance(x, DataArray): + x = x._to_temp_dataset() + + return {k: v.data for k, v in x.variables.items()} + + +def map_blocks( + func: Callable[..., T_DSorDA], + obj: Union[DataArray, Dataset], + args: Sequence[Any] = (), + kwargs: Mapping[str, Any] = None, +) -> T_DSorDA: + """Apply a function to each chunk of a DataArray or Dataset. This function is + experimental and its signature may change. + + Parameters + ---------- + func: callable + User-provided function that accepts a DataArray or Dataset as its first + parameter. The function will receive a subset of 'obj' (see below), + corresponding to one chunk along each chunked dimension. ``func`` will be + executed as ``func(obj_subset, *args, **kwargs)``. + + The function will be first run on mocked-up data, that looks like 'obj' but + has sizes 0, to determine properties of the returned object such as dtype, + variable names, new dimensions and new indexes (if any). + + This function must return either a single DataArray or a single Dataset. + + This function cannot change size of existing dimensions, or add new chunked + dimensions. + obj: DataArray, Dataset + Passed to the function as its first argument, one dask chunk at a time. + args: Sequence + Passed verbatim to func after unpacking, after the sliced obj. xarray objects, + if any, will not be split by chunks. Passing dask collections is not allowed. + kwargs: Mapping + Passed verbatim to func after unpacking. xarray objects, if any, will not be + split by chunks. Passing dask collections is not allowed. + + Returns + ------- + A single DataArray or Dataset with dask backend, reassembled from the outputs of the + function. + + Notes + ----- + This function is designed for when one needs to manipulate a whole xarray object + within each chunk. In the more common case where one can work on numpy arrays, it is + recommended to use apply_ufunc. + + If none of the variables in obj is backed by dask, calling this function is + equivalent to calling ``func(obj, *args, **kwargs)``. + + See Also + -------- + dask.array.map_blocks, xarray.apply_ufunc, xarray.Dataset.map_blocks, + xarray.DataArray.map_blocks + """ + + def _wrapper(func, obj, to_array, args, kwargs): + if to_array: + obj = dataset_to_dataarray(obj) + + result = func(obj, *args, **kwargs) + + for name, index in result.indexes.items(): + if name in obj.indexes: + if len(index) != len(obj.indexes[name]): + raise ValueError( + "Length of the %r dimension has changed. This is not allowed." + % name + ) + + return make_dict(result) + + if not isinstance(args, Sequence): + raise TypeError("args must be a sequence (for example, a list or tuple).") + if kwargs is None: + kwargs = {} + elif not isinstance(kwargs, Mapping): + raise TypeError("kwargs must be a mapping (for example, a dict)") + + for value in list(args) + list(kwargs.values()): + if dask.is_dask_collection(value): + raise TypeError( + "Cannot pass dask collections in args or kwargs yet. Please compute or " + "load values before passing to map_blocks." + ) + + if not dask.is_dask_collection(obj): + return func(obj, *args, **kwargs) + + if isinstance(obj, DataArray): + # only using _to_temp_dataset would break + # func = lambda x: x.to_dataset() + # since that relies on preserving name. + if obj.name is None: + dataset = obj._to_temp_dataset() + else: + dataset = obj.to_dataset() + input_is_array = True + else: + dataset = obj + input_is_array = False + + input_chunks = dataset.chunks + + template: Union[DataArray, Dataset] = infer_template(func, obj, *args, **kwargs) + if isinstance(template, DataArray): + result_is_array = True + template_name = template.name + template = template._to_temp_dataset() + elif isinstance(template, Dataset): + result_is_array = False + else: + raise TypeError( + f"func output must be DataArray or Dataset; got {type(template)}" + ) + + template_indexes = set(template.indexes) + dataset_indexes = set(dataset.indexes) + preserved_indexes = template_indexes & dataset_indexes + new_indexes = template_indexes - dataset_indexes + indexes = {dim: dataset.indexes[dim] for dim in preserved_indexes} + indexes.update({k: template.indexes[k] for k in new_indexes}) + + graph: Dict[Any, Any] = {} + gname = "%s-%s" % ( + dask.utils.funcname(func), + dask.base.tokenize(dataset, args, kwargs), + ) + + # map dims to list of chunk indexes + ichunk = {dim: range(len(chunks_v)) for dim, chunks_v in input_chunks.items()} + # mapping from chunk index to slice bounds + chunk_index_bounds = { + dim: np.cumsum((0,) + chunks_v) for dim, chunks_v in input_chunks.items() + } + + # iterate over all possible chunk combinations + for v in itertools.product(*ichunk.values()): + chunk_index_dict = dict(zip(dataset.dims, v)) + + # this will become [[name1, variable1], + # [name2, variable2], + # ...] + # which is passed to dict and then to Dataset + data_vars = [] + coords = [] + + for name, variable in dataset.variables.items(): + # make a task that creates tuple of (dims, chunk) + if dask.is_dask_collection(variable.data): + # recursively index into dask_keys nested list to get chunk + chunk = variable.__dask_keys__() + for dim in variable.dims: + chunk = chunk[chunk_index_dict[dim]] + + chunk_variable_task = ("%s-%s" % (gname, chunk[0]),) + v + graph[chunk_variable_task] = ( + tuple, + [variable.dims, chunk, variable.attrs], + ) + else: + # non-dask array with possibly chunked dimensions + # index into variable appropriately + subsetter = {} + for dim in variable.dims: + if dim in chunk_index_dict: + which_chunk = chunk_index_dict[dim] + subsetter[dim] = slice( + chunk_index_bounds[dim][which_chunk], + chunk_index_bounds[dim][which_chunk + 1], + ) + + subset = variable.isel(subsetter) + chunk_variable_task = ( + "%s-%s" % (gname, dask.base.tokenize(subset)), + ) + v + graph[chunk_variable_task] = ( + tuple, + [subset.dims, subset, subset.attrs], + ) + + # this task creates dict mapping variable name to above tuple + if name in dataset._coord_names: + coords.append([name, chunk_variable_task]) + else: + data_vars.append([name, chunk_variable_task]) + + from_wrapper = (gname,) + v + graph[from_wrapper] = ( + _wrapper, + func, + (Dataset, (dict, data_vars), (dict, coords), dataset.attrs), + input_is_array, + args, + kwargs, + ) + + # mapping from variable name to dask graph key + var_key_map: Dict[Hashable, str] = {} + for name, variable in template.variables.items(): + if name in indexes: + continue + gname_l = "%s-%s" % (gname, name) + var_key_map[name] = gname_l + + key: Tuple[Any, ...] = (gname_l,) + for dim in variable.dims: + if dim in chunk_index_dict: + key += (chunk_index_dict[dim],) + else: + # unchunked dimensions in the input have one chunk in the result + key += (0,) + + graph[key] = (operator.getitem, from_wrapper, name) + + graph = HighLevelGraph.from_collections(gname, graph, dependencies=[dataset]) + + result = Dataset(coords=indexes, attrs=template.attrs) + for name, gname_l in var_key_map.items(): + dims = template[name].dims + var_chunks = [] + for dim in dims: + if dim in input_chunks: + var_chunks.append(input_chunks[dim]) + elif dim in indexes: + var_chunks.append((len(indexes[dim]),)) + + data = dask.array.Array( + graph, name=gname_l, chunks=var_chunks, dtype=template[name].dtype + ) + result[name] = (dims, data, template[name].attrs) + + result = result.set_coords(template._coord_names) + + if result_is_array: + da = dataset_to_dataarray(result) + da.name = template_name + return da # type: ignore + return result # type: ignore diff --git a/xarray/core/pdcompat.py b/xarray/core/pdcompat.py index 7591fff3abe..f2e4518e0dc 100644 --- a/xarray/core/pdcompat.py +++ b/xarray/core/pdcompat.py @@ -41,7 +41,6 @@ import pandas as pd - # allow ourselves to type checks for Panel even after it's removed if LooseVersion(pd.__version__) < "0.25.0": Panel = pd.Panel diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 6d7a07c6791..24865d62666 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -3,7 +3,7 @@ from collections import OrderedDict, defaultdict from datetime import timedelta from distutils.version import LooseVersion -from typing import Any, Hashable, Mapping, Union, TypeVar +from typing import Any, Hashable, Mapping, TypeVar, Union import numpy as np import pandas as pd
diff --git a/xarray/testing.py b/xarray/testing.py index f01cbe896b9..95e41cfb10c 100644 --- a/xarray/testing.py +++ b/xarray/testing.py @@ -142,6 +142,26 @@ def assert_allclose(a, b, rtol=1e-05, atol=1e-08, decode_bytes=True): raise TypeError("{} not supported by assertion comparison".format(type(a))) +def assert_chunks_equal(a, b): + """ + Assert that chunksizes along chunked dimensions are equal. + + Parameters + ---------- + a : xarray.Dataset or xarray.DataArray + The first object to compare. + b : xarray.Dataset or xarray.DataArray + The second object to compare. + """ + + if isinstance(a, DataArray) != isinstance(b, DataArray): + raise TypeError("a and b have mismatched types") + + left = a.unify_chunks() + right = b.unify_chunks() + assert left.chunks == right.chunks + + def _assert_indexes_invariants_checks(indexes, possible_coord_variables, dims): assert isinstance(indexes, OrderedDict), indexes assert all(isinstance(v, pd.Index) for v in indexes.values()), { diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 8b4d3073e1c..acf8b67effa 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -9,6 +9,7 @@ import numpy as np import pytest from numpy.testing import assert_array_equal # noqa: F401 +from pandas.testing import assert_frame_equal # noqa: F401 import xarray.testing from xarray.core import utils @@ -17,8 +18,6 @@ from xarray.core.options import set_options from xarray.plot.utils import import_seaborn -from pandas.testing import assert_frame_equal # noqa: F401 - # import mpl and change the backend before other mpl imports try: import matplotlib as mpl diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 0120e2ca0fe..b5421a6bc9f 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -14,8 +14,8 @@ import numpy as np import pandas as pd -from pandas.errors import OutOfBoundsDatetime import pytest +from pandas.errors import OutOfBoundsDatetime import xarray as xr from xarray import ( diff --git a/xarray/tests/test_coding_times.py b/xarray/tests/test_coding_times.py index 406b9c1ba69..33a409e6f45 100644 --- a/xarray/tests/test_coding_times.py +++ b/xarray/tests/test_coding_times.py @@ -6,7 +6,6 @@ import pytest from pandas.errors import OutOfBoundsDatetime - from xarray import DataArray, Dataset, Variable, coding, decode_cf from xarray.coding.times import ( _import_cftime, @@ -30,7 +29,6 @@ requires_cftime_or_netCDF4, ) - _NON_STANDARD_CALENDARS_SET = { "noleap", "365_day", diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index c142ca7643b..3e2e132825f 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -1,3 +1,4 @@ +import operator import pickle from collections import OrderedDict from contextlib import suppress @@ -11,6 +12,7 @@ import xarray as xr import xarray.ufuncs as xu from xarray import DataArray, Dataset, Variable +from xarray.testing import assert_chunks_equal from xarray.tests import mock from . import ( @@ -894,3 +896,243 @@ def test_dask_layers_and_dependencies(): assert set(x.foo.__dask_graph__().dependencies).issuperset( ds.__dask_graph__().dependencies ) + + +def make_da(): + da = xr.DataArray( + np.ones((10, 20)), + dims=["x", "y"], + coords={"x": np.arange(10), "y": np.arange(100, 120)}, + name="a", + ).chunk({"x": 4, "y": 5}) + da.attrs["test"] = "test" + da.coords["c2"] = 0.5 + da.coords["ndcoord"] = da.x * 2 + da.coords["cxy"] = (da.x * da.y).chunk({"x": 4, "y": 5}) + + return da + + +def make_ds(): + map_ds = xr.Dataset() + map_ds["a"] = make_da() + map_ds["b"] = map_ds.a + 50 + map_ds["c"] = map_ds.x + 20 + map_ds = map_ds.chunk({"x": 4, "y": 5}) + map_ds["d"] = ("z", [1, 1, 1, 1]) + map_ds["z"] = [0, 1, 2, 3] + map_ds["e"] = map_ds.x + map_ds.y + map_ds.coords["c1"] = 0.5 + map_ds.coords["cx"] = ("x", np.arange(len(map_ds.x))) + map_ds.coords["cx"].attrs["test2"] = "test2" + map_ds.attrs["test"] = "test" + map_ds.coords["xx"] = map_ds["a"] * map_ds.y + + return map_ds + + +# fixtures cannot be used in parametrize statements +# instead use this workaround +# https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly +@pytest.fixture +def map_da(): + return make_da() + + +@pytest.fixture +def map_ds(): + return make_ds() + + +def test_unify_chunks(map_ds): + ds_copy = map_ds.copy() + ds_copy["cxy"] = ds_copy.cxy.chunk({"y": 10}) + + with raises_regex(ValueError, "inconsistent chunks"): + ds_copy.chunks + + expected_chunks = {"x": (4, 4, 2), "y": (5, 5, 5, 5), "z": (4,)} + with raise_if_dask_computes(): + actual_chunks = ds_copy.unify_chunks().chunks + expected_chunks == actual_chunks + assert_identical(map_ds, ds_copy.unify_chunks()) + + +@pytest.mark.parametrize("obj", [make_ds(), make_da()]) +@pytest.mark.parametrize( + "transform", [lambda x: x.compute(), lambda x: x.unify_chunks()] +) +def test_unify_chunks_shallow_copy(obj, transform): + obj = transform(obj) + unified = obj.unify_chunks() + assert_identical(obj, unified) and obj is not obj.unify_chunks() + + +def test_map_blocks_error(map_da, map_ds): + def bad_func(darray): + return (darray * darray.x + 5 * darray.y)[:1, :1] + + with raises_regex(ValueError, "Length of the.* has changed."): + xr.map_blocks(bad_func, map_da).compute() + + def returns_numpy(darray): + return (darray * darray.x + 5 * darray.y).values + + with raises_regex(TypeError, "Function must return an xarray DataArray"): + xr.map_blocks(returns_numpy, map_da) + + with raises_regex(TypeError, "args must be"): + xr.map_blocks(operator.add, map_da, args=10) + + with raises_regex(TypeError, "kwargs must be"): + xr.map_blocks(operator.add, map_da, args=[10], kwargs=[20]) + + def really_bad_func(darray): + raise ValueError("couldn't do anything.") + + with raises_regex(Exception, "Cannot infer"): + xr.map_blocks(really_bad_func, map_da) + + ds_copy = map_ds.copy() + ds_copy["cxy"] = ds_copy.cxy.chunk({"y": 10}) + + with raises_regex(ValueError, "inconsistent chunks"): + xr.map_blocks(bad_func, ds_copy) + + with raises_regex(TypeError, "Cannot pass dask collections"): + xr.map_blocks(bad_func, map_da, args=[map_da.chunk()]) + + with raises_regex(TypeError, "Cannot pass dask collections"): + xr.map_blocks(bad_func, map_da, kwargs=dict(a=map_da.chunk())) + + +@pytest.mark.parametrize("obj", [make_da(), make_ds()]) +def test_map_blocks(obj): + def func(obj): + result = obj + obj.x + 5 * obj.y + return result + + with raise_if_dask_computes(): + actual = xr.map_blocks(func, obj) + expected = func(obj) + assert_chunks_equal(expected.chunk(), actual) + xr.testing.assert_identical(actual.compute(), expected.compute()) + + +@pytest.mark.parametrize("obj", [make_da(), make_ds()]) +def test_map_blocks_convert_args_to_list(obj): + expected = obj + 10 + with raise_if_dask_computes(): + actual = xr.map_blocks(operator.add, obj, [10]) + assert_chunks_equal(expected.chunk(), actual) + xr.testing.assert_identical(actual.compute(), expected.compute()) + + +@pytest.mark.parametrize("obj", [make_da(), make_ds()]) +def test_map_blocks_add_attrs(obj): + def add_attrs(obj): + obj = obj.copy(deep=True) + obj.attrs["new"] = "new" + obj.cxy.attrs["new2"] = "new2" + return obj + + expected = add_attrs(obj) + with raise_if_dask_computes(): + actual = xr.map_blocks(add_attrs, obj) + + xr.testing.assert_identical(actual.compute(), expected.compute()) + + +def test_map_blocks_change_name(map_da): + def change_name(obj): + obj = obj.copy(deep=True) + obj.name = "new" + return obj + + expected = change_name(map_da) + with raise_if_dask_computes(): + actual = xr.map_blocks(change_name, map_da) + + xr.testing.assert_identical(actual.compute(), expected.compute()) + + +@pytest.mark.parametrize("obj", [make_da(), make_ds()]) +def test_map_blocks_kwargs(obj): + expected = xr.full_like(obj, fill_value=np.nan) + with raise_if_dask_computes(): + actual = xr.map_blocks(xr.full_like, obj, kwargs=dict(fill_value=np.nan)) + assert_chunks_equal(expected.chunk(), actual) + xr.testing.assert_identical(actual.compute(), expected.compute()) + + +def test_map_blocks_to_array(map_ds): + with raise_if_dask_computes(): + actual = xr.map_blocks(lambda x: x.to_array(), map_ds) + + # to_array does not preserve name, so cannot use assert_identical + assert_equal(actual.compute(), map_ds.to_array().compute()) + + +@pytest.mark.parametrize( + "func", + [ + lambda x: x, + lambda x: x.to_dataset(), + lambda x: x.drop("x"), + lambda x: x.expand_dims(k=[1, 2, 3]), + lambda x: x.assign_coords(new_coord=("y", x.y * 2)), + lambda x: x.astype(np.int32), + # TODO: [lambda x: x.isel(x=1).drop("x"), map_da], + ], +) +def test_map_blocks_da_transformations(func, map_da): + with raise_if_dask_computes(): + actual = xr.map_blocks(func, map_da) + + assert_identical(actual.compute(), func(map_da).compute()) + + +@pytest.mark.parametrize( + "func", + [ + lambda x: x, + lambda x: x.drop("cxy"), + lambda x: x.drop("a"), + lambda x: x.drop("x"), + lambda x: x.expand_dims(k=[1, 2, 3]), + lambda x: x.rename({"a": "new1", "b": "new2"}), + # TODO: [lambda x: x.isel(x=1)], + ], +) +def test_map_blocks_ds_transformations(func, map_ds): + with raise_if_dask_computes(): + actual = xr.map_blocks(func, map_ds) + + assert_identical(actual.compute(), func(map_ds).compute()) + + +@pytest.mark.parametrize("obj", [make_da(), make_ds()]) +def test_map_blocks_object_method(obj): + def func(obj): + result = obj + obj.x + 5 * obj.y + return result + + with raise_if_dask_computes(): + expected = xr.map_blocks(func, obj) + actual = obj.map_blocks(func) + + assert_identical(expected.compute(), actual.compute()) + + +def test_make_meta(map_ds): + from ..core.parallel import make_meta + + meta = make_meta(map_ds) + + for variable in map_ds._coord_names: + assert variable in meta._coord_names + assert meta.coords[variable].shape == (0,) * meta.coords[variable].ndim + + for variable in map_ds.data_vars: + assert variable in meta.data_vars + assert meta.data_vars[variable].shape == (0,) * meta.data_vars[variable].ndim
[ { "path": "doc/api.rst", "old_path": "a/doc/api.rst", "new_path": "b/doc/api.rst", "metadata": "diff --git a/doc/api.rst b/doc/api.rst\nindex 256a1dbf3af..40f9add3c57 100644\n--- a/doc/api.rst\n+++ b/doc/api.rst\n@@ -30,6 +30,7 @@ Top-level functions\n zeros_like\n ones_like\n dot\n+ map_blocks\n \n Dataset\n =======\n@@ -499,6 +500,8 @@ Dataset methods\n Dataset.persist\n Dataset.load\n Dataset.chunk\n+ Dataset.unify_chunks\n+ Dataset.map_blocks\n Dataset.filter_by_attrs\n Dataset.info\n \n@@ -529,6 +532,8 @@ DataArray methods\n DataArray.persist\n DataArray.load\n DataArray.chunk\n+ DataArray.unify_chunks\n+ DataArray.map_blocks\n \n GroupBy objects\n ===============\n@@ -629,6 +634,7 @@ Testing\n testing.assert_equal\n testing.assert_identical\n testing.assert_allclose\n+ testing.assert_chunks_equal\n \n Exceptions\n ==========\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 520f1f79870..b6e12f01f4b 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -49,6 +49,11 @@ Breaking changes\n New functions/methods\n ~~~~~~~~~~~~~~~~~~~~~\n \n+- Added :py:func:`~xarray.map_blocks`, modeled after :py:func:`dask.array.map_blocks`.\n+ Also added :py:meth:`Dataset.unify_chunks`, :py:meth:`DataArray.unify_chunks` and\n+ :py:meth:`testing.assert_chunks_equal`. By `Deepak Cherian <https://github.com/dcherian>`_\n+ and `Guido Imperiale <https://github.com/crusaderky>`_.\n+\n Enhancements\n ~~~~~~~~~~~~\n \n" } ]
2206
291cb805bf0bf326da87152cc6548191bbeb6aab
[ "xarray/tests/test_backends.py::TestScipyInMemoryData::test_invalid_dataarray_names_raise", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_subgroup", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_dataset_caching", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-julian]", "xarray/tests/test_backends.py::TestH5NetCDFData::test_0dimensional_variable", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates19-Hour since 1680-01-01 00:00:00-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_cf_timedelta[1D-days-numbers0]", "xarray/tests/test_backends.py::TestRasterio::test_geotiff_tags", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates58-hours since 1900-01-01T00:00:00-proleptic_gregorian]", "xarray/tests/test_dask.py::test_persist_DataArray[<lambda>0]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_test_data", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_read_variable_len_strings", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates16-hour since 1680-01-01 00:00:00-proleptic_gregorian]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_ufuncs", "xarray/tests/test_coding_times.py::test_cf_datetime[10-days since 2000-01-01-standard]", "xarray/tests/test_backends.py::TestCommon::test_robust_getitem", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataset_pickle", "xarray/tests/test_backends.py::TestNetCDF4Data::test_read_variable_len_strings", "xarray/tests/test_backends.py::TestNetCDF4Data::test_invalid_dataarray_names_raise", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_read_variable_len_strings", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataarray_getattr", "xarray/tests/test_backends.py::TestScipyFilePath::test_roundtrip_example_1_netcdf_gz", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates15-hour since 1680-01-01 00:00:00-gregorian]", "xarray/tests/test_coding_times.py::test_cf_timedelta_2d", "xarray/tests/test_backends.py::TestDask::test_zero_dimensional_variable", "xarray/tests/test_backends.py::TestDask::test_dataset_caching", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates13-hours since 1680-01-01 00:00:00-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[0-milliseconds since 2000-01-01T00:00:00-gregorian]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::TestVariable::test_repr", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_where_dispatching", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-all_leap]", "xarray/tests/test_backends.py::TestDask::test_save_mfdataset_invalid_dataarray", "xarray/tests/test_backends.py::TestDask::test_dataset_compute", "xarray/tests/test_backends.py::TestH5NetCDFData::test_read_variable_len_strings", "xarray/tests/test_backends.py::TestEncodingInvalid::test_extract_nc4_variable_encoding", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-noleap]", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe", "xarray/tests/test_coding_times.py::test_cf_timedelta[timedeltas5-None-numbers5]", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-366_day]", "xarray/tests/test_dask.py::test_dask_kwargs_variable[compute]", "xarray/tests/test_coding_times.py::test_cf_timedelta[timedeltas6-hours-numbers6]", "xarray/tests/test_dask.py::TestVariable::test_squeeze", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates6-days since 2000-01-01-gregorian]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_open_group", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_badbytes", "xarray/tests/test_backends.py::TestDask::test_write_store", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_stack", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates3-seconds since 1900-01-01 00:00:00]", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_open_encodings", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-360_day]", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_invalid_dataarray_names_raise", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates59-hours since 1900-01-01T00:00:00-standard]", "xarray/tests/test_backends.py::TestH5NetCDFData::test_open_subgroup", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-all_leap]", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_multiindex_not_implemented", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_concat_loads_variables", "xarray/tests/test_backends.py::TestZarrDirectoryStore::test_encoding_kwarg_fixed_width_string", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-gregorian]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_0dimensional_variable", "xarray/tests/test_backends.py::TestNetCDF4Data::test_open_group", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_lazy_dataset", "xarray/tests/test_backends.py::test_open_mfdataset_list_attr", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates27-daYs since 2000-01-01-gregorian]", "xarray/tests/test_coding_times.py::test_contains_cftime_datetimes_non_cftimes[non_cftime_data0]", "xarray/tests/test_backends.py::TestNetCDF4Data::test_open_subgroup", "xarray/tests/test_backends.py::TestDask::test_roundtrip_coordinates_with_space", "xarray/tests/test_backends.py::TestScipyFileObject::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_decoded_cf_datetime_array_2d", "xarray/tests/test_backends.py::TestNetCDF4Data::test_open_encodings", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-360_day]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-all_leap]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dot", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_read_variable_len_strings", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates52-days since 1900-01-01-proleptic_gregorian]", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_0dimensional_variable", "xarray/tests/test_backends.py::TestRasterio::test_indexing", "xarray/tests/test_dask.py::test_dask_kwargs_dataset[compute]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-all_leap]", "xarray/tests/test_backends.py::test_invalid_netcdf_raises[netcdf4]", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[1500-standard]", "xarray/tests/test_backends.py::TestPydap::test_cmp_local_file", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_to_dataset_roundtrip", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-noleap]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-julian]", "xarray/tests/test_coding_times.py::test_time_units_with_timezone_roundtrip[gregorian]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataarray_pickle", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates31-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_object_dtype", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-365_day]", "xarray/tests/test_backends.py::TestDask::test_array_type_after_indexing", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates0-days since 2000-01-01-gregorian]", "xarray/tests/test_dask.py::TestVariable::test_compute", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates3-days since 2000-01-01-gregorian]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataarray_repr", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_open_subgroup", "xarray/tests/test_dask.py::TestVariable::test_univariate_ufunc", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_merge", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-365_day]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates22- Hour since 1680-01-01 00:00:00 -proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates51-days since 1900-01-01-gregorian]", "xarray/tests/test_backends.py::TestZarrDirectoryStore::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates34-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_decode_cf_time_bounds", "xarray/tests/test_dask.py::TestVariable::test_basics", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_mask_and_scale", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates5-days since 1970-01-01 00:00:00]", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-all_leap]", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates1-hours since 1900-01-01 12:00:00]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_timedelta_data", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_0dimensional_variable", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-360_day]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-365_day]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates66-seconds since 1981-01-01-gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates69-hour since 1680-01-01 00:00:00.500000-gregorian]", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates4-days since 1900-01-01 00:00:00]", "xarray/tests/test_backends.py::TestRasterio::test_caching", "xarray/tests/test_coding_times.py::test_cf_timedelta[1us-microseconds-numbers4]", "xarray/tests/test_coding_times.py::test_format_cftime_datetime[date_args1-0010-02-03 04:05:06.000000]", "xarray/tests/test_coding_times.py::test_format_cftime_datetime[date_args3-1000-02-03 04:05:06.000000]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_lazy_array", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_new_chunk", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates28-daYs since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[10-days since 2000-01-01-gregorian]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_string_data", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates53-days since 1900-01-01-standard]", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_mask_and_scale", "xarray/tests/test_coding_times.py::test_infer_timedelta_units[deltas3-seconds]", "xarray/tests/test_dask.py::TestVariable::test_binary_op", "xarray/tests/test_backends.py::TestDask::test_isel_dataarray", "xarray/tests/test_backends.py::TestDask::test_pickle", "xarray/tests/test_backends.py::TestDask::test_roundtrip_boolean_dtype", "xarray/tests/test_coding_times.py::test_encode_cf_datetime_pandas_min", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-366_day]", "xarray/tests/test_coding_times.py::test_format_cftime_datetime[date_args0-0001-02-03 04:05:06.000000]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_groupby", "xarray/tests/test_backends.py::TestRasterio::test_utm", "xarray/tests/test_backends.py::TestRasterio::test_non_rectilinear", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_no_coordinate", "xarray/tests/test_coding_times.py::test_contains_cftime_datetimes_non_cftimes[non_cftime_data1]", "xarray/tests/test_backends.py::TestRasterio::test_chunks", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates7-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataset_repr", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-julian]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_open_encodings", "xarray/tests/test_backends.py::TestDask::test_load", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2500-360_day]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_example_1_netcdf", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates1-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_infer_timedelta_units[deltas1-hours]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates67-seconds since 1981-01-01-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[2500-standard]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates71-hour since 1680-01-01 00:00:00.500000-standard]", "xarray/tests/test_backends.py::TestPydap::test_dask", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_already_open_dataset_group", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates4-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_read_byte_attrs_as_unicode", "xarray/tests/test_backends.py::TestDask::test_save_mfdataset_invalid", "xarray/tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_multiindex_not_implemented", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_groupby_first", "xarray/tests/test_backends.py::TestH5NetCDFData::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_simultaneous_compute", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::test_dask_kwargs_dataarray[load]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-gregorian]", "xarray/tests/test_backends.py::TestScipyInMemoryData::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-366_day]", "xarray/tests/test_coding_times.py::test_cf_timedelta[NaT-days-nan]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-proleptic_gregorian]", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_2D", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_not_daskarray", "xarray/tests/test_backends.py::TestH5NetCDFData::test_read_byte_attrs_as_unicode", "xarray/tests/test_backends.py::TestNetCDF4Data::test_mask_and_scale", "xarray/tests/test_coding_times.py::test_cf_datetime_nan[num_dates0-days since 2000-01-01-expected_list0]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_dataset_caching", "xarray/tests/test_dask.py::TestVariable::test_unary_op", "xarray/tests/test_coding_times.py::test_decode_cf[gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates30-days since 2000-01-01-gregorian]", "xarray/tests/test_dask.py::TestVariable::test_roll", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates35-days since 2000-01-01-standard]", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates2-days since 1900-01-01 00:00:00]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-noleap]", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_encodings", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates17-hour since 1680-01-01 00:00:00-standard]", "xarray/tests/test_backends.py::TestNetCDF4Data::test_already_open_dataset_group", "xarray/tests/test_backends.py::TestScipyFilePath::test_array_attrs", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates9-days since 2000-01-01-gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates33-days since 2000-01-01-gregorian]", "xarray/tests/test_coding_times.py::test_cf_timedelta[1ms-milliseconds-numbers3]", "xarray/tests/test_backends.py::TestCfGrib::test_read_filter_by_keys", "xarray/tests/test_backends.py::TestDask::test_pickle_dataarray", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_from_dask_variable", "xarray/tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::test_dask_layers_and_dependencies", "xarray/tests/test_coding_times.py::test_infer_timedelta_units[deltas2-minutes]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-365_day]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_float64_data", "xarray/tests/test_backends.py::TestGenericNetCDFData::test_multiindex_not_implemented", "xarray/tests/test_backends.py::TestZarrDirectoryStore::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_dim_order", "xarray/tests/test_coding_times.py::test_cf_timedelta[timedeltas8-days-numbers8]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_compute", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates29-daYs since 2000-01-01-standard]", "xarray/tests/test_dask.py::TestVariable::test_copy", "xarray/tests/test_backends.py::TestGenericNetCDFData::test_invalid_dataarray_names_raise", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[2500-gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates36-days since 2000-01-01-gregorian]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_mask_and_scale", "xarray/tests/test_dask.py::test_dask_kwargs_dataset[load]", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-365_day]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates2-days since 2000-01-01-standard]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates37-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_dask.py::test_persist_Dataset[<lambda>0]", "xarray/tests/test_backends.py::TestDask::test_dataarray_compute", "xarray/tests/test_backends.py::TestH5NetCDFData::test_open_encodings", "xarray/tests/test_coding_times.py::test_cf_datetime[0-milliseconds since 2000-01-01T00:00:00-standard]", "xarray/tests/test_backends.py::TestZarrDictStore::test_invalid_dataarray_names_raise", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-366_day]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_already_open_dataset", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_multiindex_not_implemented", "xarray/tests/test_backends.py::TestScipyFilePath::test_nc4_scipy", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates32-days since 2000-01-01-standard]", "xarray/tests/test_dask.py::TestVariable::test_pickle", "xarray/tests/test_backends.py::TestH5NetCDFData::test_multiindex_not_implemented", "xarray/tests/test_dask.py::test_dask_kwargs_dataarray[persist]", "xarray/tests/test_dask.py::test_raise_if_dask_computes", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_open_subgroup", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_multiindex_not_implemented", "xarray/tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_multiindex_not_implemented", "xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_group", "xarray/tests/test_dask.py::TestVariable::test_transpose", "xarray/tests/test_backends.py::test_invalid_netcdf_raises[scipy]", "xarray/tests/test_dask.py::TestVariable::test_shift", "xarray/tests/test_coding_times.py::test_cf_timedelta[timedeltas1-days-numbers1]", "xarray/tests/test_coding_times.py::test_decode_cf_datetime_non_standard_units", "xarray/tests/test_dask.py::TestVariable::test_indexing", "xarray/tests/test_coding_times.py::test_cf_datetime[0-microseconds since 2000-01-01T00:00:00-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_contains_cftime_datetimes_non_cftimes_dask[non_cftime_data0]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_reindex", "xarray/tests/test_backends.py::TestScipyFilePath::test_invalid_dataarray_names_raise", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates23- Hour since 1680-01-01 00:00:00 -standard]", "xarray/tests/test_dask.py::test_dask_kwargs_dataset[persist]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_global_coordinates", "xarray/tests/test_backends.py::TestH5NetCDFData::test_mask_and_scale", "xarray/tests/test_backends.py::TestGenericNetCDFData::test_write_store", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-noleap]", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[1500-gregorian]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-366_day]", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_dataset_getattr", "xarray/tests/test_backends.py::TestDask::test_roundtrip_coordinates", "xarray/tests/test_coding_times.py::test_time_units_with_timezone_roundtrip[proleptic_gregorian]", "xarray/tests/test_backends.py::TestDask::test_vectorized_indexing", "xarray/tests/test_backends.py::TestDask::test_dropna", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-noleap]", "xarray/tests/test_coding_times.py::test_cf_datetime[10-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-julian]", "xarray/tests/test_dask.py::TestVariable::test_concat", "xarray/tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_invalid_dataarray_names_raise", "xarray/tests/test_dask.py::test_dask_kwargs_dataarray[compute]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates18-Hour since 1680-01-01 00:00:00-gregorian]", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[1500-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates8-days since 2000-01-01-standard]", "xarray/tests/test_dask.py::test_basic_compute", "xarray/tests/test_dask.py::TestVariable::test_missing_methods", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-all_leap]", "xarray/tests/test_backends.py::TestDask::test_orthogonal_indexing", "xarray/tests/test_backends.py::TestRasterio::test_platecarree", "xarray/tests/test_coding_times.py::test_cf_datetime[0-microseconds since 2000-01-01T00:00:00-standard]", "xarray/tests/test_backends.py::TestScipyFileObject::test_invalid_dataarray_names_raise", "xarray/tests/test_backends.py::TestRasterio::test_rasterio_vrt_with_transform_and_size", "xarray/tests/test_coding_times.py::test_infer_datetime_units[dates0-days since 1900-01-01 00:00:00]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates20-Hour since 1680-01-01 00:00:00-standard]", "xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_unsorted_index_raises", "xarray/tests/test_coding_times.py::test_use_cftime_false_standard_calendar_out_of_range[2500-proleptic_gregorian]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_None_variable", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_values", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates70-hour since 1680-01-01 00:00:00.500000-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-noleap]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_string_encoded_characters", "xarray/tests/test_dask.py::TestVariable::test_missing_values", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates38-days since 2000-01-01-standard]", "xarray/tests/test_backends.py::TestDask::test_roundtrip_numpy_datetime_data", "xarray/tests/test_backends.py::TestRasterio::test_ENVI_tags", "xarray/tests/test_backends.py::TestNetCDF4Data::test_already_open_dataset", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-proleptic_gregorian]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args2-days since 1900-01-01 00:00:00.000000-360_day]", "xarray/tests/test_backends.py::TestZarrDictStore::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates57-hours since 1900-01-01T00:00:00-gregorian]", "xarray/tests/test_backends.py::TestScipyFilePath::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates12-hours since 1680-01-01 00:00:00-gregorian]", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-gregorian]", "xarray/tests/test_dask.py::test_dask_kwargs_variable[load]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates11-days since 2000-01-01-standard]", "xarray/tests/test_coding_times.py::test_time_units_with_timezone_roundtrip[standard]", "xarray/tests/test_backends.py::TestRasterio::test_notransform", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates21- Hour since 1680-01-01 00:00:00 -gregorian]", "xarray/tests/test_coding_times.py::test_format_cftime_datetime[date_args2-0100-02-03 04:05:06.000000]", "xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_coordinates", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates10-days since 2000-01-01-proleptic_gregorian]", "xarray/tests/test_backends.py::TestCfGrib::test_read", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_read_byte_attrs_as_unicode", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-julian]", "xarray/tests/test_backends.py::TestScipyFilePath::test_netcdf3_endianness", "xarray/tests/test_coding_times.py::test_contains_cftime_datetimes_non_cftimes_dask[non_cftime_data1]", "xarray/tests/test_backends.py::TestH5NetCDFViaDaskData::test_open_group", "xarray/tests/test_backends.py::TestRasterio::test_pickle_rasterio", "xarray/tests/test_dask.py::TestDataArrayAndDataset::test_rechunk", "xarray/tests/test_backends.py::TestEncodingInvalid::test_extract_h5nc_encoding", "xarray/tests/test_coding_times.py::test_cf_timedelta[1h-hours-numbers2]", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[2000-360_day]", "xarray/tests/test_coding_times.py::test_use_cftime_false_non_standard_calendar[1500-julian]", "xarray/tests/test_coding_times.py::test_decode_cf[proleptic_gregorian]", "xarray/tests/test_dask.py::TestVariable::test_bivariate_ufunc", "xarray/tests/test_coding_times.py::test_cf_datetime[0-microseconds since 2000-01-01T00:00:00-gregorian]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates68-seconds since 1981-01-01-standard]", "xarray/tests/test_coding_times.py::test_infer_timedelta_units[deltas0-days]", "xarray/tests/test_coding_times.py::test_decode_cf[standard]", "xarray/tests/test_dask.py::test_dataarray_with_dask_coords", "xarray/tests/test_backends.py::TestRasterio::test_no_mftime", "xarray/tests/test_backends.py::TestNetCDF4Data::test_multiindex_not_implemented", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args0-days since 1900-01-01 00:00:00.000000-366_day]", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates5-days since 2000-01-01-standard]", "xarray/tests/test_coding_times.py::test_cf_datetime[0-milliseconds since 2000-01-01T00:00:00-proleptic_gregorian]", "xarray/tests/test_backends.py::TestZarrDictStore::test_encoding_kwarg_fixed_width_string", "xarray/tests/test_backends.py::TestNetCDF4Data::test_0dimensional_variable", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates14-hours since 1680-01-01 00:00:00-standard]", "xarray/tests/test_backends.py::TestH5NetCDFData::test_open_group", "xarray/tests/test_dask.py::TestVariable::test_chunk", "xarray/tests/test_dask.py::TestVariable::test_equals", "xarray/tests/test_coding_times.py::test_infer_cftime_datetime_units[date_args1-seconds since 1900-01-01 00:00:00.000000-365_day]" ]
[ "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>5]", "xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>0-obj1]", "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>1]", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>2]", "xarray/tests/test_dask.py::test_unify_chunks", "xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>1-obj0]", "xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>0-obj0]", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>3]", "xarray/tests/test_dask.py::test_map_blocks_kwargs[obj1]", "xarray/tests/test_dask.py::test_map_blocks_object_method[obj1]", "xarray/tests/test_dask.py::test_map_blocks_add_attrs[obj0]", "xarray/tests/test_dask.py::test_map_blocks[obj0]", "xarray/tests/test_dask.py::test_map_blocks[obj1]", "xarray/tests/test_dask.py::test_map_blocks_convert_args_to_list[obj1]", "xarray/tests/test_dask.py::test_map_blocks_object_method[obj0]", "xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>1-obj1]", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>5]", "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>4]", "xarray/tests/test_dask.py::test_map_blocks_add_attrs[obj1]", "xarray/tests/test_dask.py::test_map_blocks_change_name", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>0]", "xarray/tests/test_dask.py::test_map_blocks_kwargs[obj0]", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>1]", "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>0]", "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>3]", "xarray/tests/test_dask.py::test_map_blocks_convert_args_to_list[obj0]", "xarray/tests/test_dask.py::test_make_meta", "xarray/tests/test_dask.py::test_map_blocks_da_transformations[<lambda>2]", "xarray/tests/test_dask.py::test_map_blocks_error", "xarray/tests/test_dask.py::test_map_blocks_to_array", "xarray/tests/test_dask.py::test_map_blocks_ds_transformations[<lambda>4]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "field", "name": "result" }, { "type": "field", "name": "meta" }, { "type": "field", "name": "parallel" }, { "type": "field", "name": "shape" }, { "type": "field", "name": "_coord_names" }, { "type": "field", "name": "ndim" }, { "type": "field", "name": "ndim" }, { "type": "file", "name": "xarray/core/dask_array_compat.py" }, { "type": "field", "name": "parallel" }, { "type": "field", "name": "core" }, { "type": "field", "name": "parallel" }, { "type": "field", "name": "operator" }, { "type": "field", "name": "meta" }, { "type": "file", "name": "xarray/core/parallel.py" }, { "type": "field", "name": "astype" }, { "type": "function", "name": "make_meta" }, { "type": "field", "name": "make_meta" } ] }
[ { "path": "doc/api.rst", "old_path": "a/doc/api.rst", "new_path": "b/doc/api.rst", "metadata": "diff --git a/doc/api.rst b/doc/api.rst\nindex 256a1dbf3af..40f9add3c57 100644\n--- a/doc/api.rst\n+++ b/doc/api.rst\n@@ -30,6 +30,7 @@ Top-level functions\n zeros_like\n ones_like\n dot\n+ map_blocks\n \n Dataset\n =======\n@@ -499,6 +500,8 @@ Dataset methods\n Dataset.persist\n Dataset.load\n Dataset.chunk\n+ Dataset.unify_chunks\n+ Dataset.map_blocks\n Dataset.filter_by_attrs\n Dataset.info\n \n@@ -529,6 +532,8 @@ DataArray methods\n DataArray.persist\n DataArray.load\n DataArray.chunk\n+ DataArray.unify_chunks\n+ DataArray.map_blocks\n \n GroupBy objects\n ===============\n@@ -629,6 +634,7 @@ Testing\n testing.assert_equal\n testing.assert_identical\n testing.assert_allclose\n+ testing.assert_chunks_equal\n \n Exceptions\n ==========\n" }, { "path": "doc/whats-new.rst", "old_path": "a/doc/whats-new.rst", "new_path": "b/doc/whats-new.rst", "metadata": "diff --git a/doc/whats-new.rst b/doc/whats-new.rst\nindex 520f1f79870..b6e12f01f4b 100644\n--- a/doc/whats-new.rst\n+++ b/doc/whats-new.rst\n@@ -49,6 +49,11 @@ Breaking changes\n New functions/methods\n ~~~~~~~~~~~~~~~~~~~~~\n \n+- Added :py:func:`~xarray.map_blocks`, modeled after :py:func:`dask.array.map_blocks`.\n+ Also added :py:meth:`Dataset.unify_chunks`, :py:meth:`DataArray.unify_chunks` and\n+ :py:meth:`testing.assert_chunks_equal`. By `<NAME>`_\n+ and <NAME>_.\n+\n Enhancements\n ~~~~~~~~~~~~\n \n" } ]
diff --git a/doc/api.rst b/doc/api.rst index 256a1dbf3af..40f9add3c57 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -30,6 +30,7 @@ Top-level functions zeros_like ones_like dot + map_blocks Dataset ======= @@ -499,6 +500,8 @@ Dataset methods Dataset.persist Dataset.load Dataset.chunk + Dataset.unify_chunks + Dataset.map_blocks Dataset.filter_by_attrs Dataset.info @@ -529,6 +532,8 @@ DataArray methods DataArray.persist DataArray.load DataArray.chunk + DataArray.unify_chunks + DataArray.map_blocks GroupBy objects =============== @@ -629,6 +634,7 @@ Testing testing.assert_equal testing.assert_identical testing.assert_allclose + testing.assert_chunks_equal Exceptions ========== diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 520f1f79870..b6e12f01f4b 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -49,6 +49,11 @@ Breaking changes New functions/methods ~~~~~~~~~~~~~~~~~~~~~ +- Added :py:func:`~xarray.map_blocks`, modeled after :py:func:`dask.array.map_blocks`. + Also added :py:meth:`Dataset.unify_chunks`, :py:meth:`DataArray.unify_chunks` and + :py:meth:`testing.assert_chunks_equal`. By `<NAME>`_ + and <NAME>_. + Enhancements ~~~~~~~~~~~~ If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'field', 'name': 'result'}, {'type': 'field', 'name': 'meta'}, {'type': 'field', 'name': 'parallel'}, {'type': 'field', 'name': 'shape'}, {'type': 'field', 'name': '_coord_names'}, {'type': 'field', 'name': 'ndim'}, {'type': 'field', 'name': 'ndim'}, {'type': 'file', 'name': 'xarray/core/dask_array_compat.py'}, {'type': 'field', 'name': 'parallel'}, {'type': 'field', 'name': 'core'}, {'type': 'field', 'name': 'parallel'}, {'type': 'field', 'name': 'operator'}, {'type': 'field', 'name': 'meta'}, {'type': 'file', 'name': 'xarray/core/parallel.py'}, {'type': 'field', 'name': 'astype'}, {'type': 'function', 'name': 'make_meta'}, {'type': 'field', 'name': 'make_meta'}]
matplotlib/matplotlib
matplotlib__matplotlib-25904
https://github.com/matplotlib/matplotlib/pull/25904
diff --git a/doc/users/next_whats_new/spinesproxyset.rst b/doc/users/next_whats_new/spinesproxyset.rst new file mode 100644 index 000000000000..cfd8d2908ec7 --- /dev/null +++ b/doc/users/next_whats_new/spinesproxyset.rst @@ -0,0 +1,3 @@ +``SpinesProxy`` now supports calling the ``set()`` method +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +One can now call e.g. ``ax.spines[:].set(visible=False)``. diff --git a/lib/matplotlib/spines.py b/lib/matplotlib/spines.py index 8560f7b6e4e2..eacb3e7e9d5c 100644 --- a/lib/matplotlib/spines.py +++ b/lib/matplotlib/spines.py @@ -479,7 +479,7 @@ def set_color(self, c): class SpinesProxy: """ - A proxy to broadcast ``set_*`` method calls to all contained `.Spines`. + A proxy to broadcast ``set_*()`` and ``set()`` method calls to contained `.Spines`. The proxy cannot be used for any other operations on its members. @@ -493,7 +493,7 @@ def __init__(self, spine_dict): def __getattr__(self, name): broadcast_targets = [spine for spine in self._spine_dict.values() if hasattr(spine, name)] - if not name.startswith('set_') or not broadcast_targets: + if (name != 'set' and not name.startswith('set_')) or not broadcast_targets: raise AttributeError( f"'SpinesProxy' object has no attribute '{name}'") @@ -531,8 +531,8 @@ class Spines(MutableMapping): spines[:].set_visible(False) - The latter two indexing methods will return a `SpinesProxy` that broadcasts - all ``set_*`` calls to its members, but cannot be used for any other + The latter two indexing methods will return a `SpinesProxy` that broadcasts all + ``set_*()`` and ``set()`` calls to its members, but cannot be used for any other operation. """ def __init__(self, **kwargs):
diff --git a/lib/matplotlib/tests/test_spines.py b/lib/matplotlib/tests/test_spines.py index 89bc0c872de5..9ce16fb39227 100644 --- a/lib/matplotlib/tests/test_spines.py +++ b/lib/matplotlib/tests/test_spines.py @@ -12,6 +12,9 @@ class SpineMock: def __init__(self): self.val = None + def set(self, **kwargs): + vars(self).update(kwargs) + def set_val(self, val): self.val = val @@ -35,6 +38,9 @@ def set_val(self, val): spines[:].set_val('y') assert all(spine.val == 'y' for spine in spines.values()) + spines[:].set(foo='bar') + assert all(spine.foo == 'bar' for spine in spines.values()) + with pytest.raises(AttributeError, match='foo'): spines.foo with pytest.raises(KeyError, match='foo'):
[ { "path": "doc/users/next_whats_new/spinesproxyset.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/spinesproxyset.rst", "metadata": "diff --git a/doc/users/next_whats_new/spinesproxyset.rst b/doc/users/next_whats_new/spinesproxyset.rst\nnew file mode 100644\nindex 000000000000..cfd8d2908ec7\n--- /dev/null\n+++ b/doc/users/next_whats_new/spinesproxyset.rst\n@@ -0,0 +1,3 @@\n+``SpinesProxy`` now supports calling the ``set()`` method\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+One can now call e.g. ``ax.spines[:].set(visible=False)``.\n" } ]
3.7
2466ccb77a92fe57e045ac0c0b56d61ce563abf9
[ "lib/matplotlib/tests/test_spines.py::test_spines_black_axes[svg]", "lib/matplotlib/tests/test_spines.py::test_spines_axes_positions[svg]", "lib/matplotlib/tests/test_spines.py::test_spine_nonlinear_data_positions[png]", "lib/matplotlib/tests/test_spines.py::test_spines_data_positions[png]", "lib/matplotlib/tests/test_spines.py::test_spines_capstyle[png]", "lib/matplotlib/tests/test_spines.py::test_spines_axes_positions[png]", "lib/matplotlib/tests/test_spines.py::test_spines_capstyle[svg]", "lib/matplotlib/tests/test_spines.py::test_spines_axes_positions[pdf]", "lib/matplotlib/tests/test_spines.py::test_spines_data_positions[svg]", "lib/matplotlib/tests/test_spines.py::test_spines_data_positions[pdf]", "lib/matplotlib/tests/test_spines.py::test_spines_black_axes[pdf]", "lib/matplotlib/tests/test_spines.py::test_spines_black_axes[png]", "lib/matplotlib/tests/test_spines.py::test_spines_capstyle[pdf]", "lib/matplotlib/tests/test_spines.py::test_label_without_ticks" ]
[ "lib/matplotlib/tests/test_spines.py::test_spine_class" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/spinesproxyset.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/spinesproxyset.rst", "metadata": "diff --git a/doc/users/next_whats_new/spinesproxyset.rst b/doc/users/next_whats_new/spinesproxyset.rst\nnew file mode 100644\nindex 000000000000..cfd8d2908ec7\n--- /dev/null\n+++ b/doc/users/next_whats_new/spinesproxyset.rst\n@@ -0,0 +1,3 @@\n+``SpinesProxy`` now supports calling the ``set()`` method\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+One can now call e.g. ``ax.spines[:].set(visible=False)``.\n" } ]
diff --git a/doc/users/next_whats_new/spinesproxyset.rst b/doc/users/next_whats_new/spinesproxyset.rst new file mode 100644 index 000000000000..cfd8d2908ec7 --- /dev/null +++ b/doc/users/next_whats_new/spinesproxyset.rst @@ -0,0 +1,3 @@ +``SpinesProxy`` now supports calling the ``set()`` method +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +One can now call e.g. ``ax.spines[:].set(visible=False)``.
matplotlib/matplotlib
matplotlib__matplotlib-26278
https://github.com/matplotlib/matplotlib/pull/26278
diff --git a/doc/users/next_whats_new/contour_clip_path.rst b/doc/users/next_whats_new/contour_clip_path.rst new file mode 100644 index 000000000000..db4039a4fd70 --- /dev/null +++ b/doc/users/next_whats_new/contour_clip_path.rst @@ -0,0 +1,24 @@ +Clipping for contour plots +-------------------------- + +`~.Axes.contour` and `~.Axes.contourf` now accept the *clip_path* parameter. + +.. plot:: + :include-source: true + + import numpy as np + import matplotlib.pyplot as plt + import matplotlib.patches as mpatches + + x = y = np.arange(-3.0, 3.01, 0.025) + X, Y = np.meshgrid(x, y) + Z1 = np.exp(-X**2 - Y**2) + Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2) + Z = (Z1 - Z2) * 2 + + fig, ax = plt.subplots() + patch = mpatches.RegularPolygon((0, 0), 5, radius=2, + transform=ax.transData) + ax.contourf(X, Y, Z, clip_path=patch) + + plt.show() diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 625c3524bfcb..6f97c5646ab0 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -751,7 +751,7 @@ def __init__(self, ax, *args, hatches=(None,), alpha=None, origin=None, extent=None, cmap=None, colors=None, norm=None, vmin=None, vmax=None, extend='neither', antialiased=None, nchunk=0, locator=None, - transform=None, negative_linestyles=None, + transform=None, negative_linestyles=None, clip_path=None, **kwargs): """ Draw contour lines or filled regions, depending on @@ -805,6 +805,7 @@ def __init__(self, ax, *args, super().__init__( antialiaseds=antialiased, alpha=alpha, + clip_path=clip_path, transform=transform, ) self.axes = ax @@ -1870,6 +1871,11 @@ def _initialize_x_y(self, z): The default is taken from :rc:`contour.algorithm`. +clip_path : `~matplotlib.patches.Patch` or `.Path` or `.TransformedPath` + Set the clip path. See `~matplotlib.artist.Artist.set_clip_path`. + + .. versionadded:: 3.8 + data : indexable object, optional DATA_PARAMETER_PLACEHOLDER diff --git a/lib/matplotlib/contour.pyi b/lib/matplotlib/contour.pyi index c2190577169d..c7179637a1e1 100644 --- a/lib/matplotlib/contour.pyi +++ b/lib/matplotlib/contour.pyi @@ -4,8 +4,10 @@ from matplotlib.axes import Axes from matplotlib.collections import Collection, PathCollection from matplotlib.colors import Colormap, Normalize from matplotlib.font_manager import FontProperties +from matplotlib.path import Path +from matplotlib.patches import Patch from matplotlib.text import Text -from matplotlib.transforms import Transform +from matplotlib.transforms import Transform, TransformedPatchPath, TransformedPath from matplotlib.ticker import Locator, Formatter from numpy.typing import ArrayLike @@ -99,6 +101,7 @@ class ContourSet(ContourLabeler, Collection): negative_linestyles: None | Literal[ "solid", "dashed", "dashdot", "dotted" ] | Iterable[Literal["solid", "dashed", "dashdot", "dotted"]] + clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None labelTexts: list[Text] labelCValues: list[ColorType] allkinds: list[np.ndarray] @@ -145,6 +148,7 @@ class ContourSet(ContourLabeler, Collection): negative_linestyles: Literal["solid", "dashed", "dashdot", "dotted"] | Iterable[Literal["solid", "dashed", "dashdot", "dotted"]] | None = ..., + clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None = ..., **kwargs ) -> None: ... def legend_elements(
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py index c730c8ea332d..7a4c4570580c 100644 --- a/lib/matplotlib/tests/test_contour.py +++ b/lib/matplotlib/tests/test_contour.py @@ -9,6 +9,7 @@ import matplotlib as mpl from matplotlib import pyplot as plt, rc_context, ticker from matplotlib.colors import LogNorm, same_color +import matplotlib.patches as mpatches from matplotlib.testing.decorators import image_comparison import pytest @@ -752,6 +753,14 @@ def test_contour_no_args(): ax.contour(Z=data) +def test_contour_clip_path(): + fig, ax = plt.subplots() + data = [[0, 1], [1, 0]] + circle = mpatches.Circle([0.5, 0.5], 0.5, transform=ax.transAxes) + cs = ax.contour(data, clip_path=circle) + assert cs.get_clip_path() is not None + + def test_bool_autolevel(): x, y = np.random.rand(2, 9) z = (np.arange(9) % 2).reshape((3, 3)).astype(bool)
[ { "path": "doc/users/next_whats_new/contour_clip_path.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/contour_clip_path.rst", "metadata": "diff --git a/doc/users/next_whats_new/contour_clip_path.rst b/doc/users/next_whats_new/contour_clip_path.rst\nnew file mode 100644\nindex 000000000000..db4039a4fd70\n--- /dev/null\n+++ b/doc/users/next_whats_new/contour_clip_path.rst\n@@ -0,0 +1,24 @@\n+Clipping for contour plots\n+--------------------------\n+\n+`~.Axes.contour` and `~.Axes.contourf` now accept the *clip_path* parameter.\n+\n+.. plot::\n+ :include-source: true\n+\n+ import numpy as np\n+ import matplotlib.pyplot as plt\n+ import matplotlib.patches as mpatches\n+\n+ x = y = np.arange(-3.0, 3.01, 0.025)\n+ X, Y = np.meshgrid(x, y)\n+ Z1 = np.exp(-X**2 - Y**2)\n+ Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)\n+ Z = (Z1 - Z2) * 2\n+\n+ fig, ax = plt.subplots()\n+ patch = mpatches.RegularPolygon((0, 0), 5, radius=2,\n+ transform=ax.transData)\n+ ax.contourf(X, Y, Z, clip_path=patch)\n+\n+ plt.show()\n" } ]
3.7
02d2e137251ebcbd698b6f1ff8c455a1e52082af
[ "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args9-Input z must be at least a (2, 2) shaped array, but has shape (1, 1)]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[svg-False]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args5-Shapes of y (9, 9) and z (9, 10) do not match]", "lib/matplotlib/tests/test_contour.py::test_contourf_log_extension[png-True]", "lib/matplotlib/tests/test_contour.py::test_negative_linestyles[dashdot]", "lib/matplotlib/tests/test_contour.py::test_contourf_decreasing_levels", "lib/matplotlib/tests/test_contour.py::test_algorithm_supports_corner_mask[serial]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length of y (10) must match number of rows in z (9)]", "lib/matplotlib/tests/test_contour.py::test_all_nan", "lib/matplotlib/tests/test_contour.py::test_corner_mask[png-False]", "lib/matplotlib/tests/test_contour.py::test_contourf_legend_elements", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[serial-SerialContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args6-Inputs x and y must be 1D or 2D, not 3D]", "lib/matplotlib/tests/test_contour.py::test_contour_datetime_axis[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_datetime_axis[png-False]", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[invalid-None]", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[svg-True]", "lib/matplotlib/tests/test_contour.py::test_algorithm_supports_corner_mask[mpl2005]", "lib/matplotlib/tests/test_contour.py::test_bool_autolevel", "lib/matplotlib/tests/test_contour.py::test_quadcontourset_reuse", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args4-Shapes of x (9, 9) and z (9, 10) do not match]", "lib/matplotlib/tests/test_contour.py::test_contour_Nlevels", "lib/matplotlib/tests/test_contour.py::test_contour_addlines[png-True]", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[mpl2005-Mpl2005ContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_circular_contour_warning", "lib/matplotlib/tests/test_contour.py::test_labels[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[png-True]", "lib/matplotlib/tests/test_contour.py::test_find_nearest_contour", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args2-Number of dimensions of x (2) and y (1) do not match]", "lib/matplotlib/tests/test_contour.py::test_contour_manual[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_autolabel_beyond_powerlimits", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[mpl2014-Mpl2014ContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_contour_uneven[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args3-Number of dimensions of x (1) and y (2) do not match]", "lib/matplotlib/tests/test_contour.py::test_contourf_log_extension[png-False]", "lib/matplotlib/tests/test_contour.py::test_contour_line_start_on_corner_edge[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_manual[png-False]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args8-Input z must be at least a (2, 2) shaped array, but has shape (1, 1)]", "lib/matplotlib/tests/test_contour.py::test_contourf_symmetric_locator", "lib/matplotlib/tests/test_contour.py::test_clabel_zorder[False-123-None]", "lib/matplotlib/tests/test_contour.py::test_contour_linewidth[1.23-4.24-None-4.24]", "lib/matplotlib/tests/test_contour.py::test_log_locator_levels[svg-False]", "lib/matplotlib/tests/test_contour.py::test_corner_mask[png-True]", "lib/matplotlib/tests/test_contour.py::test_find_nearest_contour_no_filled", "lib/matplotlib/tests/test_contour.py::test_subfigure_clabel", "lib/matplotlib/tests/test_contour.py::test_all_algorithms[png-False]", "lib/matplotlib/tests/test_contour.py::test_contour_closed_line_loop[png-True]", "lib/matplotlib/tests/test_contour.py::test_labels[png-False]", "lib/matplotlib/tests/test_contour.py::test_linestyles[dotted]", "lib/matplotlib/tests/test_contour.py::test_contour_line_start_on_corner_edge[png-False]", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[threaded-ThreadedContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[pdf-False]", "lib/matplotlib/tests/test_contour.py::test_negative_linestyles[dotted]", "lib/matplotlib/tests/test_contour.py::test_contour_remove", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[png-False]", "lib/matplotlib/tests/test_contour.py::test_negative_linestyles[solid]", "lib/matplotlib/tests/test_contour.py::test_contour_legend_elements", "lib/matplotlib/tests/test_contour.py::test_contour_linewidth[1.23-None-None-1.23]", "lib/matplotlib/tests/test_contour.py::test_linestyles[solid]", "lib/matplotlib/tests/test_contour.py::test_contour_no_args", "lib/matplotlib/tests/test_contour.py::test_clabel_zorder[False-123-1234]", "lib/matplotlib/tests/test_contour.py::test_algorithm_supports_corner_mask[mpl2014]", "lib/matplotlib/tests/test_contour.py::test_contour_manual_labels[pdf-True]", "lib/matplotlib/tests/test_contour.py::test_given_colors_levels_and_extends[png-False]", "lib/matplotlib/tests/test_contour.py::test_contour_closed_line_loop[png-False]", "lib/matplotlib/tests/test_contour.py::test_linestyles[dashed]", "lib/matplotlib/tests/test_contour.py::test_contour_uneven[png-False]", "lib/matplotlib/tests/test_contour.py::test_clabel_zorder[True-123-None]", "lib/matplotlib/tests/test_contour.py::test_algorithm_supports_corner_mask[threaded]", "lib/matplotlib/tests/test_contour.py::test_given_colors_levels_and_extends[png-True]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length of x (9) must match number of columns in z (10)]", "lib/matplotlib/tests/test_contour.py::test_linestyles[dashdot]", "lib/matplotlib/tests/test_contour.py::test_all_algorithms[png-True]", "lib/matplotlib/tests/test_contour.py::test_log_locator_levels[svg-True]", "lib/matplotlib/tests/test_contour.py::test_negative_linestyles[dashed]", "lib/matplotlib/tests/test_contour.py::test_contour_addlines[png-False]", "lib/matplotlib/tests/test_contour.py::test_clabel_zorder[True-123-1234]", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args7-Input z must be 2D, not 3D]", "lib/matplotlib/tests/test_contour.py::test_contour_no_valid_levels", "lib/matplotlib/tests/test_contour.py::test_label_nonagg", "lib/matplotlib/tests/test_contour.py::test_contour_linewidth[1.23-4.24-5.02-5.02]" ]
[ "lib/matplotlib/tests/test_contour.py::test_contour_clip_path" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/contour_clip_path.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/contour_clip_path.rst", "metadata": "diff --git a/doc/users/next_whats_new/contour_clip_path.rst b/doc/users/next_whats_new/contour_clip_path.rst\nnew file mode 100644\nindex 000000000000..db4039a4fd70\n--- /dev/null\n+++ b/doc/users/next_whats_new/contour_clip_path.rst\n@@ -0,0 +1,24 @@\n+Clipping for contour plots\n+--------------------------\n+\n+`~.Axes.contour` and `~.Axes.contourf` now accept the *clip_path* parameter.\n+\n+.. plot::\n+ :include-source: true\n+\n+ import numpy as np\n+ import matplotlib.pyplot as plt\n+ import matplotlib.patches as mpatches\n+\n+ x = y = np.arange(-3.0, 3.01, 0.025)\n+ X, Y = np.meshgrid(x, y)\n+ Z1 = np.exp(-X**2 - Y**2)\n+ Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)\n+ Z = (Z1 - Z2) * 2\n+\n+ fig, ax = plt.subplots()\n+ patch = mpatches.RegularPolygon((0, 0), 5, radius=2,\n+ transform=ax.transData)\n+ ax.contourf(X, Y, Z, clip_path=patch)\n+\n+ plt.show()\n" } ]
diff --git a/doc/users/next_whats_new/contour_clip_path.rst b/doc/users/next_whats_new/contour_clip_path.rst new file mode 100644 index 000000000000..db4039a4fd70 --- /dev/null +++ b/doc/users/next_whats_new/contour_clip_path.rst @@ -0,0 +1,24 @@ +Clipping for contour plots +-------------------------- + +`~.Axes.contour` and `~.Axes.contourf` now accept the *clip_path* parameter. + +.. plot:: + :include-source: true + + import numpy as np + import matplotlib.pyplot as plt + import matplotlib.patches as mpatches + + x = y = np.arange(-3.0, 3.01, 0.025) + X, Y = np.meshgrid(x, y) + Z1 = np.exp(-X**2 - Y**2) + Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2) + Z = (Z1 - Z2) * 2 + + fig, ax = plt.subplots() + patch = mpatches.RegularPolygon((0, 0), 5, radius=2, + transform=ax.transData) + ax.contourf(X, Y, Z, clip_path=patch) + + plt.show()
matplotlib/matplotlib
matplotlib__matplotlib-24257
https://github.com/matplotlib/matplotlib/pull/24257
diff --git a/doc/api/next_api_changes/development/24257-AL.rst b/doc/api/next_api_changes/development/24257-AL.rst new file mode 100644 index 000000000000..584420df8fd7 --- /dev/null +++ b/doc/api/next_api_changes/development/24257-AL.rst @@ -0,0 +1,2 @@ +importlib_resources>=2.3.0 is now required on Python<3.10 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/devel/dependencies.rst b/doc/devel/dependencies.rst index fb76857898a4..365c062364e2 100644 --- a/doc/devel/dependencies.rst +++ b/doc/devel/dependencies.rst @@ -26,6 +26,9 @@ reference. * `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2) * `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1) * `setuptools <https://setuptools.readthedocs.io/en/latest/>`_ +* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1) +* `importlib-resources <https://pypi.org/project/importlib-resources/>`_ + (>= 3.2.0; only required on Python < 3.10) .. _optional_dependencies: diff --git a/doc/users/next_whats_new/styles_from_packages.rst b/doc/users/next_whats_new/styles_from_packages.rst new file mode 100644 index 000000000000..d129bb356fa7 --- /dev/null +++ b/doc/users/next_whats_new/styles_from_packages.rst @@ -0,0 +1,11 @@ +Style files can be imported from third-party packages +----------------------------------------------------- + +Third-party packages can now distribute style files that are globally available +as follows. Assume that a package is importable as ``import mypackage``, with +a ``mypackage/__init__.py`` module. Then a ``mypackage/presentation.mplstyle`` +style sheet can be used as ``plt.style.use("mypackage.presentation")``. + +The implementation does not actually import ``mypackage``, making this process +safe against possible import-time side effects. Subpackages (e.g. +``dotted.package.name``) are also supported. diff --git a/environment.yml b/environment.yml index 28ff3a1b2c34..c9b7aa610720 100644 --- a/environment.yml +++ b/environment.yml @@ -12,6 +12,7 @@ dependencies: - contourpy>=1.0.1 - cycler>=0.10.0 - fonttools>=4.22.0 + - importlib-resources>=3.2.0 - kiwisolver>=1.0.1 - numpy>=1.19 - pillow>=6.2 diff --git a/lib/matplotlib/style/core.py b/lib/matplotlib/style/core.py index 646b39dcc5df..ed5cd4f63bc5 100644 --- a/lib/matplotlib/style/core.py +++ b/lib/matplotlib/style/core.py @@ -15,10 +15,18 @@ import logging import os from pathlib import Path +import sys import warnings +if sys.version_info >= (3, 10): + import importlib.resources as importlib_resources +else: + # Even though Py3.9 has importlib.resources, it doesn't properly handle + # modules added in sys.path. + import importlib_resources + import matplotlib as mpl -from matplotlib import _api, _docstring, rc_params_from_file, rcParamsDefault +from matplotlib import _api, _docstring, _rc_params_in_file, rcParamsDefault _log = logging.getLogger(__name__) @@ -64,23 +72,6 @@ "directly use the seaborn API instead.") -def _remove_blacklisted_style_params(d, warn=True): - o = {} - for key in d: # prevent triggering RcParams.__getitem__('backend') - if key in STYLE_BLACKLIST: - if warn: - _api.warn_external( - f"Style includes a parameter, {key!r}, that is not " - "related to style. Ignoring this parameter.") - else: - o[key] = d[key] - return o - - -def _apply_style(d, warn=True): - mpl.rcParams.update(_remove_blacklisted_style_params(d, warn=warn)) - - @_docstring.Substitution( "\n".join(map("- {}".format, sorted(STYLE_BLACKLIST, key=str.lower))) ) @@ -99,20 +90,28 @@ def use(style): Parameters ---------- style : str, dict, Path or list - A style specification. Valid options are: - +------+-------------------------------------------------------------+ - | str | The name of a style or a path/URL to a style file. For a | - | | list of available style names, see `.style.available`. | - +------+-------------------------------------------------------------+ - | dict | Dictionary with valid key/value pairs for | - | | `matplotlib.rcParams`. | - +------+-------------------------------------------------------------+ - | Path | A path-like object which is a path to a style file. | - +------+-------------------------------------------------------------+ - | list | A list of style specifiers (str, Path or dict) applied from | - | | first to last in the list. | - +------+-------------------------------------------------------------+ + A style specification. + + - If a str, this can be one of the style names in `.style.available` + (a builtin style or a style installed in the user library path). + + This can also be a dotted name of the form "package.style_name"; in + that case, "package" should be an importable Python package name, + e.g. at ``/path/to/package/__init__.py``; the loaded style file is + ``/path/to/package/style_name.mplstyle``. (Style files in + subpackages are likewise supported.) + + This can also be the path or URL to a style file, which gets loaded + by `.rc_params_from_file`. + + - If a dict, this is a mapping of key/value pairs for `.rcParams`. + + - If a Path, this is the path to a style file, which gets loaded by + `.rc_params_from_file`. + + - If a list, this is a list of style specifiers (str, Path or dict), + which get applied from first to last in the list. Notes ----- @@ -129,33 +128,52 @@ def use(style): style_alias = {'mpl20': 'default', 'mpl15': 'classic'} - def fix_style(s): - if isinstance(s, str): - s = style_alias.get(s, s) - if s in _DEPRECATED_SEABORN_STYLES: + for style in styles: + if isinstance(style, str): + style = style_alias.get(style, style) + if style in _DEPRECATED_SEABORN_STYLES: _api.warn_deprecated("3.6", message=_DEPRECATED_SEABORN_MSG) - s = _DEPRECATED_SEABORN_STYLES[s] - return s - - for style in map(fix_style, styles): - if not isinstance(style, (str, Path)): - _apply_style(style) - elif style == 'default': - # Deprecation warnings were already handled when creating - # rcParamsDefault, no need to reemit them here. - with _api.suppress_matplotlib_deprecation_warning(): - _apply_style(rcParamsDefault, warn=False) - elif style in library: - _apply_style(library[style]) - else: + style = _DEPRECATED_SEABORN_STYLES[style] + if style == "default": + # Deprecation warnings were already handled when creating + # rcParamsDefault, no need to reemit them here. + with _api.suppress_matplotlib_deprecation_warning(): + # don't trigger RcParams.__getitem__('backend') + style = {k: rcParamsDefault[k] for k in rcParamsDefault + if k not in STYLE_BLACKLIST} + elif style in library: + style = library[style] + elif "." in style: + pkg, _, name = style.rpartition(".") + try: + path = (importlib_resources.files(pkg) + / f"{name}.{STYLE_EXTENSION}") + style = _rc_params_in_file(path) + except (ModuleNotFoundError, IOError) as exc: + # There is an ambiguity whether a dotted name refers to a + # package.style_name or to a dotted file path. Currently, + # we silently try the first form and then the second one; + # in the future, we may consider forcing file paths to + # either use Path objects or be prepended with "./" and use + # the slash as marker for file paths. + pass + if isinstance(style, (str, Path)): try: - rc = rc_params_from_file(style, use_default_template=False) - _apply_style(rc) + style = _rc_params_in_file(style) except IOError as err: raise IOError( - "{!r} not found in the style library and input is not a " - "valid URL or path; see `style.available` for list of " - "available styles".format(style)) from err + f"{style!r} is not a valid package style, path of style " + f"file, URL of style file, or library style name (library " + f"styles are listed in `style.available`)") from err + filtered = {} + for k in style: # don't trigger RcParams.__getitem__('backend') + if k in STYLE_BLACKLIST: + _api.warn_external( + f"Style includes a parameter, {k!r}, that is not " + f"related to style. Ignoring this parameter.") + else: + filtered[k] = style[k] + mpl.rcParams.update(filtered) @contextlib.contextmanager @@ -205,8 +223,7 @@ def read_style_directory(style_dir): styles = dict() for path in Path(style_dir).glob(f"*.{STYLE_EXTENSION}"): with warnings.catch_warnings(record=True) as warns: - styles[path.stem] = rc_params_from_file( - path, use_default_template=False) + styles[path.stem] = _rc_params_in_file(path) for w in warns: _log.warning('In %s: %s', path, w.message) return styles diff --git a/setup.py b/setup.py index 365de0c0b5a2..2f1fb84f8cc6 100644 --- a/setup.py +++ b/setup.py @@ -334,6 +334,11 @@ def make_release_tree(self, base_dir, files): os.environ.get("CIBUILDWHEEL", "0") != "1" ) else [] ), + extras_require={ + ':python_version<"3.10"': [ + "importlib-resources>=3.2.0", + ], + }, use_scm_version={ "version_scheme": "release-branch-semver", "local_scheme": "node-and-date", diff --git a/tutorials/introductory/customizing.py b/tutorials/introductory/customizing.py index ea6b501e99ea..10fc21d2187b 100644 --- a/tutorials/introductory/customizing.py +++ b/tutorials/introductory/customizing.py @@ -9,9 +9,9 @@ There are three ways to customize Matplotlib: - 1. :ref:`Setting rcParams at runtime<customizing-with-dynamic-rc-settings>`. - 2. :ref:`Using style sheets<customizing-with-style-sheets>`. - 3. :ref:`Changing your matplotlibrc file<customizing-with-matplotlibrc-files>`. +1. :ref:`Setting rcParams at runtime<customizing-with-dynamic-rc-settings>`. +2. :ref:`Using style sheets<customizing-with-style-sheets>`. +3. :ref:`Changing your matplotlibrc file<customizing-with-matplotlibrc-files>`. Setting rcParams at runtime takes precedence over style sheets, style sheets take precedence over :file:`matplotlibrc` files. @@ -137,6 +137,17 @@ def plotting_function(): # >>> import matplotlib.pyplot as plt # >>> plt.style.use('./images/presentation.mplstyle') # +# +# Distributing styles +# ------------------- +# +# You can include style sheets into standard importable Python packages (which +# can be e.g. distributed on PyPI). If your package is importable as +# ``import mypackage``, with a ``mypackage/__init__.py`` module, and you add +# a ``mypackage/presentation.mplstyle`` style sheet, then it can be used as +# ``plt.style.use("mypackage.presentation")``. Subpackages (e.g. +# ``dotted.package.name``) are also supported. +# # Alternatively, you can make your style known to Matplotlib by placing # your ``<style-name>.mplstyle`` file into ``mpl_configdir/stylelib``. You # can then load your custom style sheet with a call to
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 020f09df4010..eddb14be0bc6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -162,8 +162,8 @@ jobs: # Install dependencies from PyPI. python -m pip install --upgrade $PRE \ - 'contourpy>=1.0.1' cycler fonttools kiwisolver numpy packaging \ - pillow pyparsing python-dateutil setuptools-scm \ + 'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \ + numpy packaging pillow pyparsing python-dateutil setuptools-scm \ -r requirements/testing/all.txt \ ${{ matrix.extra-requirements }} diff --git a/lib/matplotlib/tests/test_style.py b/lib/matplotlib/tests/test_style.py index c788c45920ae..7d1ed94ea236 100644 --- a/lib/matplotlib/tests/test_style.py +++ b/lib/matplotlib/tests/test_style.py @@ -190,3 +190,18 @@ def test_deprecated_seaborn_styles(): def test_up_to_date_blacklist(): assert mpl.style.core.STYLE_BLACKLIST <= {*mpl.rcsetup._validators} + + +def test_style_from_module(tmp_path, monkeypatch): + monkeypatch.syspath_prepend(tmp_path) + monkeypatch.chdir(tmp_path) + pkg_path = tmp_path / "mpl_test_style_pkg" + pkg_path.mkdir() + (pkg_path / "test_style.mplstyle").write_text( + "lines.linewidth: 42", encoding="utf-8") + pkg_path.with_suffix(".mplstyle").write_text( + "lines.linewidth: 84", encoding="utf-8") + mpl.style.use("mpl_test_style_pkg.test_style") + assert mpl.rcParams["lines.linewidth"] == 42 + mpl.style.use("mpl_test_style_pkg.mplstyle") + assert mpl.rcParams["lines.linewidth"] == 84 diff --git a/requirements/testing/minver.txt b/requirements/testing/minver.txt index d932b0aa34e7..82301e900f52 100644 --- a/requirements/testing/minver.txt +++ b/requirements/testing/minver.txt @@ -3,6 +3,7 @@ contourpy==1.0.1 cycler==0.10 kiwisolver==1.0.1 +importlib-resources==3.2.0 numpy==1.19.0 packaging==20.0 pillow==6.2.1
[ { "path": "doc/api/next_api_changes/development/24257-AL.rst", "old_path": "/dev/null", "new_path": "b/doc/api/next_api_changes/development/24257-AL.rst", "metadata": "diff --git a/doc/api/next_api_changes/development/24257-AL.rst b/doc/api/next_api_changes/development/24257-AL.rst\nnew file mode 100644\nindex 000000000000..584420df8fd7\n--- /dev/null\n+++ b/doc/api/next_api_changes/development/24257-AL.rst\n@@ -0,0 +1,2 @@\n+importlib_resources>=2.3.0 is now required on Python<3.10\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" }, { "path": "doc/devel/dependencies.rst", "old_path": "a/doc/devel/dependencies.rst", "new_path": "b/doc/devel/dependencies.rst", "metadata": "diff --git a/doc/devel/dependencies.rst b/doc/devel/dependencies.rst\nindex fb76857898a4..365c062364e2 100644\n--- a/doc/devel/dependencies.rst\n+++ b/doc/devel/dependencies.rst\n@@ -26,6 +26,9 @@ reference.\n * `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2)\n * `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)\n * `setuptools <https://setuptools.readthedocs.io/en/latest/>`_\n+* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)\n+* `importlib-resources <https://pypi.org/project/importlib-resources/>`_\n+ (>= 3.2.0; only required on Python < 3.10)\n \n \n .. _optional_dependencies:\n" }, { "path": "doc/users/next_whats_new/styles_from_packages.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/styles_from_packages.rst", "metadata": "diff --git a/doc/users/next_whats_new/styles_from_packages.rst b/doc/users/next_whats_new/styles_from_packages.rst\nnew file mode 100644\nindex 000000000000..d129bb356fa7\n--- /dev/null\n+++ b/doc/users/next_whats_new/styles_from_packages.rst\n@@ -0,0 +1,11 @@\n+Style files can be imported from third-party packages\n+-----------------------------------------------------\n+\n+Third-party packages can now distribute style files that are globally available\n+as follows. Assume that a package is importable as ``import mypackage``, with\n+a ``mypackage/__init__.py`` module. Then a ``mypackage/presentation.mplstyle``\n+style sheet can be used as ``plt.style.use(\"mypackage.presentation\")``.\n+\n+The implementation does not actually import ``mypackage``, making this process\n+safe against possible import-time side effects. Subpackages (e.g.\n+``dotted.package.name``) are also supported.\n" } ]
3.5
aca6e9d5e98811ca37c442217914b15e78127c89
[ "lib/matplotlib/tests/test_style.py::test_use", "lib/matplotlib/tests/test_style.py::test_available", "lib/matplotlib/tests/test_style.py::test_invalid_rc_warning_includes_filename", "lib/matplotlib/tests/test_style.py::test_context_with_union_of_dict_and_namedstyle", "lib/matplotlib/tests/test_style.py::test_context_with_dict_after_namedstyle", "lib/matplotlib/tests/test_style.py::test_xkcd_cm", "lib/matplotlib/tests/test_style.py::test_alias[mpl20]", "lib/matplotlib/tests/test_style.py::test_alias[mpl15]", "lib/matplotlib/tests/test_style.py::test_single_path", "lib/matplotlib/tests/test_style.py::test_context", "lib/matplotlib/tests/test_style.py::test_context_with_dict", "lib/matplotlib/tests/test_style.py::test_use_url", "lib/matplotlib/tests/test_style.py::test_deprecated_seaborn_styles", "lib/matplotlib/tests/test_style.py::test_context_with_dict_before_namedstyle", "lib/matplotlib/tests/test_style.py::test_up_to_date_blacklist", "lib/matplotlib/tests/test_style.py::test_context_with_badparam", "lib/matplotlib/tests/test_style.py::test_xkcd_no_cm" ]
[ "lib/matplotlib/tests/test_style.py::test_style_from_module" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/api/next_api_changes/development/<PRID>-AL.rst", "old_path": "/dev/null", "new_path": "b/doc/api/next_api_changes/development/<PRID>-AL.rst", "metadata": "diff --git a/doc/api/next_api_changes/development/<PRID>-AL.rst b/doc/api/next_api_changes/development/<PRID>-AL.rst\nnew file mode 100644\nindex 000000000000..584420df8fd7\n--- /dev/null\n+++ b/doc/api/next_api_changes/development/<PRID>-AL.rst\n@@ -0,0 +1,2 @@\n+importlib_resources>=2.3.0 is now required on Python<3.10\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" }, { "path": "doc/devel/dependencies.rst", "old_path": "a/doc/devel/dependencies.rst", "new_path": "b/doc/devel/dependencies.rst", "metadata": "diff --git a/doc/devel/dependencies.rst b/doc/devel/dependencies.rst\nindex fb76857898a4..365c062364e2 100644\n--- a/doc/devel/dependencies.rst\n+++ b/doc/devel/dependencies.rst\n@@ -26,6 +26,9 @@ reference.\n * `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2)\n * `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)\n * `setuptools <https://setuptools.readthedocs.io/en/latest/>`_\n+* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)\n+* `importlib-resources <https://pypi.org/project/importlib-resources/>`_\n+ (>= 3.2.0; only required on Python < 3.10)\n \n \n .. _optional_dependencies:\n" }, { "path": "doc/users/next_whats_new/styles_from_packages.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/styles_from_packages.rst", "metadata": "diff --git a/doc/users/next_whats_new/styles_from_packages.rst b/doc/users/next_whats_new/styles_from_packages.rst\nnew file mode 100644\nindex 000000000000..d129bb356fa7\n--- /dev/null\n+++ b/doc/users/next_whats_new/styles_from_packages.rst\n@@ -0,0 +1,11 @@\n+Style files can be imported from third-party packages\n+-----------------------------------------------------\n+\n+Third-party packages can now distribute style files that are globally available\n+as follows. Assume that a package is importable as ``import mypackage``, with\n+a ``mypackage/__init__.py`` module. Then a ``mypackage/presentation.mplstyle``\n+style sheet can be used as ``plt.style.use(\"mypackage.presentation\")``.\n+\n+The implementation does not actually import ``mypackage``, making this process\n+safe against possible import-time side effects. Subpackages (e.g.\n+``dotted.package.name``) are also supported.\n" } ]
diff --git a/doc/api/next_api_changes/development/<PRID>-AL.rst b/doc/api/next_api_changes/development/<PRID>-AL.rst new file mode 100644 index 000000000000..584420df8fd7 --- /dev/null +++ b/doc/api/next_api_changes/development/<PRID>-AL.rst @@ -0,0 +1,2 @@ +importlib_resources>=2.3.0 is now required on Python<3.10 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/devel/dependencies.rst b/doc/devel/dependencies.rst index fb76857898a4..365c062364e2 100644 --- a/doc/devel/dependencies.rst +++ b/doc/devel/dependencies.rst @@ -26,6 +26,9 @@ reference. * `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2) * `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1) * `setuptools <https://setuptools.readthedocs.io/en/latest/>`_ +* `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1) +* `importlib-resources <https://pypi.org/project/importlib-resources/>`_ + (>= 3.2.0; only required on Python < 3.10) .. _optional_dependencies: diff --git a/doc/users/next_whats_new/styles_from_packages.rst b/doc/users/next_whats_new/styles_from_packages.rst new file mode 100644 index 000000000000..d129bb356fa7 --- /dev/null +++ b/doc/users/next_whats_new/styles_from_packages.rst @@ -0,0 +1,11 @@ +Style files can be imported from third-party packages +----------------------------------------------------- + +Third-party packages can now distribute style files that are globally available +as follows. Assume that a package is importable as ``import mypackage``, with +a ``mypackage/__init__.py`` module. Then a ``mypackage/presentation.mplstyle`` +style sheet can be used as ``plt.style.use("mypackage.presentation")``. + +The implementation does not actually import ``mypackage``, making this process +safe against possible import-time side effects. Subpackages (e.g. +``dotted.package.name``) are also supported.
matplotlib/matplotlib
matplotlib__matplotlib-25542
https://github.com/matplotlib/matplotlib/pull/25542
diff --git a/doc/users/next_whats_new/multiplelocator_offset.rst b/doc/users/next_whats_new/multiplelocator_offset.rst new file mode 100644 index 000000000000..863fdb3c4d7e --- /dev/null +++ b/doc/users/next_whats_new/multiplelocator_offset.rst @@ -0,0 +1,17 @@ +``offset`` parameter for MultipleLocator +---------------------------------------- + +An *offset* may now be specified to shift all the ticks by the given value. + +.. plot:: + :include-source: true + + import matplotlib.pyplot as plt + import matplotlib.ticker as mticker + + _, ax = plt.subplots() + ax.plot(range(10)) + locator = mticker.MultipleLocator(base=3, offset=0.3) + ax.xaxis.set_major_locator(locator) + + plt.show() diff --git a/galleries/examples/ticks/tick-locators.py b/galleries/examples/ticks/tick-locators.py index e634e022173c..6cf4afaf22d7 100644 --- a/galleries/examples/ticks/tick-locators.py +++ b/galleries/examples/ticks/tick-locators.py @@ -37,8 +37,8 @@ def setup(ax, title): axs[0].xaxis.set_minor_locator(ticker.NullLocator()) # Multiple Locator -setup(axs[1], title="MultipleLocator(0.5)") -axs[1].xaxis.set_major_locator(ticker.MultipleLocator(0.5)) +setup(axs[1], title="MultipleLocator(0.5, offset=0.2)") +axs[1].xaxis.set_major_locator(ticker.MultipleLocator(0.5, offset=0.2)) axs[1].xaxis.set_minor_locator(ticker.MultipleLocator(0.1)) # Fixed Locator @@ -53,7 +53,7 @@ def setup(ax, title): # Index Locator setup(axs[4], title="IndexLocator(base=0.5, offset=0.25)") -axs[4].plot(range(0, 5), [0]*5, color='white') +axs[4].plot([0]*5, color='white') axs[4].xaxis.set_major_locator(ticker.IndexLocator(base=0.5, offset=0.25)) # Auto Locator diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index bf059567f5fe..0877e58c5fe7 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1831,17 +1831,41 @@ def view_limits(self, vmin, vmax): class MultipleLocator(Locator): """ - Set a tick on each integer multiple of the *base* within the view - interval. + Set a tick on each integer multiple of the *base* plus an *offset* within + the view interval. """ - def __init__(self, base=1.0): + def __init__(self, base=1.0, offset=0.0): + """ + Parameters + ---------- + base : float > 0 + Interval between ticks. + offset : float + Value added to each multiple of *base*. + + .. versionadded:: 3.8 + """ self._edge = _Edge_integer(base, 0) + self._offset = offset - def set_params(self, base): - """Set parameters within this locator.""" + def set_params(self, base=None, offset=None): + """ + Set parameters within this locator. + + Parameters + ---------- + base : float > 0 + Interval between ticks. + offset : float + Value added to each multiple of *base*. + + .. versionadded:: 3.8 + """ if base is not None: self._edge = _Edge_integer(base, 0) + if offset is not None: + self._offset = offset def __call__(self): """Return the locations of the ticks.""" @@ -1852,19 +1876,20 @@ def tick_values(self, vmin, vmax): if vmax < vmin: vmin, vmax = vmax, vmin step = self._edge.step + vmin -= self._offset + vmax -= self._offset vmin = self._edge.ge(vmin) * step n = (vmax - vmin + 0.001 * step) // step - locs = vmin - step + np.arange(n + 3) * step + locs = vmin - step + np.arange(n + 3) * step + self._offset return self.raise_if_exceeds(locs) def view_limits(self, dmin, dmax): """ - Set the view limits to the nearest multiples of *base* that - contain the data. + Set the view limits to the nearest tick values that contain the data. """ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers': - vmin = self._edge.le(dmin) * self._edge.step - vmax = self._edge.ge(dmax) * self._edge.step + vmin = self._edge.le(dmin - self._offset) * self._edge.step + self._offset + vmax = self._edge.ge(dmax - self._offset) * self._edge.step + self._offset if vmin == vmax: vmin -= 1 vmax += 1 diff --git a/lib/matplotlib/ticker.pyi b/lib/matplotlib/ticker.pyi index e53a665432e2..1f4239ef2718 100644 --- a/lib/matplotlib/ticker.pyi +++ b/lib/matplotlib/ticker.pyi @@ -212,9 +212,8 @@ class LinearLocator(Locator): ) -> None: ... class MultipleLocator(Locator): - def __init__(self, base: float = ...) -> None: ... - # Makes set_params `base` argument mandatory - def set_params(self, base: float | None) -> None: ... # type: ignore[override] + def __init__(self, base: float = ..., offset: float = ...) -> None: ... + def set_params(self, base: float | None = ..., offset: float | None = ...) -> None: ... def view_limits(self, dmin: float, dmax: float) -> tuple[float, float]: ... class _Edge_integer:
diff --git a/lib/matplotlib/tests/test_ticker.py b/lib/matplotlib/tests/test_ticker.py index 3d38df575f09..53224d373f80 100644 --- a/lib/matplotlib/tests/test_ticker.py +++ b/lib/matplotlib/tests/test_ticker.py @@ -63,6 +63,12 @@ def test_basic(self): 9.441, 12.588]) assert_almost_equal(loc.tick_values(-7, 10), test_value) + def test_basic_with_offset(self): + loc = mticker.MultipleLocator(base=3.147, offset=1.2) + test_value = np.array([-8.241, -5.094, -1.947, 1.2, 4.347, 7.494, + 10.641]) + assert_almost_equal(loc.tick_values(-7, 10), test_value) + def test_view_limits(self): """ Test basic behavior of view limits. @@ -80,6 +86,15 @@ def test_view_limits_round_numbers(self): loc = mticker.MultipleLocator(base=3.147) assert_almost_equal(loc.view_limits(-4, 4), (-6.294, 6.294)) + def test_view_limits_round_numbers_with_offset(self): + """ + Test that everything works properly with 'round_numbers' for auto + limit. + """ + with mpl.rc_context({'axes.autolimit_mode': 'round_numbers'}): + loc = mticker.MultipleLocator(base=3.147, offset=1.3) + assert_almost_equal(loc.view_limits(-4, 4), (-4.994, 4.447)) + def test_set_params(self): """ Create multiple locator with 0.7 base, and change it to something else. @@ -88,6 +103,8 @@ def test_set_params(self): mult = mticker.MultipleLocator(base=0.7) mult.set_params(base=1.7) assert mult._edge.step == 1.7 + mult.set_params(offset=3) + assert mult._offset == 3 class TestAutoMinorLocator:
[ { "path": "doc/users/next_whats_new/multiplelocator_offset.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/multiplelocator_offset.rst", "metadata": "diff --git a/doc/users/next_whats_new/multiplelocator_offset.rst b/doc/users/next_whats_new/multiplelocator_offset.rst\nnew file mode 100644\nindex 000000000000..863fdb3c4d7e\n--- /dev/null\n+++ b/doc/users/next_whats_new/multiplelocator_offset.rst\n@@ -0,0 +1,17 @@\n+``offset`` parameter for MultipleLocator\n+----------------------------------------\n+\n+An *offset* may now be specified to shift all the ticks by the given value.\n+\n+.. plot::\n+ :include-source: true\n+\n+ import matplotlib.pyplot as plt\n+ import matplotlib.ticker as mticker\n+\n+ _, ax = plt.subplots()\n+ ax.plot(range(10))\n+ locator = mticker.MultipleLocator(base=3, offset=0.3)\n+ ax.xaxis.set_major_locator(locator)\n+\n+ plt.show()\n" } ]
3.7
7b821ce6b4a4474b1013435954c05c63574e3814
[ "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-100-1000]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-0.492-0.492-0]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=8.4 (autodecimal test 2)]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_view_limits_round_numbers", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.015-0.001]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.0123-0.012]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-0.1]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1001-expected21]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_linear_values", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims6-expected_low_ticks6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[0.1-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestFormatStrFormatter::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[253]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims0]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_tick_values_not_empty", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-1000.0-$\\\\mathdefault{10^{3}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.02005753653785041]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.001-3.142e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.001-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.015-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.001-1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims8]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-1-$\\\\mathdefault{10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--1234.56789-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--999.9999-expected19]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.015-0.314]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9956983447069072]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[False-lims3-cases3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[True-True-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[0.001-0.0001-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.001-1000]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x>100%]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-100-0.3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<-100%, display_range=1e-6 (tiny display range)]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-100.0-$\\\\mathdefault{100}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.015-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-500000-$\\\\mathdefault{5\\\\times10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[0.11-1.1e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.1]", "lib/matplotlib/tests/test_ticker.py::TestFixedLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x>100%, display_range=6 (custom xmax test)]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_symmetrizing", "lib/matplotlib/tests/test_ticker.py::TestSymmetricalLogLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.0-0.000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims11]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims26]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-100-100]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_unicode_minus[False--1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_switch_to_autolocator", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims1-expected_low_ticks1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF0.41OTHERSTUFF-0.41]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-07]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.00123456789-expected7]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.015-0.1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[3789.12-3783.1-3780]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.5-0.031]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999999999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-100.0-$\\\\mathdefault{10^{2}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-1000000.0-3.1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-1000000.0-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_sublabel", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-5-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-1000000.0-1e-4]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits8-lim8-6-False]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_tick_values_correct", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits2-lim2-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[1000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-100000-$\\\\mathdefault{10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.0009110511944006454]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_empty_locs", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims5-expected_low_ticks5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.5-314159.265]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits4-lim4-2-False]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.99-1.01-1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[10-lim2-ref2-False]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[Custom percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[2-lim0-ref0-True]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF-None]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.001-3.142e1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.5-31.416]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1-0.41OTHERSTUFF-0.5900000000000001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.5-0.314]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-0.452-0.492-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_locale", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims18]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims20]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.08839967720705845]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-5-314159.27]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.5-0.003]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims2-expected_low_ticks2]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x=100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.6852009766653157]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[True-False-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9999]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23456789-expected15]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_base_rounding", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_first_and_last_minorticks", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims3]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0.123456789-expected12]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::test_set_offset_string[formatter0]", "lib/matplotlib/tests/test_ticker.py::test_minorticks_rc", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_offset[True]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-1000000.0-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[123-189-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-5-0.03]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims2-cases2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.3147990233346844]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.001-3.142e-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1e-323]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_near_zero", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.015-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[False-False-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim1-ref1-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.0043016552930929]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.001-1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.001-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims29]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-1e-05-$\\\\mathdefault{10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-5-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_blank", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-1000000.0-1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-100-31.4]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--1.23456789-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-09]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_low_number_of_majorticks[0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.015-314.159]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims4-expected_low_ticks4]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims1-cases1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=8.5 (autodecimal test 1)]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim6-ref6]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims4-expected_low_ticks4]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[1-55-steps2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-1000000.0-1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-5e-05-$\\\\mathdefault{5\\\\times10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-5-100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23e+33-expected24]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[110000000.0-1.1e8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-0.0375-$\\\\mathdefault{1.2\\\\times2^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9116003227929417]", "lib/matplotlib/tests/test_ticker.py::test_majformatter_type", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--1234.56789-expected1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[False-scilimits0-lim0-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-100-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9990889488055994]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-2e-05-$\\\\mathdefault{2\\\\times10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.84]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims16]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x=100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims21]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-100-0.1]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1000-expected20]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.001-3.142e-2]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim1-ref1-True]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims15]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.5]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23456789e-06-expected11]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_using_all_default_major_steps", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x<100%]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims27]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.015-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12341-12349-12340]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-5-$\\\\mathdefault{5\\\\times10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-05]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-1000000.0-3.1e1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1900.0-1200.0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims23]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10--1-$\\\\mathdefault{-10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-100-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_useMathText[False]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims0-cases0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.4538-0.4578-0.45]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[10-5]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-100001-expected22]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-1000000.0-3.1e5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.001-3.142e5]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_fallback", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims12]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-1-$\\\\mathdefault{1}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0-expected10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99999999]", "lib/matplotlib/tests/test_ticker.py::test_minformatter_type", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[20-100-expected0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_offset[False]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--0.00123456789-expected6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.0-0.000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims0-expected_low_ticks0]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0-expected9]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[123-123-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-0.01-$\\\\mathdefault{0.01}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-189--123-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim0-ref0]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x<0%]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.5-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.0123-0.012]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_useMathText[True]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-08]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.5-31415.927]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[1.5]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[754]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-1000000.0-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[12.3-12.300]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-100-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.9359999999999999]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_wide_values", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits1-lim1-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims3-expected_low_ticks3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-200000-$\\\\mathdefault{2\\\\times10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims17]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-1000000.0-3.1e2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99990.5-100000.5-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-5-1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_unicode_minus[True-\\u22121]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-5-314.16]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.001-100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1-expected14]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-1000000.0-3.1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.001-1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims7-expected_low_ticks7]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-100010.5--99999.5--100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims3-expected_low_ticks3]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF12.4e-3OTHERSTUFF-None]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims10]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-1000000.0-1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-5-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims13]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[False-9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-0.01-$\\\\mathdefault{10^{-2}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims25]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cmr10_substitutions", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.5-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.015-3141.593]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.015-3.142]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[100]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-12335.3-12335.3-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-100-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-0.001-$\\\\mathdefault{10^{-3}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-5-31.42]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[-8.5e-51-0-expected4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims28]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-1000000.0-3.1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.5-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-5-0]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_view_limits", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[None-6]", "lib/matplotlib/tests/test_ticker.py::TestStrMethodFormatter::test_basic[{x:05d}-input0-00002]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.01]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.123-0.123]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims19]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-1000000.0-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-0.03125-$\\\\mathdefault{2^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.001-3.142e-5]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims4]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_init", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-100-314159.3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.015-314159.265]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.015-10000]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[1-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-5-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[100000000.0-1e8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.015-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-0.5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-32-$\\\\mathdefault{2^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-100-3141.6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-1.2-$\\\\mathdefault{1.2\\\\times2^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_set_use_offset_float", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-1-$\\\\mathdefault{10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::test_bad_locator_subs[sub1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_use_overline", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-100-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1-1.41\\\\cdot10^{-2}OTHERSTUFF-0.9859]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-1000000.0-3.1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.001-1e5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-5-31415.93]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[2-lim0-ref0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims0]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[4-lim1-ref1-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[10]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim4-ref4]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x<100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims5-expected_low_ticks5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.015-31.416]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[900.0-1200.0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.001-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.5-3141.593]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.5-100000]", "lib/matplotlib/tests/test_ticker.py::test_locale_comma", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.123456789-expected5]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[-0.1-1.1-None-expected0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1233999-1234001-1234000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[15.99-16.01-16]", "lib/matplotlib/tests/test_ticker.py::test_set_offset_string[formatter1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-1000000.0-1]", "lib/matplotlib/tests/test_ticker.py::test_NullFormatter", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.064]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims8]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-1000000.0-3.1e3]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits6-lim6-9-True]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-2-$\\\\mathdefault{2\\\\times10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-999.9999-expected17]", "lib/matplotlib/tests/test_ticker.py::test_engformatter_usetex_useMathText", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[2]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits5-lim5--3-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_number", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[4-lim1-ref1-True]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.5-1]", "lib/matplotlib/tests/test_ticker.py::TestNullLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-5-0.31]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x<0%]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--999.9999-expected18]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-1000000.0-3.1e-4]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[0-8.5e-51-expected3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.001-3.142e3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.001-3.142e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_one_half", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.001-3.142]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[3]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims7-expected_low_ticks7]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1.41\\\\cdot10^{-2}OTHERSTUFF-0.0141]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[9.99-10.01-10]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12331.4-12350.5-12300]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--0.123456789-expected4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-5-3141.59]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim3-ref3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[Empty percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.5-0]", "lib/matplotlib/tests/test_ticker.py::test_majlocator_type", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.5-0.1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims2-expected_low_ticks2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims5]", "lib/matplotlib/tests/test_ticker.py::test_bad_locator_subs[sub0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-5-0.1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.001-1e-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-1000000.0-3.1e-1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[None as percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.5-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims1-expected_low_ticks1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x>100%]", "lib/matplotlib/tests/test_ticker.py::test_minlocator_type", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[45124.3-45831.75-45000]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_multiple_shared_axes", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim7-ref7]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.001-3.142e2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-5-3.14]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0.1-expected13]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-100000.5--99990.5--100000]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[12.3-12.300]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[2.5-5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.001-1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.6000000000000001]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[1.23-1.230]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99.99-100.01-100]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.015-0.031]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims7]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits7-lim7-5-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims14]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim2-ref2]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim0-ref0-True]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.39999999999999997]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[1.23-1.230]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-100-3.1]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[-1000000000000000.0-1000000000000000.0-expected2]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim5-ref5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.16]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12592.82-12591.43-12590]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9999999]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[True-6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[9.0-12.0-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1-1-1]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_polar_axes", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.001-3.142e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-1000000.0-1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLinearLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[2-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-38.4-$\\\\mathdefault{1.2\\\\times2^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-100-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits3-lim3-2-False]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-12349--12341--12340]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims24]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99999.5-100010.5-100000]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.0-expected8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.5-3.142]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.5-0.001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims6-expected_low_ticks6]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims22]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[-0.1-0.95-None-expected1]", "lib/matplotlib/tests/test_ticker.py::TestIndexLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims7]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[10-lim2-ref2-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_low_number_of_majorticks[1-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor_attr", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-1000000.0-1e5]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[5-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9799424634621495]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.015-0.003]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-100-31415.9]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-999.9-expected16]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[2e-323]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--1.23456789-expected3]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims9]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims0-expected_low_ticks0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.5-314.159]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1.1e-322]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim1-ref1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.000721-0.0007243-0.00072]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.123-0.123]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-06]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[False-True-50\\\\\\\\\\\\{t\\\\}\\\\%]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim0-ref0-False]", "lib/matplotlib/tests/test_ticker.py::TestStrMethodFormatter::test_basic[{x:03d}-{pos:02d}-input1-002-01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-1000000.0-3.1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1e-322]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.015-31415.927]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[1.1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-100-314.2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-1-$\\\\mathdefault{2^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.5-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-5-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.0001]", "lib/matplotlib/tests/test_ticker.py::TestLinearLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-1234001--1233999--1234000]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-987654.321-expected23]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[5.99-6.01-6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.015-100000]" ]
[ "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_basic_with_offset", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_view_limits_round_numbers_with_offset" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/multiplelocator_offset.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/multiplelocator_offset.rst", "metadata": "diff --git a/doc/users/next_whats_new/multiplelocator_offset.rst b/doc/users/next_whats_new/multiplelocator_offset.rst\nnew file mode 100644\nindex 000000000000..863fdb3c4d7e\n--- /dev/null\n+++ b/doc/users/next_whats_new/multiplelocator_offset.rst\n@@ -0,0 +1,17 @@\n+``offset`` parameter for MultipleLocator\n+----------------------------------------\n+\n+An *offset* may now be specified to shift all the ticks by the given value.\n+\n+.. plot::\n+ :include-source: true\n+\n+ import matplotlib.pyplot as plt\n+ import matplotlib.ticker as mticker\n+\n+ _, ax = plt.subplots()\n+ ax.plot(range(10))\n+ locator = mticker.MultipleLocator(base=3, offset=0.3)\n+ ax.xaxis.set_major_locator(locator)\n+\n+ plt.show()\n" } ]
diff --git a/doc/users/next_whats_new/multiplelocator_offset.rst b/doc/users/next_whats_new/multiplelocator_offset.rst new file mode 100644 index 000000000000..863fdb3c4d7e --- /dev/null +++ b/doc/users/next_whats_new/multiplelocator_offset.rst @@ -0,0 +1,17 @@ +``offset`` parameter for MultipleLocator +---------------------------------------- + +An *offset* may now be specified to shift all the ticks by the given value. + +.. plot:: + :include-source: true + + import matplotlib.pyplot as plt + import matplotlib.ticker as mticker + + _, ax = plt.subplots() + ax.plot(range(10)) + locator = mticker.MultipleLocator(base=3, offset=0.3) + ax.xaxis.set_major_locator(locator) + + plt.show()
matplotlib/matplotlib
matplotlib__matplotlib-25779
https://github.com/matplotlib/matplotlib/pull/25779
diff --git a/doc/users/next_whats_new/get_vertices_co_vertices.rst b/doc/users/next_whats_new/get_vertices_co_vertices.rst new file mode 100644 index 000000000000..98254a82ce63 --- /dev/null +++ b/doc/users/next_whats_new/get_vertices_co_vertices.rst @@ -0,0 +1,7 @@ +``Ellipse.get_vertices()``, ``Ellipse.get_co_vertices()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These methods return the coordinates of ellipse vertices of +major and minor axis. Additionally, an example gallery demo is added which +shows how to add an arrow to an ellipse showing a clockwise or counter-clockwise +rotation of the ellipse. To place the arrow exactly on the ellipse, +the coordinates of the vertices are used. diff --git a/galleries/examples/shapes_and_collections/ellipse_arrow.py b/galleries/examples/shapes_and_collections/ellipse_arrow.py new file mode 100644 index 000000000000..4bcdc016faa6 --- /dev/null +++ b/galleries/examples/shapes_and_collections/ellipse_arrow.py @@ -0,0 +1,53 @@ +""" +=================================== +Ellipse with orientation arrow demo +=================================== + +This demo shows how to draw an ellipse with +an orientation arrow (clockwise or counterclockwise). +Compare this to the :doc:`Ellipse collection example +</gallery/shapes_and_collections/ellipse_collection>`. +""" + +import matplotlib.pyplot as plt + +from matplotlib.markers import MarkerStyle +from matplotlib.patches import Ellipse +from matplotlib.transforms import Affine2D + +# Create a figure and axis +fig, ax = plt.subplots(subplot_kw={"aspect": "equal"}) + +ellipse = Ellipse( + xy=(2, 4), + width=30, + height=20, + angle=35, + facecolor="none", + edgecolor="b" +) +ax.add_patch(ellipse) + +# Plot an arrow marker at the end point of minor axis +vertices = ellipse.get_co_vertices() +t = Affine2D().rotate_deg(ellipse.angle) +ax.plot( + vertices[0][0], + vertices[0][1], + color="b", + marker=MarkerStyle(">", "full", t), + markersize=10 +) +# Note: To reverse the orientation arrow, switch the marker type from > to <. + +plt.show() + +# %% +# +# .. admonition:: References +# +# The use of the following functions, methods, classes and modules is shown +# in this example: +# +# - `matplotlib.patches` +# - `matplotlib.patches.Ellipse` diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 245bb7b777c8..ecf03ca4051b 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -1654,6 +1654,37 @@ def get_corners(self): return self.get_patch_transform().transform( [(-1, -1), (1, -1), (1, 1), (-1, 1)]) + def _calculate_length_between_points(self, x0, y0, x1, y1): + return np.sqrt((x1 - x0)**2 + (y1 - y0)**2) + + def get_vertices(self): + """ + Return the vertices coordinates of the ellipse. + + The definition can be found `here <https://en.wikipedia.org/wiki/Ellipse>`_ + + .. versionadded:: 3.8 + """ + if self.width < self.height: + ret = self.get_patch_transform().transform([(0, 1), (0, -1)]) + else: + ret = self.get_patch_transform().transform([(1, 0), (-1, 0)]) + return [tuple(x) for x in ret] + + def get_co_vertices(self): + """ + Return the co-vertices coordinates of the ellipse. + + The definition can be found `here <https://en.wikipedia.org/wiki/Ellipse>`_ + + .. versionadded:: 3.8 + """ + if self.width < self.height: + ret = self.get_patch_transform().transform([(1, 0), (-1, 0)]) + else: + ret = self.get_patch_transform().transform([(0, 1), (0, -1)]) + return [tuple(x) for x in ret] + class Annulus(Patch): """ diff --git a/lib/matplotlib/patches.pyi b/lib/matplotlib/patches.pyi index 1e70a1efc3be..e9302563083c 100644 --- a/lib/matplotlib/patches.pyi +++ b/lib/matplotlib/patches.pyi @@ -259,6 +259,10 @@ class Ellipse(Patch): def get_corners(self) -> np.ndarray: ... + def get_vertices(self) -> list[tuple[float, float]]: ... + def get_co_vertices(self) -> list[tuple[float, float]]: ... + + class Annulus(Patch): a: float b: float
diff --git a/lib/matplotlib/tests/test_patches.py b/lib/matplotlib/tests/test_patches.py index b9e1db32d419..fd872bac98d4 100644 --- a/lib/matplotlib/tests/test_patches.py +++ b/lib/matplotlib/tests/test_patches.py @@ -104,6 +104,57 @@ def test_corner_center(): assert_almost_equal(ellipse.get_corners(), corners_rot) +def test_ellipse_vertices(): + # expect 0 for 0 ellipse width, height + ellipse = Ellipse(xy=(0, 0), width=0, height=0, angle=0) + assert_almost_equal( + ellipse.get_vertices(), + [(0.0, 0.0), (0.0, 0.0)], + ) + assert_almost_equal( + ellipse.get_co_vertices(), + [(0.0, 0.0), (0.0, 0.0)], + ) + + ellipse = Ellipse(xy=(0, 0), width=2, height=1, angle=30) + assert_almost_equal( + ellipse.get_vertices(), + [ + ( + ellipse.center[0] + ellipse.width / 4 * np.sqrt(3), + ellipse.center[1] + ellipse.width / 4, + ), + ( + ellipse.center[0] - ellipse.width / 4 * np.sqrt(3), + ellipse.center[1] - ellipse.width / 4, + ), + ], + ) + assert_almost_equal( + ellipse.get_co_vertices(), + [ + ( + ellipse.center[0] - ellipse.height / 4, + ellipse.center[1] + ellipse.height / 4 * np.sqrt(3), + ), + ( + ellipse.center[0] + ellipse.height / 4, + ellipse.center[1] - ellipse.height / 4 * np.sqrt(3), + ), + ], + ) + v1, v2 = np.array(ellipse.get_vertices()) + np.testing.assert_almost_equal((v1 + v2) / 2, ellipse.center) + v1, v2 = np.array(ellipse.get_co_vertices()) + np.testing.assert_almost_equal((v1 + v2) / 2, ellipse.center) + + ellipse = Ellipse(xy=(2.252, -10.859), width=2.265, height=1.98, angle=68.78) + v1, v2 = np.array(ellipse.get_vertices()) + np.testing.assert_almost_equal((v1 + v2) / 2, ellipse.center) + v1, v2 = np.array(ellipse.get_co_vertices()) + np.testing.assert_almost_equal((v1 + v2) / 2, ellipse.center) + + def test_rotate_rect(): loc = np.asarray([1.0, 2.0]) width = 2
[ { "path": "doc/users/next_whats_new/get_vertices_co_vertices.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/get_vertices_co_vertices.rst", "metadata": "diff --git a/doc/users/next_whats_new/get_vertices_co_vertices.rst b/doc/users/next_whats_new/get_vertices_co_vertices.rst\nnew file mode 100644\nindex 000000000000..98254a82ce63\n--- /dev/null\n+++ b/doc/users/next_whats_new/get_vertices_co_vertices.rst\n@@ -0,0 +1,7 @@\n+``Ellipse.get_vertices()``, ``Ellipse.get_co_vertices()``\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+These methods return the coordinates of ellipse vertices of\n+major and minor axis. Additionally, an example gallery demo is added which\n+shows how to add an arrow to an ellipse showing a clockwise or counter-clockwise\n+rotation of the ellipse. To place the arrow exactly on the ellipse,\n+the coordinates of the vertices are used.\n" } ]
3.7
06305a2f5dc589888697b3b909859103b8259153
[ "lib/matplotlib/tests/test_patches.py::test_patch_alpha_override[pdf]", "lib/matplotlib/tests/test_patches.py::test_clip_to_bbox[png]", "lib/matplotlib/tests/test_patches.py::test_contains_points", "lib/matplotlib/tests/test_patches.py::test_units_rectangle[png]", "lib/matplotlib/tests/test_patches.py::test_connection_patch[png]", "lib/matplotlib/tests/test_patches.py::test_wedge_range[png]", "lib/matplotlib/tests/test_patches.py::test_datetime_datetime_fails", "lib/matplotlib/tests/test_patches.py::test_fancyarrow_shape_error", "lib/matplotlib/tests/test_patches.py::test_datetime_rectangle", "lib/matplotlib/tests/test_patches.py::test_boxstyle_errors[Round,foo-Incorrect style argument: 'Round,foo']", "lib/matplotlib/tests/test_patches.py::test_negative_rect", "lib/matplotlib/tests/test_patches.py::test_multi_color_hatch[pdf]", "lib/matplotlib/tests/test_patches.py::test_connection_patch_fig[png]", "lib/matplotlib/tests/test_patches.py::test_autoscale_arc[svg]", "lib/matplotlib/tests/test_patches.py::test_patch_alpha_override[svg]", "lib/matplotlib/tests/test_patches.py::test_large_arc[svg]", "lib/matplotlib/tests/test_patches.py::test_patch_linestyle_accents", "lib/matplotlib/tests/test_patches.py::test_rotated_arcs[svg]", "lib/matplotlib/tests/test_patches.py::test_patch_custom_linestyle[pdf]", "lib/matplotlib/tests/test_patches.py::test_modifying_arc[svg]", "lib/matplotlib/tests/test_patches.py::test_Polygon_close", "lib/matplotlib/tests/test_patches.py::test_modifying_arc[png]", "lib/matplotlib/tests/test_patches.py::test_autoscale_arc[png]", "lib/matplotlib/tests/test_patches.py::test_patch_alpha_coloring[svg]", "lib/matplotlib/tests/test_patches.py::test_color_override_warning[edgecolor]", "lib/matplotlib/tests/test_patches.py::test_rotate_rect", "lib/matplotlib/tests/test_patches.py::test_patch_linestyle_none[png]", "lib/matplotlib/tests/test_patches.py::test_annulus_setters[png]", "lib/matplotlib/tests/test_patches.py::test_patch_str", "lib/matplotlib/tests/test_patches.py::test_multi_color_hatch[svg]", "lib/matplotlib/tests/test_patches.py::test_patch_custom_linestyle[svg]", "lib/matplotlib/tests/test_patches.py::test_dash_offset_patch_draw[png]", "lib/matplotlib/tests/test_patches.py::test_clip_to_bbox[svg]", "lib/matplotlib/tests/test_patches.py::test_multi_color_hatch[png]", "lib/matplotlib/tests/test_patches.py::test_fancyarrow_setdata", "lib/matplotlib/tests/test_patches.py::test_patch_alpha_coloring[png]", "lib/matplotlib/tests/test_patches.py::test_wedge_range[pdf]", "lib/matplotlib/tests/test_patches.py::test_wedge_range[svg]", "lib/matplotlib/tests/test_patches.py::test_corner_center", "lib/matplotlib/tests/test_patches.py::test_default_linestyle", "lib/matplotlib/tests/test_patches.py::test_empty_verts", "lib/matplotlib/tests/test_patches.py::test_patch_alpha_override[png]", "lib/matplotlib/tests/test_patches.py::test_default_capstyle", "lib/matplotlib/tests/test_patches.py::test_contains_point", "lib/matplotlib/tests/test_patches.py::test_modifying_arc[pdf]", "lib/matplotlib/tests/test_patches.py::test_color_override_warning[facecolor]", "lib/matplotlib/tests/test_patches.py::test_default_joinstyle", "lib/matplotlib/tests/test_patches.py::test_arc_in_collection[pdf]", "lib/matplotlib/tests/test_patches.py::test_wedge_movement", "lib/matplotlib/tests/test_patches.py::test_annulus[png]", "lib/matplotlib/tests/test_patches.py::test_clip_to_bbox[pdf]", "lib/matplotlib/tests/test_patches.py::test_arc_in_collection[svg]", "lib/matplotlib/tests/test_patches.py::test_degenerate_polygon", "lib/matplotlib/tests/test_patches.py::test_arc_in_collection[png]", "lib/matplotlib/tests/test_patches.py::test_shadow[png]", "lib/matplotlib/tests/test_patches.py::test_rotate_rect_draw[png]", "lib/matplotlib/tests/test_patches.py::test_patch_color_none", "lib/matplotlib/tests/test_patches.py::test_arc_in_collection[eps]", "lib/matplotlib/tests/test_patches.py::test_default_antialiased", "lib/matplotlib/tests/test_patches.py::test_annulus_setters2[png]", "lib/matplotlib/tests/test_patches.py::test_fancyarrow_units", "lib/matplotlib/tests/test_patches.py::test_patch_custom_linestyle[png]", "lib/matplotlib/tests/test_patches.py::test_patch_alpha_coloring[pdf]", "lib/matplotlib/tests/test_patches.py::test_boxstyle_errors[foo-Unknown style: 'foo']", "lib/matplotlib/tests/test_patches.py::test_modifying_arc[eps]" ]
[ "lib/matplotlib/tests/test_patches.py::test_ellipse_vertices" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "file", "name": "galleries/examples/shapes_and_collections/ellipse_arrow.py" } ] }
[ { "path": "doc/users/next_whats_new/get_vertices_co_vertices.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/get_vertices_co_vertices.rst", "metadata": "diff --git a/doc/users/next_whats_new/get_vertices_co_vertices.rst b/doc/users/next_whats_new/get_vertices_co_vertices.rst\nnew file mode 100644\nindex 000000000000..98254a82ce63\n--- /dev/null\n+++ b/doc/users/next_whats_new/get_vertices_co_vertices.rst\n@@ -0,0 +1,7 @@\n+``Ellipse.get_vertices()``, ``Ellipse.get_co_vertices()``\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+These methods return the coordinates of ellipse vertices of\n+major and minor axis. Additionally, an example gallery demo is added which\n+shows how to add an arrow to an ellipse showing a clockwise or counter-clockwise\n+rotation of the ellipse. To place the arrow exactly on the ellipse,\n+the coordinates of the vertices are used.\n" } ]
diff --git a/doc/users/next_whats_new/get_vertices_co_vertices.rst b/doc/users/next_whats_new/get_vertices_co_vertices.rst new file mode 100644 index 000000000000..98254a82ce63 --- /dev/null +++ b/doc/users/next_whats_new/get_vertices_co_vertices.rst @@ -0,0 +1,7 @@ +``Ellipse.get_vertices()``, ``Ellipse.get_co_vertices()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These methods return the coordinates of ellipse vertices of +major and minor axis. Additionally, an example gallery demo is added which +shows how to add an arrow to an ellipse showing a clockwise or counter-clockwise +rotation of the ellipse. To place the arrow exactly on the ellipse, +the coordinates of the vertices are used. If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'file', 'name': 'galleries/examples/shapes_and_collections/ellipse_arrow.py'}]
matplotlib/matplotlib
matplotlib__matplotlib-26089
https://github.com/matplotlib/matplotlib/pull/26089
diff --git a/doc/users/next_whats_new/set_loc.rst b/doc/users/next_whats_new/set_loc.rst new file mode 100644 index 000000000000..2a8722a18da0 --- /dev/null +++ b/doc/users/next_whats_new/set_loc.rst @@ -0,0 +1,23 @@ +Add a public method to modify the location of ``Legend`` +-------------------------------------------------------- + +`~matplotlib.legend.Legend` locations now can be tweaked after they've been defined. + +.. plot:: + :include-source: true + + from matplotlib import pyplot as plt + + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) + + x = list(range(-100, 101)) + y = [i**2 for i in x] + + ax.plot(x, y, label="f(x)") + ax.legend() + ax.get_legend().set_loc("right") + # Or + # ax.get_legend().set(loc="right") + + plt.show() diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index b0e50d67f9b7..a0ad612e7084 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -330,6 +330,12 @@ def _update_bbox_to_anchor(self, loc_in_canvas): _legend_kw_doc_base) _docstring.interpd.update(_legend_kw_doc=_legend_kw_both_st) +_legend_kw_set_loc_st = ( + _loc_doc_base.format(parent='axes/figure', + default=":rc:`legend.loc` for Axes, 'upper right' for Figure", + best=_loc_doc_best, outside=_outside_doc)) +_docstring.interpd.update(_legend_kw_set_loc_doc=_legend_kw_set_loc_st) + class Legend(Artist): """ @@ -503,58 +509,6 @@ def val_or_rc(val, rc_name): ) self.parent = parent - loc0 = loc - self._loc_used_default = loc is None - if loc is None: - loc = mpl.rcParams["legend.loc"] - if not self.isaxes and loc in [0, 'best']: - loc = 'upper right' - - type_err_message = ("loc must be string, coordinate tuple, or" - f" an integer 0-10, not {loc!r}") - - # handle outside legends: - self._outside_loc = None - if isinstance(loc, str): - if loc.split()[0] == 'outside': - # strip outside: - loc = loc.split('outside ')[1] - # strip "center" at the beginning - self._outside_loc = loc.replace('center ', '') - # strip first - self._outside_loc = self._outside_loc.split()[0] - locs = loc.split() - if len(locs) > 1 and locs[0] in ('right', 'left'): - # locs doesn't accept "left upper", etc, so swap - if locs[0] != 'center': - locs = locs[::-1] - loc = locs[0] + ' ' + locs[1] - # check that loc is in acceptable strings - loc = _api.check_getitem(self.codes, loc=loc) - elif np.iterable(loc): - # coerce iterable into tuple - loc = tuple(loc) - # validate the tuple represents Real coordinates - if len(loc) != 2 or not all(isinstance(e, numbers.Real) for e in loc): - raise ValueError(type_err_message) - elif isinstance(loc, int): - # validate the integer represents a string numeric value - if loc < 0 or loc > 10: - raise ValueError(type_err_message) - else: - # all other cases are invalid values of loc - raise ValueError(type_err_message) - - if self.isaxes and self._outside_loc: - raise ValueError( - f"'outside' option for loc='{loc0}' keyword argument only " - "works for figure legends") - - if not self.isaxes and loc == 0: - raise ValueError( - "Automatic legend placement (loc='best') not implemented for " - "figure legend") - self._mode = mode self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform) @@ -598,9 +552,8 @@ def val_or_rc(val, rc_name): # init with null renderer self._init_legend_box(handles, labels, markerfirst) - tmp = self._loc_used_default - self._set_loc(loc) - self._loc_used_default = tmp # ignore changes done by _set_loc + # Set legend location + self.set_loc(loc) # figure out title font properties: if title_fontsize is not None and title_fontproperties is not None: @@ -686,6 +639,73 @@ def _set_artist_props(self, a): a.set_transform(self.get_transform()) + @_docstring.dedent_interpd + def set_loc(self, loc=None): + """ + Set the location of the legend. + + .. versionadded:: 3.8 + + Parameters + ---------- + %(_legend_kw_set_loc_doc)s + """ + loc0 = loc + self._loc_used_default = loc is None + if loc is None: + loc = mpl.rcParams["legend.loc"] + if not self.isaxes and loc in [0, 'best']: + loc = 'upper right' + + type_err_message = ("loc must be string, coordinate tuple, or" + f" an integer 0-10, not {loc!r}") + + # handle outside legends: + self._outside_loc = None + if isinstance(loc, str): + if loc.split()[0] == 'outside': + # strip outside: + loc = loc.split('outside ')[1] + # strip "center" at the beginning + self._outside_loc = loc.replace('center ', '') + # strip first + self._outside_loc = self._outside_loc.split()[0] + locs = loc.split() + if len(locs) > 1 and locs[0] in ('right', 'left'): + # locs doesn't accept "left upper", etc, so swap + if locs[0] != 'center': + locs = locs[::-1] + loc = locs[0] + ' ' + locs[1] + # check that loc is in acceptable strings + loc = _api.check_getitem(self.codes, loc=loc) + elif np.iterable(loc): + # coerce iterable into tuple + loc = tuple(loc) + # validate the tuple represents Real coordinates + if len(loc) != 2 or not all(isinstance(e, numbers.Real) for e in loc): + raise ValueError(type_err_message) + elif isinstance(loc, int): + # validate the integer represents a string numeric value + if loc < 0 or loc > 10: + raise ValueError(type_err_message) + else: + # all other cases are invalid values of loc + raise ValueError(type_err_message) + + if self.isaxes and self._outside_loc: + raise ValueError( + f"'outside' option for loc='{loc0}' keyword argument only " + "works for figure legends") + + if not self.isaxes and loc == 0: + raise ValueError( + "Automatic legend placement (loc='best') not implemented for " + "figure legend") + + tmp = self._loc_used_default + self._set_loc(loc) + self._loc_used_default = tmp # ignore changes done by _set_loc + def _set_loc(self, loc): # find_offset function will be provided to _legend_box and # _legend_box will draw itself at the location of the return diff --git a/lib/matplotlib/legend.pyi b/lib/matplotlib/legend.pyi index 77ef273766c2..7116f40f3e0c 100644 --- a/lib/matplotlib/legend.pyi +++ b/lib/matplotlib/legend.pyi @@ -118,6 +118,7 @@ class Legend(Artist): def get_texts(self) -> list[Text]: ... def set_alignment(self, alignment: Literal["center", "left", "right"]) -> None: ... def get_alignment(self) -> Literal["center", "left", "right"]: ... + def set_loc(self, loc: str | tuple[float, float] | int | None = ...) -> None: ... def set_title( self, title: str, prop: FontProperties | str | pathlib.Path | None = ... ) -> None: ...
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index c94a0f5f6169..720dfc3e6c65 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -755,6 +755,26 @@ def test_legend_alignment(alignment): assert leg.get_alignment() == alignment +@pytest.mark.parametrize('loc', ('center', 'best',)) +def test_ax_legend_set_loc(loc): + fig, ax = plt.subplots() + ax.plot(range(10), label='test') + leg = ax.legend() + leg.set_loc(loc) + assert leg._get_loc() == mlegend.Legend.codes[loc] + + +@pytest.mark.parametrize('loc', ('outside right', 'right',)) +def test_fig_legend_set_loc(loc): + fig, ax = plt.subplots() + ax.plot(range(10), label='test') + leg = fig.legend() + leg.set_loc(loc) + + loc = loc.split()[1] if loc.startswith("outside") else loc + assert leg._get_loc() == mlegend.Legend.codes[loc] + + @pytest.mark.parametrize('alignment', ('center', 'left', 'right')) def test_legend_set_alignment(alignment): fig, ax = plt.subplots()
[ { "path": "doc/users/next_whats_new/set_loc.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/set_loc.rst", "metadata": "diff --git a/doc/users/next_whats_new/set_loc.rst b/doc/users/next_whats_new/set_loc.rst\nnew file mode 100644\nindex 000000000000..2a8722a18da0\n--- /dev/null\n+++ b/doc/users/next_whats_new/set_loc.rst\n@@ -0,0 +1,23 @@\n+Add a public method to modify the location of ``Legend``\n+--------------------------------------------------------\n+\n+`~matplotlib.legend.Legend` locations now can be tweaked after they've been defined.\n+\n+.. plot::\n+ :include-source: true\n+\n+ from matplotlib import pyplot as plt\n+\n+ fig = plt.figure()\n+ ax = fig.add_subplot(1, 1, 1)\n+\n+ x = list(range(-100, 101))\n+ y = [i**2 for i in x]\n+\n+ ax.plot(x, y, label=\"f(x)\")\n+ ax.legend()\n+ ax.get_legend().set_loc(\"right\")\n+ # Or\n+ # ax.get_legend().set(loc=\"right\")\n+\n+ plt.show()\n" } ]
3.7
f588d2b06e5b3c3296046d2ee9f0c13831cafe1c
[ "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter[png]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[color2]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_arg", "lib/matplotlib/tests/test_legend.py::test_text_nohandler_warning", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_labels", "lib/matplotlib/tests/test_legend.py::test_loc_invalid_tuple_exception", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[one]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_only", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[svg]", "lib/matplotlib/tests/test_legend.py::test_warn_big_data_best_loc", "lib/matplotlib/tests/test_legend.py::test_fancy[png]", "lib/matplotlib/tests/test_legend.py::test_loc_valid_tuple", "lib/matplotlib/tests/test_legend.py::test_legend_expand[png]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markfacecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_various_labels[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[pdf]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args", "lib/matplotlib/tests/test_legend.py::test_framealpha[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[png]", "lib/matplotlib/tests/test_legend.py::test_loc_validation_numeric_value", "lib/matplotlib/tests/test_legend.py::test_rc[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_label_with_leading_underscore", "lib/matplotlib/tests/test_legend.py::test_setting_alpha_keeps_polycollection_color", "lib/matplotlib/tests/test_legend.py::test_legend_expand[svg]", "lib/matplotlib/tests/test_legend.py::test_get_set_draggable", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_label_incorrect_length_exception", "lib/matplotlib/tests/test_legend.py::test_legend_text_axes", "lib/matplotlib/tests/test_legend.py::test_cross_figure_patch_legend", "lib/matplotlib/tests/test_legend.py::test_alpha_rcparam[png]", "lib/matplotlib/tests/test_legend.py::test_linecollection_scaled_dashes", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_three_args", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[svg]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_handle_label", "lib/matplotlib/tests/test_legend.py::test_handlerline2d", "lib/matplotlib/tests/test_legend.py::test_legend_title_empty", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_rc[png]", "lib/matplotlib/tests/test_legend.py::test_fancy[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_title_fontprop_fontsize", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_shadow_invalid_argument", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[none]", "lib/matplotlib/tests/test_legend.py::test_hatching[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_list", "lib/matplotlib/tests/test_legend.py::test_hatching[pdf]", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::test_handler_numpoints", "lib/matplotlib/tests/test_legend.py::test_alpha_handles", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_labels_first[png]", "lib/matplotlib/tests/test_legend.py::test_legend_stackplot[png]", "lib/matplotlib/tests/test_legend.py::test_shadow_argument_types[png]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[pdf]", "lib/matplotlib/tests/test_legend.py::test_hatching[svg]", "lib/matplotlib/tests/test_legend.py::test_nanscatter", "lib/matplotlib/tests/test_legend.py::test_fancy[pdf]", "lib/matplotlib/tests/test_legend.py::test_empty_bar_chart_with_legend", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args_pluskw", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[int]", "lib/matplotlib/tests/test_legend.py::test_loc_validation_string_value", "lib/matplotlib/tests/test_legend.py::test_legend_proper_window_extent", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::test_legend_auto4", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter_transform[png]", "lib/matplotlib/tests/test_legend.py::test_subfigure_legend", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_labels_only", "lib/matplotlib/tests/test_legend.py::test_various_labels[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_alpha_rgba[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_only", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[none]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_parasite", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[False]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[pdf]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[png]", "lib/matplotlib/tests/test_legend.py::test_rc[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_repeatcheckok", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_framealpha[svg]", "lib/matplotlib/tests/test_legend.py::test_window_extent_cached_renderer", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[left]", "lib/matplotlib/tests/test_legend.py::test_reverse_legend_handles_and_labels", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[left]", "lib/matplotlib/tests/test_legend.py::test_figure_legend_outside", "lib/matplotlib/tests/test_legend.py::test_legend_expand[pdf]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[1]", "lib/matplotlib/tests/test_legend.py::test_reverse_legend_display[png]", "lib/matplotlib/tests/test_legend.py::test_legend_remove", "lib/matplotlib/tests/test_legend.py::test_multiple_keys[png]", "lib/matplotlib/tests/test_legend.py::test_legend_markers_from_line2d", "lib/matplotlib/tests/test_legend.py::test_loc_valid_list", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor_short", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_labels", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_warn_args_kwargs", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_loc_invalid_type", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[color2]", "lib/matplotlib/tests/test_legend.py::test_legend_ordereddict", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_labels_only", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[True]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_warn_mixed_args_and_kwargs", "lib/matplotlib/tests/test_legend.py::test_loc_invalid_list_exception", "lib/matplotlib/tests/test_legend.py::test_shadow_framealpha", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_kw_args", "lib/matplotlib/tests/test_legend.py::test_no_warn_big_data_when_loc_specified", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_framealpha[pdf]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_handler_map", "lib/matplotlib/tests/test_legend.py::test_legend_auto5", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_linecolor", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor_short", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[png]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_legend_face_edgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_various_labels[png]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_cmap" ]
[ "lib/matplotlib/tests/test_legend.py::test_fig_legend_set_loc[right]", "lib/matplotlib/tests/test_legend.py::test_ax_legend_set_loc[center]", "lib/matplotlib/tests/test_legend.py::test_fig_legend_set_loc[outside right]", "lib/matplotlib/tests/test_legend.py::test_ax_legend_set_loc[best]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/set_loc.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/set_loc.rst", "metadata": "diff --git a/doc/users/next_whats_new/set_loc.rst b/doc/users/next_whats_new/set_loc.rst\nnew file mode 100644\nindex 000000000000..2a8722a18da0\n--- /dev/null\n+++ b/doc/users/next_whats_new/set_loc.rst\n@@ -0,0 +1,23 @@\n+Add a public method to modify the location of ``Legend``\n+--------------------------------------------------------\n+\n+`~matplotlib.legend.Legend` locations now can be tweaked after they've been defined.\n+\n+.. plot::\n+ :include-source: true\n+\n+ from matplotlib import pyplot as plt\n+\n+ fig = plt.figure()\n+ ax = fig.add_subplot(1, 1, 1)\n+\n+ x = list(range(-100, 101))\n+ y = [i**2 for i in x]\n+\n+ ax.plot(x, y, label=\"f(x)\")\n+ ax.legend()\n+ ax.get_legend().set_loc(\"right\")\n+ # Or\n+ # ax.get_legend().set(loc=\"right\")\n+\n+ plt.show()\n" } ]
diff --git a/doc/users/next_whats_new/set_loc.rst b/doc/users/next_whats_new/set_loc.rst new file mode 100644 index 000000000000..2a8722a18da0 --- /dev/null +++ b/doc/users/next_whats_new/set_loc.rst @@ -0,0 +1,23 @@ +Add a public method to modify the location of ``Legend`` +-------------------------------------------------------- + +`~matplotlib.legend.Legend` locations now can be tweaked after they've been defined. + +.. plot:: + :include-source: true + + from matplotlib import pyplot as plt + + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) + + x = list(range(-100, 101)) + y = [i**2 for i in x] + + ax.plot(x, y, label="f(x)") + ax.legend() + ax.get_legend().set_loc("right") + # Or + # ax.get_legend().set(loc="right") + + plt.show()
matplotlib/matplotlib
matplotlib__matplotlib-24691
https://github.com/matplotlib/matplotlib/pull/24691
diff --git a/doc/users/next_whats_new/new_color_spec_tuple.rst b/doc/users/next_whats_new/new_color_spec_tuple.rst new file mode 100644 index 000000000000..9f8d0ecabc3e --- /dev/null +++ b/doc/users/next_whats_new/new_color_spec_tuple.rst @@ -0,0 +1,21 @@ +Add a new valid color format ``(matplotlib_color, alpha)`` +---------------------------------------------------------- + + +.. plot:: + :include-source: true + + import matplotlib.pyplot as plt + from matplotlib.patches import Rectangle + + fig, ax = plt.subplots() + + rectangle = Rectangle((.2, .2), .6, .6, + facecolor=('blue', 0.2), + edgecolor=('green', 0.5)) + ax.add_patch(rectangle) + + +Users can define a color using the new color specification, *(matplotlib_color, alpha)*. +Note that an explicit alpha keyword argument will override an alpha value from +*(matplotlib_color, alpha)*. diff --git a/galleries/examples/color/set_alpha.py b/galleries/examples/color/set_alpha.py new file mode 100644 index 000000000000..4130fe1109ef --- /dev/null +++ b/galleries/examples/color/set_alpha.py @@ -0,0 +1,53 @@ +""" +================================= +Ways to set a color's alpha value +================================= + +Compare setting alpha by the *alpha* keyword argument and by one of the Matplotlib color +formats. Often, the *alpha* keyword is the only tool needed to add transparency to a +color. In some cases, the *(matplotlib_color, alpha)* color format provides an easy way +to fine-tune the appearance of a Figure. + +""" + +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility. +np.random.seed(19680801) + +fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4)) + +x_values = [n for n in range(20)] +y_values = np.random.randn(20) + +facecolors = ['green' if y > 0 else 'red' for y in y_values] +edgecolors = facecolors + +ax1.bar(x_values, y_values, color=facecolors, edgecolor=edgecolors, alpha=0.5) +ax1.set_title("Explicit 'alpha' keyword value\nshared by all bars and edges") + + +# Normalize y values to get distinct face alpha values. +abs_y = [abs(y) for y in y_values] +face_alphas = [n / max(abs_y) for n in abs_y] +edge_alphas = [1 - alpha for alpha in face_alphas] + +colors_with_alphas = list(zip(facecolors, face_alphas)) +edgecolors_with_alphas = list(zip(edgecolors, edge_alphas)) + +ax2.bar(x_values, y_values, color=colors_with_alphas, + edgecolor=edgecolors_with_alphas) +ax2.set_title('Normalized alphas for\neach bar and each edge') + +plt.show() + +# %% +# +# .. admonition:: References +# +# The use of the following functions, methods, classes and modules is shown +# in this example: +# +# - `matplotlib.axes.Axes.bar` +# - `matplotlib.pyplot.subplots` diff --git a/galleries/users_explain/colors/colors.py b/galleries/users_explain/colors/colors.py index bd8cdb299a85..d308f0fb1859 100644 --- a/galleries/users_explain/colors/colors.py +++ b/galleries/users_explain/colors/colors.py @@ -68,6 +68,9 @@ | to black if cycle does not | | | include color. | | +--------------------------------------+--------------------------------------+ +| Tuple of one of the above color | - ``('green', 0.3)`` | +| formats and an alpha float. | - ``('#f00', 0.9)`` | ++--------------------------------------+--------------------------------------+ .. _xkcd color survey: https://xkcd.com/color/rgb/ diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 304eccca1bd7..d9a60afd0f3f 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -315,6 +315,13 @@ def _to_rgba_no_colorcycle(c, alpha=None): *alpha* is ignored for the color value ``"none"`` (case-insensitive), which always maps to ``(0, 0, 0, 0)``. """ + if isinstance(c, tuple) and len(c) == 2: + if alpha is None: + c, alpha = c + else: + c = c[0] + if alpha is not None and not 0 <= alpha <= 1: + raise ValueError("'alpha' must be between 0 and 1, inclusive") orig_c = c if c is np.ma.masked: return (0., 0., 0., 0.) @@ -425,6 +432,11 @@ def to_rgba_array(c, alpha=None): (n, 4) array of RGBA colors, where each channel (red, green, blue, alpha) can assume values between 0 and 1. """ + if isinstance(c, tuple) and len(c) == 2: + if alpha is None: + c, alpha = c + else: + c = c[0] # Special-case inputs that are already arrays, for performance. (If the # array has the wrong kind or shape, raise the error during one-at-a-time # conversion.) @@ -464,9 +476,12 @@ def to_rgba_array(c, alpha=None): return np.array([to_rgba(c, a) for a in alpha], float) else: return np.array([to_rgba(c, alpha)], float) - except (ValueError, TypeError): + except TypeError: pass - + except ValueError as e: + if e.args == ("'alpha' must be between 0 and 1, inclusive", ): + # ValueError is from _to_rgba_no_colorcycle(). + raise e if isinstance(c, str): raise ValueError(f"{c!r} is not a valid color value.")
diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py index 14dd4ced77db..21e76bcd18b4 100644 --- a/lib/matplotlib/tests/test_colors.py +++ b/lib/matplotlib/tests/test_colors.py @@ -1307,6 +1307,51 @@ def test_to_rgba_array_alpha_array(): assert_array_equal(c[:, 3], alpha) +def test_to_rgba_array_accepts_color_alpha_tuple(): + assert_array_equal( + mcolors.to_rgba_array(('black', 0.9)), + [[0, 0, 0, 0.9]]) + + +def test_to_rgba_array_explicit_alpha_overrides_tuple_alpha(): + assert_array_equal( + mcolors.to_rgba_array(('black', 0.9), alpha=0.5), + [[0, 0, 0, 0.5]]) + + +def test_to_rgba_array_accepts_color_alpha_tuple_with_multiple_colors(): + color_array = np.array([[1., 1., 1., 1.], [0., 0., 1., 0.]]) + assert_array_equal( + mcolors.to_rgba_array((color_array, 0.2)), + [[1., 1., 1., 0.2], [0., 0., 1., 0.2]]) + + color_sequence = [[1., 1., 1., 1.], [0., 0., 1., 0.]] + assert_array_equal( + mcolors.to_rgba_array((color_sequence, 0.4)), + [[1., 1., 1., 0.4], [0., 0., 1., 0.4]]) + + +def test_to_rgba_array_error_with_color_invalid_alpha_tuple(): + with pytest.raises(ValueError, match="'alpha' must be between 0 and 1,"): + mcolors.to_rgba_array(('black', 2.0)) + + +@pytest.mark.parametrize('rgba_alpha', + [('white', 0.5), ('#ffffff', 0.5), ('#ffffff00', 0.5), + ((1.0, 1.0, 1.0, 1.0), 0.5)]) +def test_to_rgba_accepts_color_alpha_tuple(rgba_alpha): + assert mcolors.to_rgba(rgba_alpha) == (1, 1, 1, 0.5) + + +def test_to_rgba_explicit_alpha_overrides_tuple_alpha(): + assert mcolors.to_rgba(('red', 0.1), alpha=0.9) == (1, 0, 0, 0.9) + + +def test_to_rgba_error_with_color_invalid_alpha_tuple(): + with pytest.raises(ValueError, match="'alpha' must be between 0 and 1"): + mcolors.to_rgba(('blue', 2.0)) + + def test_failed_conversions(): with pytest.raises(ValueError): mcolors.to_rgba('5')
[ { "path": "doc/users/next_whats_new/new_color_spec_tuple.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/new_color_spec_tuple.rst", "metadata": "diff --git a/doc/users/next_whats_new/new_color_spec_tuple.rst b/doc/users/next_whats_new/new_color_spec_tuple.rst\nnew file mode 100644\nindex 000000000000..9f8d0ecabc3e\n--- /dev/null\n+++ b/doc/users/next_whats_new/new_color_spec_tuple.rst\n@@ -0,0 +1,21 @@\n+Add a new valid color format ``(matplotlib_color, alpha)``\n+----------------------------------------------------------\n+\n+\n+.. plot::\n+ :include-source: true\n+\n+ import matplotlib.pyplot as plt\n+ from matplotlib.patches import Rectangle\n+\n+ fig, ax = plt.subplots()\n+\n+ rectangle = Rectangle((.2, .2), .6, .6,\n+ facecolor=('blue', 0.2),\n+ edgecolor=('green', 0.5))\n+ ax.add_patch(rectangle)\n+\n+\n+Users can define a color using the new color specification, *(matplotlib_color, alpha)*.\n+Note that an explicit alpha keyword argument will override an alpha value from\n+*(matplotlib_color, alpha)*.\n" } ]
3.7
78bf53caacbb5ce0dc7aa73f07a74c99f1ed919b
[ "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr]", "lib/matplotlib/tests/test_colors.py::test_LogNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[1-result2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar]", "lib/matplotlib/tests/test_colors.py::test_colormap_copy", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg_r]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_default", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral]", "lib/matplotlib/tests/test_colors.py::test_colormap_endian", "lib/matplotlib/tests/test_colors.py::test_autoscale_masked", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VmaxEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_norm_callback", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern_r]", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[under]", "lib/matplotlib/tests/test_colors.py::test_unregister_builtin_cmap", "lib/matplotlib/tests/test_colors.py::test_Normalize", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow_r]", "lib/matplotlib/tests/test_colors.py::test_conversions", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_colorbar", "lib/matplotlib/tests/test_colors.py::test_light_source_topo_surface[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_TwoSlopeNorm_VminGTVmax", "lib/matplotlib/tests/test_colors.py::test_CenteredNorm", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center_max", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_bad_data_with_alpha", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG]", "lib/matplotlib/tests/test_colors.py::test_index_dtype[int]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges]", "lib/matplotlib/tests/test_colors.py::test_conversions_masked", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd]", "lib/matplotlib/tests/test_colors.py::test_LogNorm_inverse", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2]", "lib/matplotlib/tests/test_colors.py::test_grey_gray", "lib/matplotlib/tests/test_colors.py::test_scalarmappable_norm_update", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper_r]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[pdf]", "lib/matplotlib/tests/test_colors.py::test_register_cmap", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Odd", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmax", "lib/matplotlib/tests/test_colors.py::test_pandas_iterable", "lib/matplotlib/tests/test_colors.py::test_2d_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot_r]", "lib/matplotlib/tests/test_colors.py::test_index_dtype[float16]", "lib/matplotlib/tests/test_colors.py::TestAsinhNorm::test_init", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[5-result0]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_invalid", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu_r]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[2-result1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm]", "lib/matplotlib/tests/test_colors.py::test_same_color", "lib/matplotlib/tests/test_colors.py::test_cm_set_cmap_error", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scale", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool_r]", "lib/matplotlib/tests/test_colors.py::test_make_norm_from_scale_name", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv_r]", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[over]", "lib/matplotlib/tests/test_colors.py::test_norm_deepcopy", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu]", "lib/matplotlib/tests/test_colors.py::test_index_dtype[uint8]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_empty_mask", "lib/matplotlib/tests/test_colors.py::test_light_source_planar_hillshading", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent_r]", "lib/matplotlib/tests/test_colors.py::test_boundarynorm_and_colorbarbase[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix]", "lib/matplotlib/tests/test_colors.py::test_ndarray_subclass_norm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges_r]", "lib/matplotlib/tests/test_colors.py::test_BoundaryNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues]", "lib/matplotlib/tests/test_colors.py::test_set_dict_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_single_zero", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[-1-2]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VcenterGTVmax", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20_r]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1]", "lib/matplotlib/tests/test_colors.py::test_colormap_return_types", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean]", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[3-1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm_translation_invariance", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma]", "lib/matplotlib/tests/test_colors.py::test_hex_shorthand_notation", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis_r]", "lib/matplotlib/tests/test_colors.py::test_color_names", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2_r]", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[bad]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu]", "lib/matplotlib/tests/test_colors.py::test_repr_html", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale", "lib/matplotlib/tests/test_colors.py::test_failed_conversions", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag]", "lib/matplotlib/tests/test_colors.py::test_rgb_hsv_round_trip", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples]", "lib/matplotlib/tests/test_colors.py::test_repr_png", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_alpha_array", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain]", "lib/matplotlib/tests/test_colors.py::test_light_source_hillshading", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow]", "lib/matplotlib/tests/test_colors.py::test_has_alpha_channel", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy]", "lib/matplotlib/tests/test_colors.py::test_light_source_masked_shading", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminGTVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_single_str", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet]", "lib/matplotlib/tests/test_colors.py::test_resampled", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn_r]", "lib/matplotlib/tests/test_colors.py::test_tableau_order", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth]", "lib/matplotlib/tests/test_colors.py::test_colormaps_get_cmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted_r]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[png]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_alpha_array", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmin", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds]", "lib/matplotlib/tests/test_colors.py::test_index_dtype[float]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_premature_scaling", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_equals", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary]", "lib/matplotlib/tests/test_colors.py::TestAsinhNorm::test_norm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy_r]", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis]", "lib/matplotlib/tests/test_colors.py::test_color_sequences", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary_r]", "lib/matplotlib/tests/test_colors.py::test_cn", "lib/matplotlib/tests/test_colors.py::test_get_under_over_bad", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Even", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens_r]", "lib/matplotlib/tests/test_colors.py::test_FuncNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo_r]" ]
[ "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_accepts_color_alpha_tuple", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_explicit_alpha_overrides_tuple_alpha", "lib/matplotlib/tests/test_colors.py::test_to_rgba_error_with_color_invalid_alpha_tuple", "lib/matplotlib/tests/test_colors.py::test_to_rgba_accepts_color_alpha_tuple[rgba_alpha1]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_accepts_color_alpha_tuple[rgba_alpha3]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_accepts_color_alpha_tuple[rgba_alpha0]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_accepts_color_alpha_tuple_with_multiple_colors", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_error_with_color_invalid_alpha_tuple", "lib/matplotlib/tests/test_colors.py::test_to_rgba_accepts_color_alpha_tuple[rgba_alpha2]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_explicit_alpha_overrides_tuple_alpha" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "file", "name": "galleries/examples/color/set_alpha.py" } ] }
[ { "path": "doc/users/next_whats_new/new_color_spec_tuple.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/new_color_spec_tuple.rst", "metadata": "diff --git a/doc/users/next_whats_new/new_color_spec_tuple.rst b/doc/users/next_whats_new/new_color_spec_tuple.rst\nnew file mode 100644\nindex 000000000000..9f8d0ecabc3e\n--- /dev/null\n+++ b/doc/users/next_whats_new/new_color_spec_tuple.rst\n@@ -0,0 +1,21 @@\n+Add a new valid color format ``(matplotlib_color, alpha)``\n+----------------------------------------------------------\n+\n+\n+.. plot::\n+ :include-source: true\n+\n+ import matplotlib.pyplot as plt\n+ from matplotlib.patches import Rectangle\n+\n+ fig, ax = plt.subplots()\n+\n+ rectangle = Rectangle((.2, .2), .6, .6,\n+ facecolor=('blue', 0.2),\n+ edgecolor=('green', 0.5))\n+ ax.add_patch(rectangle)\n+\n+\n+Users can define a color using the new color specification, *(matplotlib_color, alpha)*.\n+Note that an explicit alpha keyword argument will override an alpha value from\n+*(matplotlib_color, alpha)*.\n" } ]
diff --git a/doc/users/next_whats_new/new_color_spec_tuple.rst b/doc/users/next_whats_new/new_color_spec_tuple.rst new file mode 100644 index 000000000000..9f8d0ecabc3e --- /dev/null +++ b/doc/users/next_whats_new/new_color_spec_tuple.rst @@ -0,0 +1,21 @@ +Add a new valid color format ``(matplotlib_color, alpha)`` +---------------------------------------------------------- + + +.. plot:: + :include-source: true + + import matplotlib.pyplot as plt + from matplotlib.patches import Rectangle + + fig, ax = plt.subplots() + + rectangle = Rectangle((.2, .2), .6, .6, + facecolor=('blue', 0.2), + edgecolor=('green', 0.5)) + ax.add_patch(rectangle) + + +Users can define a color using the new color specification, *(matplotlib_color, alpha)*. +Note that an explicit alpha keyword argument will override an alpha value from +*(matplotlib_color, alpha)*. If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'file', 'name': 'galleries/examples/color/set_alpha.py'}]
matplotlib/matplotlib
matplotlib__matplotlib-24759
https://github.com/matplotlib/matplotlib/pull/24759
diff --git a/doc/users/next_whats_new/reverse_legend.rst b/doc/users/next_whats_new/reverse_legend.rst new file mode 100644 index 000000000000..00f2c0dbeac7 --- /dev/null +++ b/doc/users/next_whats_new/reverse_legend.rst @@ -0,0 +1,4 @@ +Reversed order of legend entries +-------------------------------- +The order of legend entries can now be reversed by passing ``reverse=True`` to +`~.Axes.legend`. diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 82f92167c55c..c61be2c5550a 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -209,6 +209,12 @@ def _update_bbox_to_anchor(self, loc_in_canvas): If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label. +reverse : bool, default: False + If *True*, the legend labels are displayed in reverse order from the input. + If *False*, the legend labels are displayed in the same order as the input. + + ..versionadded:: 3.7 + frameon : bool, default: :rc:`legend.frameon` Whether the legend should be drawn on a patch (frame). @@ -312,6 +318,7 @@ def __init__( numpoints=None, # number of points in the legend line markerscale=None, # relative size of legend markers vs. original markerfirst=True, # left/right ordering of legend marker and label + reverse=False, # reverse ordering of legend marker and label scatterpoints=None, # number of scatter points scatteryoffsets=None, prop=None, # properties for the legend texts @@ -437,6 +444,10 @@ def val_or_rc(val, rc_name): _hand.append(handle) labels, handles = _lab, _hand + if reverse: + labels.reverse() + handles.reverse() + handles = list(handles) if len(handles) < 2: ncols = 1
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index 0016dc4d2d14..56794a3428b8 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -294,6 +294,38 @@ def test_legend_remove(): assert ax.get_legend() is None +def test_reverse_legend_handles_and_labels(): + """Check that the legend handles and labels are reversed.""" + fig, ax = plt.subplots() + x = 1 + y = 1 + labels = ["First label", "Second label", "Third label"] + markers = ['.', ',', 'o'] + + ax.plot(x, y, markers[0], label=labels[0]) + ax.plot(x, y, markers[1], label=labels[1]) + ax.plot(x, y, markers[2], label=labels[2]) + leg = ax.legend(reverse=True) + actual_labels = [t.get_text() for t in leg.get_texts()] + actual_markers = [h.get_marker() for h in leg.legend_handles] + assert actual_labels == list(reversed(labels)) + assert actual_markers == list(reversed(markers)) + + +@check_figures_equal(extensions=["png"]) +def test_reverse_legend_display(fig_test, fig_ref): + """Check that the rendered legend entries are reversed""" + ax = fig_test.subplots() + ax.plot([1], 'ro', label="first") + ax.plot([2], 'bx', label="second") + ax.legend(reverse=True) + + ax = fig_ref.subplots() + ax.plot([2], 'bx', label="second") + ax.plot([1], 'ro', label="first") + ax.legend() + + class TestLegendFunction: # Tests the legend function on the Axes and pyplot. def test_legend_no_args(self):
[ { "path": "doc/users/next_whats_new/reverse_legend.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/reverse_legend.rst", "metadata": "diff --git a/doc/users/next_whats_new/reverse_legend.rst b/doc/users/next_whats_new/reverse_legend.rst\nnew file mode 100644\nindex 000000000000..00f2c0dbeac7\n--- /dev/null\n+++ b/doc/users/next_whats_new/reverse_legend.rst\n@@ -0,0 +1,4 @@\n+Reversed order of legend entries\n+--------------------------------\n+The order of legend entries can now be reversed by passing ``reverse=True`` to\n+`~.Axes.legend`.\n" } ]
3.5
b62376ce3b7a87d163b0482df94ae11601b66965
[ "lib/matplotlib/tests/test_legend.py::test_legend_auto1[png]", "lib/matplotlib/tests/test_legend.py::test_framealpha[png]", "lib/matplotlib/tests/test_legend.py::test_alpha_rcparam[png]", "lib/matplotlib/tests/test_legend.py::test_cross_figure_patch_legend", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[False]", "lib/matplotlib/tests/test_legend.py::test_rc[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_title_fontprop_fontsize", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::test_setting_alpha_keeps_polycollection_color", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter_transform[png]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[int]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_three_args", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_only", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor_short", "lib/matplotlib/tests/test_legend.py::test_legend_label_with_leading_underscore", "lib/matplotlib/tests/test_legend.py::test_legend_title_empty", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_framealpha[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_legend_expand[pdf]", "lib/matplotlib/tests/test_legend.py::test_various_labels[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_list", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_handler_map", "lib/matplotlib/tests/test_legend.py::test_alpha_rgba[png]", "lib/matplotlib/tests/test_legend.py::test_fancy[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[none]", "lib/matplotlib/tests/test_legend.py::test_get_set_draggable", "lib/matplotlib/tests/test_legend.py::test_window_extent_cached_renderer", "lib/matplotlib/tests/test_legend.py::test_subfigure_legend", "lib/matplotlib/tests/test_legend.py::test_nanscatter", "lib/matplotlib/tests/test_legend.py::test_empty_bar_chart_with_legend", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[none]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[svg]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_handle_label", "lib/matplotlib/tests/test_legend.py::test_linecollection_scaled_dashes", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_markers_from_line2d", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_labels_only", "lib/matplotlib/tests/test_legend.py::test_fancy[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_labels", "lib/matplotlib/tests/test_legend.py::test_alpha_handles", "lib/matplotlib/tests/test_legend.py::test_multiple_keys[png]", "lib/matplotlib/tests/test_legend.py::test_legend_ordereddict", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_various_labels[svg]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_kw_args", "lib/matplotlib/tests/test_legend.py::test_legend_expand[png]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_fancy[svg]", "lib/matplotlib/tests/test_legend.py::test_text_nohandler_warning", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_linecolor", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[pdf]", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_arg", "lib/matplotlib/tests/test_legend.py::test_rc[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args_pluskw", "lib/matplotlib/tests/test_legend.py::test_hatching[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[color2]", "lib/matplotlib/tests/test_legend.py::test_warn_big_data_best_loc", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_warn_mixed_args_and_kwargs", "lib/matplotlib/tests/test_legend.py::test_legend_proper_window_extent", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_parasite", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_label_incorrect_length_exception", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_legend_face_edgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_stackplot[png]", "lib/matplotlib/tests/test_legend.py::test_legend_repeatcheckok", "lib/matplotlib/tests/test_legend.py::test_handler_numpoints", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_rc[svg]", "lib/matplotlib/tests/test_legend.py::test_handlerline2d", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_legend_auto5", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[pdf]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[color2]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_auto4", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markfacecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_no_warn_big_data_when_loc_specified", "lib/matplotlib/tests/test_legend.py::test_framealpha[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_expand[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_only", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_labels", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor_short", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[True]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[left]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args", "lib/matplotlib/tests/test_legend.py::test_labels_first[png]", "lib/matplotlib/tests/test_legend.py::test_hatching[svg]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[1]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_legend_text_axes", "lib/matplotlib/tests/test_legend.py::test_legend_remove", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_labels_only", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_hatching[pdf]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[one]", "lib/matplotlib/tests/test_legend.py::test_various_labels[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_shadow_framealpha", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_warn_args_kwargs", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[left]" ]
[ "lib/matplotlib/tests/test_legend.py::test_reverse_legend_handles_and_labels", "lib/matplotlib/tests/test_legend.py::test_reverse_legend_display[png]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/reverse_legend.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/reverse_legend.rst", "metadata": "diff --git a/doc/users/next_whats_new/reverse_legend.rst b/doc/users/next_whats_new/reverse_legend.rst\nnew file mode 100644\nindex 000000000000..00f2c0dbeac7\n--- /dev/null\n+++ b/doc/users/next_whats_new/reverse_legend.rst\n@@ -0,0 +1,4 @@\n+Reversed order of legend entries\n+--------------------------------\n+The order of legend entries can now be reversed by passing ``reverse=True`` to\n+`~.Axes.legend`.\n" } ]
diff --git a/doc/users/next_whats_new/reverse_legend.rst b/doc/users/next_whats_new/reverse_legend.rst new file mode 100644 index 000000000000..00f2c0dbeac7 --- /dev/null +++ b/doc/users/next_whats_new/reverse_legend.rst @@ -0,0 +1,4 @@ +Reversed order of legend entries +-------------------------------- +The order of legend entries can now be reversed by passing ``reverse=True`` to +`~.Axes.legend`.
matplotlib/matplotlib
matplotlib__matplotlib-25821
https://github.com/matplotlib/matplotlib/pull/25821
diff --git a/doc/api/toolkits/mplot3d/axes3d.rst b/doc/api/toolkits/mplot3d/axes3d.rst index 99c57db64d9a..f6d8e2529896 100644 --- a/doc/api/toolkits/mplot3d/axes3d.rst +++ b/doc/api/toolkits/mplot3d/axes3d.rst @@ -209,6 +209,7 @@ Sharing :nosignatures: sharez + shareview Interactive diff --git a/doc/users/next_whats_new/3d_plots_shareview.rst b/doc/users/next_whats_new/3d_plots_shareview.rst new file mode 100644 index 000000000000..e71d06fd9297 --- /dev/null +++ b/doc/users/next_whats_new/3d_plots_shareview.rst @@ -0,0 +1,7 @@ +3D plots can share view angles +------------------------------ + +3D plots can now share the same view angles, so that when you rotate one plot +the other plots also rotate. This can be done with the *shareview* keyword +argument when adding an axes, or by using the *ax1.shareview(ax2)* method of +existing 3D axes. diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 35b0aaa01f97..cf2722eb4aae 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -56,6 +56,7 @@ class Axes3D(Axes): _axis_names = ("x", "y", "z") Axes._shared_axes["z"] = cbook.Grouper() + Axes._shared_axes["view"] = cbook.Grouper() vvec = _api.deprecate_privatize_attribute("3.7") eye = _api.deprecate_privatize_attribute("3.7") @@ -66,6 +67,7 @@ def __init__( self, fig, rect=None, *args, elev=30, azim=-60, roll=0, sharez=None, proj_type='persp', box_aspect=None, computed_zorder=True, focal_length=None, + shareview=None, **kwargs): """ Parameters @@ -111,6 +113,8 @@ def __init__( or infinity (numpy.inf). If None, defaults to infinity. The focal length can be computed from a desired Field Of View via the equation: focal_length = 1/tan(FOV/2) + shareview : Axes3D, optional + Other Axes to share view angles with. **kwargs Other optional keyword arguments: @@ -142,6 +146,10 @@ def __init__( self._shared_axes["z"].join(self, sharez) self._adjustable = 'datalim' + self._shareview = shareview + if shareview is not None: + self._shared_axes["view"].join(self, shareview) + if kwargs.pop('auto_add_to_figure', False): raise AttributeError( 'auto_add_to_figure is no longer supported for Axes3D. ' @@ -757,7 +765,8 @@ def clabel(self, *args, **kwargs): """Currently not implemented for 3D axes, and returns *None*.""" return None - def view_init(self, elev=None, azim=None, roll=None, vertical_axis="z"): + def view_init(self, elev=None, azim=None, roll=None, vertical_axis="z", + share=False): """ Set the elevation and azimuth of the axes in degrees (not radians). @@ -804,29 +813,34 @@ def view_init(self, elev=None, azim=None, roll=None, vertical_axis="z"): constructor is used. vertical_axis : {"z", "x", "y"}, default: "z" The axis to align vertically. *azim* rotates about this axis. + share : bool, default: False + If ``True``, apply the settings to all Axes with shared views. """ self._dist = 10 # The camera distance from origin. Behaves like zoom if elev is None: - self.elev = self.initial_elev - else: - self.elev = elev - + elev = self.initial_elev if azim is None: - self.azim = self.initial_azim - else: - self.azim = azim - + azim = self.initial_azim if roll is None: - self.roll = self.initial_roll - else: - self.roll = roll - - self._vertical_axis = _api.check_getitem( + roll = self.initial_roll + vertical_axis = _api.check_getitem( dict(x=0, y=1, z=2), vertical_axis=vertical_axis ) + if share: + axes = {sibling for sibling + in self._shared_axes['view'].get_siblings(self)} + else: + axes = [self] + + for ax in axes: + ax.elev = elev + ax.azim = azim + ax.roll = roll + ax._vertical_axis = vertical_axis + def set_proj_type(self, proj_type, focal_length=None): """ Set the projection type. @@ -964,7 +978,7 @@ def sharez(self, other): Axes, and cannot be used if the z-axis is already being shared with another Axes. """ - _api.check_isinstance(maxes._base._AxesBase, other=other) + _api.check_isinstance(Axes3D, other=other) if self._sharez is not None and other is not self._sharez: raise ValueError("z-axis is already shared") self._shared_axes["z"].join(self, other) @@ -975,6 +989,23 @@ def sharez(self, other): self.set_zlim(z0, z1, emit=False, auto=other.get_autoscalez_on()) self.zaxis._scale = other.zaxis._scale + def shareview(self, other): + """ + Share the view angles with *other*. + + This is equivalent to passing ``shareview=other`` when + constructing the Axes, and cannot be used if the view angles are + already being shared with another Axes. + """ + _api.check_isinstance(Axes3D, other=other) + if self._shareview is not None and other is not self._shareview: + raise ValueError("view angles are already shared") + self._shared_axes["view"].join(self, other) + self._shareview = other + vertical_axis = {0: "x", 1: "y", 2: "z"}[other._vertical_axis] + self.view_init(elev=other.elev, azim=other.azim, roll=other.roll, + vertical_axis=vertical_axis, share=True) + def clear(self): # docstring inherited. super().clear() @@ -1107,8 +1138,9 @@ def _on_move(self, event): roll = np.deg2rad(self.roll) delev = -(dy/h)*180*np.cos(roll) + (dx/w)*180*np.sin(roll) dazim = -(dy/h)*180*np.sin(roll) - (dx/w)*180*np.cos(roll) - self.elev = self.elev + delev - self.azim = self.azim + dazim + elev = self.elev + delev + azim = self.azim + dazim + self.view_init(elev=elev, azim=azim, roll=roll, share=True) self.stale = True elif self.button_pressed in self._pan_btn:
diff --git a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py index 3b890d31ae44..f4114e7be511 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py @@ -1689,6 +1689,20 @@ def test_set_zlim(): ax.set_zlim(top=0, zmax=1) +@check_figures_equal(extensions=["png"]) +def test_shared_view(fig_test, fig_ref): + elev, azim, roll = 5, 20, 30 + ax1 = fig_test.add_subplot(131, projection="3d") + ax2 = fig_test.add_subplot(132, projection="3d", shareview=ax1) + ax3 = fig_test.add_subplot(133, projection="3d") + ax3.shareview(ax1) + ax2.view_init(elev=elev, azim=azim, roll=roll, share=True) + + for subplot_num in (131, 132, 133): + ax = fig_ref.add_subplot(subplot_num, projection="3d") + ax.view_init(elev=elev, azim=azim, roll=roll) + + def test_shared_axes_retick(): fig = plt.figure() ax1 = fig.add_subplot(211, projection="3d")
[ { "path": "doc/api/toolkits/mplot3d/axes3d.rst", "old_path": "a/doc/api/toolkits/mplot3d/axes3d.rst", "new_path": "b/doc/api/toolkits/mplot3d/axes3d.rst", "metadata": "diff --git a/doc/api/toolkits/mplot3d/axes3d.rst b/doc/api/toolkits/mplot3d/axes3d.rst\nindex 99c57db64d9a..f6d8e2529896 100644\n--- a/doc/api/toolkits/mplot3d/axes3d.rst\n+++ b/doc/api/toolkits/mplot3d/axes3d.rst\n@@ -209,6 +209,7 @@ Sharing\n :nosignatures:\n \n sharez\n+ shareview\n \n \n Interactive\n" }, { "path": "doc/users/next_whats_new/3d_plots_shareview.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/3d_plots_shareview.rst", "metadata": "diff --git a/doc/users/next_whats_new/3d_plots_shareview.rst b/doc/users/next_whats_new/3d_plots_shareview.rst\nnew file mode 100644\nindex 000000000000..e71d06fd9297\n--- /dev/null\n+++ b/doc/users/next_whats_new/3d_plots_shareview.rst\n@@ -0,0 +1,7 @@\n+3D plots can share view angles\n+------------------------------\n+\n+3D plots can now share the same view angles, so that when you rotate one plot\n+the other plots also rotate. This can be done with the *shareview* keyword\n+argument when adding an axes, or by using the *ax1.shareview(ax2)* method of\n+existing 3D axes.\n" } ]
3.7
4bdae2e004b29d075f96a7dbbee918f7dfb13ed1
[ "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_ax3d_tickcolour", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_view_init_vertical_axis[x-proj_expected2-axis_lines_expected2-tickdirs_expected2]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_modification[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_sorting[png-True]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_ylim3d-top-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_rgb_data[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_view_init_vertical_axis[z-proj_expected0-axis_lines_expected0-tickdirs_expected0]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_proj_transform", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contour3d_1d_input", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_panecolor_rcparams[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_zlim3d-bottom-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_plotsurface_1d_raises", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_xlim3d-right-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_tight_layout_text[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_bar3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_ylim3d-bottom-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_world", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_set_zlim", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_calling_conventions", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_stem3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_lines3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_shared_axes_retick", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_zlim3d-bottom-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_arc_pathpatch[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_named_colors[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[True-x]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contourf3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_cla[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_aspects_adjust_box[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_proj_axes_cube_ortho[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_aspects[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_rotated[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contourf3d_extend[png-min-levels1]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_bar3d_shaded[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_surface3d_masked_strides[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[pan-1-None-expected4]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_plot_scalar[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_primary_views[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_color[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_lines_dists_nowarning", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_quiver3d_empty[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args5-kwargs5-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_pathpatch_3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_mutating_input_arrays_y_and_z[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_patch_modification", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_minor_ticks[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_equal_box_aspect[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_marker_draw_order_view_rotated[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_add_collection3d_zs_scalar[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_errorbar3d_errorevery[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_bar3d_notshaded[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_ortho[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contourf3d_extend[png-both-levels0]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invisible_axes[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_wireframe3dzerocstride[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_mixedsamplesraises", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[TypeError-args7-kwargs7-Cannot pass both positional and keyword]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_ticklabel_format[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_bar3d_colors", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_focal_length[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_quiver3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter_spiral[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[zoom-1-None-expected0]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_simple[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[zoom-1-y-expected2]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[True-z]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_repr", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_inverted_cla", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_poly3dcollection_closed[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_poly3dcollection_alpha[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_tricontour[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_trisurf3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contourf3d_extend[png-max-levels2]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_ylim3d-bottom-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_bar3d_lightsource", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_linewidth_modification[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invisible_ticks_axis[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_line_data", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_text_3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_get_axis_position", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_Poly3DCollection_get_edgecolor", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_plot_3d_from_2d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_alpha[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_lines_dists[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_line3d_set_get_data_3d", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_poly_collection_2d_to_3d_empty", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_text3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_add_collection3d_zs_array[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_surface3d_masked[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[True-y]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args4-kwargs4-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[None-x]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_plot_surface_None_arg[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_xlim3d-left-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_labelpad[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_trisurf3d_shaded[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_wireframe3dzerostrideraises", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_inverted[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_zlim3d-top-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[False-z]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_xyz[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_ylim3d-top-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_linewidth[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_pan", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_draw_single_lines_from_Nx1", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_subfigure_simple", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_surface3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[zoom-1-x-expected1]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_quiver3d_masked[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_focal_length_checks", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_marker_draw_order_data_reversed[png-130]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_Poly3DCollection_get_facecolor", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_autoscale", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_grid_off[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_surface3d_shaded[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contour3d_extend3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_computed_zorder[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_xlim3d-left-inf]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_text3d_modification[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_patch_collection_modification[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_axes3d_isometric[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_quiver3D_smoke[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[False-y]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_colorbar_pos", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[False-x]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_wireframe3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_inverted_zaxis", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[TypeError-args9-kwargs9-Must pass a single positional argument for]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_format_coord", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_errorbar3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_xlim3d-right-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[None-y]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scalarmap_update[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_wireframe3dzerorstride[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[TypeError-args8-kwargs8-Cannot pass both positional and keyword]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_mixedsubplots[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_proj_axes_cube[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[pan-1-y-expected6]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contourf3d_fill[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_unautoscale[None-z]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[pan-1-x-expected5]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::TestVoxels::test_edge_style[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_poly3dcollection_verts_validation", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invalid_axes_limits[set_zlim3d-top-nan]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_contour3d[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_toolbar_zoom_pan[zoom-3-None-expected3]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_margins_errors[TypeError-args6-kwargs6-Cannot pass both positional and keyword]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter3d_sorting[png-False]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_view_init_vertical_axis[y-proj_expected1-axis_lines_expected1-tickdirs_expected1]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_marker_draw_order_data_reversed[png--50]" ]
[ "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_shared_view[png]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/api/toolkits/mplot3d/axes3d.rst", "old_path": "a/doc/api/toolkits/mplot3d/axes3d.rst", "new_path": "b/doc/api/toolkits/mplot3d/axes3d.rst", "metadata": "diff --git a/doc/api/toolkits/mplot3d/axes3d.rst b/doc/api/toolkits/mplot3d/axes3d.rst\nindex 99c57db64d9a..f6d8e2529896 100644\n--- a/doc/api/toolkits/mplot3d/axes3d.rst\n+++ b/doc/api/toolkits/mplot3d/axes3d.rst\n@@ -209,6 +209,7 @@ Sharing\n :nosignatures:\n \n sharez\n+ shareview\n \n \n Interactive\n" }, { "path": "doc/users/next_whats_new/3d_plots_shareview.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/3d_plots_shareview.rst", "metadata": "diff --git a/doc/users/next_whats_new/3d_plots_shareview.rst b/doc/users/next_whats_new/3d_plots_shareview.rst\nnew file mode 100644\nindex 000000000000..e71d06fd9297\n--- /dev/null\n+++ b/doc/users/next_whats_new/3d_plots_shareview.rst\n@@ -0,0 +1,7 @@\n+3D plots can share view angles\n+------------------------------\n+\n+3D plots can now share the same view angles, so that when you rotate one plot\n+the other plots also rotate. This can be done with the *shareview* keyword\n+argument when adding an axes, or by using the *ax1.shareview(ax2)* method of\n+existing 3D axes.\n" } ]
diff --git a/doc/api/toolkits/mplot3d/axes3d.rst b/doc/api/toolkits/mplot3d/axes3d.rst index 99c57db64d9a..f6d8e2529896 100644 --- a/doc/api/toolkits/mplot3d/axes3d.rst +++ b/doc/api/toolkits/mplot3d/axes3d.rst @@ -209,6 +209,7 @@ Sharing :nosignatures: sharez + shareview Interactive diff --git a/doc/users/next_whats_new/3d_plots_shareview.rst b/doc/users/next_whats_new/3d_plots_shareview.rst new file mode 100644 index 000000000000..e71d06fd9297 --- /dev/null +++ b/doc/users/next_whats_new/3d_plots_shareview.rst @@ -0,0 +1,7 @@ +3D plots can share view angles +------------------------------ + +3D plots can now share the same view angles, so that when you rotate one plot +the other plots also rotate. This can be done with the *shareview* keyword +argument when adding an axes, or by using the *ax1.shareview(ax2)* method of +existing 3D axes.
matplotlib/matplotlib
matplotlib__matplotlib-25686
https://github.com/matplotlib/matplotlib/pull/25686
diff --git a/doc/users/next_whats_new/get_suptitle.rst b/doc/users/next_whats_new/get_suptitle.rst new file mode 100644 index 000000000000..b03ad10b1b4c --- /dev/null +++ b/doc/users/next_whats_new/get_suptitle.rst @@ -0,0 +1,4 @@ +``Figure.get_suptitle()``, ``Figure.get_supxlabel()``, ``Figure.get_supylabel()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These methods return the strings set by ``Figure.suptitle()``, ``Figure.supxlabel()`` +and ``Figure.supylabel()`` respectively. diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 7fdcc8cb6627..970bf957d4bf 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -388,6 +388,11 @@ def suptitle(self, t, **kwargs): 'size': 'figure.titlesize', 'weight': 'figure.titleweight'} return self._suplabels(t, info, **kwargs) + def get_suptitle(self): + """Return the suptitle as string or an empty string if not set.""" + text_obj = self._suptitle + return "" if text_obj is None else text_obj.get_text() + @_docstring.Substitution(x0=0.5, y0=0.01, name='supxlabel', ha='center', va='bottom', rc='label') @_docstring.copy(_suplabels) @@ -398,6 +403,11 @@ def supxlabel(self, t, **kwargs): 'size': 'figure.labelsize', 'weight': 'figure.labelweight'} return self._suplabels(t, info, **kwargs) + def get_supxlabel(self): + """Return the supxlabel as string or an empty string if not set.""" + text_obj = self._supxlabel + return "" if text_obj is None else text_obj.get_text() + @_docstring.Substitution(x0=0.02, y0=0.5, name='supylabel', ha='left', va='center', rc='label') @_docstring.copy(_suplabels) @@ -409,6 +419,11 @@ def supylabel(self, t, **kwargs): 'weight': 'figure.labelweight'} return self._suplabels(t, info, **kwargs) + def get_supylabel(self): + """Return the supylabel as string or an empty string if not set.""" + text_obj = self._supylabel + return "" if text_obj is None else text_obj.get_text() + def get_edgecolor(self): """Get the edge color of the Figure rectangle.""" return self.patch.get_edgecolor() diff --git a/lib/matplotlib/figure.pyi b/lib/matplotlib/figure.pyi index ee21892f32ac..f4c31506a2e1 100644 --- a/lib/matplotlib/figure.pyi +++ b/lib/matplotlib/figure.pyi @@ -90,8 +90,11 @@ class FigureBase(Artist): def get_children(self) -> list[Artist]: ... def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict[Any, Any]]: ... def suptitle(self, t: str, **kwargs) -> Text: ... + def get_suptitle(self) -> str: ... def supxlabel(self, t: str, **kwargs) -> Text: ... + def get_supxlabel(self) -> str: ... def supylabel(self, t: str, **kwargs) -> Text: ... + def get_supylabel(self) -> str: ... def get_edgecolor(self) -> ColorType: ... def get_facecolor(self) -> ColorType: ... def get_frameon(self) -> bool: ...
diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index 4188ca878fed..d8f137ddd61a 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -302,6 +302,19 @@ def test_suptitle_subfigures(): assert sf2.get_facecolor() == (1.0, 1.0, 1.0, 1.0) +def test_get_suptitle_supxlabel_supylabel(): + fig, ax = plt.subplots() + assert fig.get_suptitle() == "" + assert fig.get_supxlabel() == "" + assert fig.get_supylabel() == "" + fig.suptitle('suptitle') + assert fig.get_suptitle() == 'suptitle' + fig.supxlabel('supxlabel') + assert fig.get_supxlabel() == 'supxlabel' + fig.supylabel('supylabel') + assert fig.get_supylabel() == 'supylabel' + + @image_comparison(['alpha_background'], # only test png and svg. The PDF output appears correct, # but Ghostscript does not preserve the background color.
[ { "path": "doc/users/next_whats_new/get_suptitle.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/get_suptitle.rst", "metadata": "diff --git a/doc/users/next_whats_new/get_suptitle.rst b/doc/users/next_whats_new/get_suptitle.rst\nnew file mode 100644\nindex 000000000000..b03ad10b1b4c\n--- /dev/null\n+++ b/doc/users/next_whats_new/get_suptitle.rst\n@@ -0,0 +1,4 @@\n+``Figure.get_suptitle()``, ``Figure.get_supxlabel()``, ``Figure.get_supylabel()``\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+These methods return the strings set by ``Figure.suptitle()``, ``Figure.supxlabel()``\n+and ``Figure.supylabel()`` respectively.\n" } ]
3.7
b86ebbafe4673583345d0a01a6ea205af34c58dc
[ "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_all_nested[png]", "lib/matplotlib/tests/test_figure.py::test_tightbbox_box_aspect[svg]", "lib/matplotlib/tests/test_figure.py::test_iterability_axes_argument", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_basic[x3-png]", "lib/matplotlib/tests/test_figure.py::test_savefig", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_width_ratios", "lib/matplotlib/tests/test_figure.py::test_change_dpi", "lib/matplotlib/tests/test_figure.py::test_too_many_figures", "lib/matplotlib/tests/test_figure.py::test_animated_with_canvas_change[svg]", "lib/matplotlib/tests/test_figure.py::test_figure_legend[pdf]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_basic[x1-png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x1-SKIP-png]", "lib/matplotlib/tests/test_figure.py::test_invalid_figure_size[1-nan]", "lib/matplotlib/tests/test_figure.py::test_figaspect", "lib/matplotlib/tests/test_figure.py::test_subplots_shareax_loglabels", "lib/matplotlib/tests/test_figure.py::test_figure_legend[svg]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[acb]", "lib/matplotlib/tests/test_figure.py::test_add_subplot_subclass", "lib/matplotlib/tests/test_figure.py::test_alpha[png]", "lib/matplotlib/tests/test_figure.py::test_set_fig_size", "lib/matplotlib/tests/test_figure.py::test_invalid_figure_add_axes", "lib/matplotlib/tests/test_figure.py::test_figure_label", "lib/matplotlib/tests/test_figure.py::test_valid_layouts", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_subplot_kw[subplot_kw1-png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_fail[AAA\\nc\\nBBB-All of the rows must be the same length]", "lib/matplotlib/tests/test_figure.py::test_invalid_figure_size[inf-1]", "lib/matplotlib/tests/test_figure.py::test_gridspec_no_mutate_input", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_hashable_keys[png]", "lib/matplotlib/tests/test_figure.py::test_figure[pdf]", "lib/matplotlib/tests/test_figure.py::test_gca", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_fail[x3-All of the rows must be the same length]", "lib/matplotlib/tests/test_figure.py::test_subfigure_dpi", "lib/matplotlib/tests/test_figure.py::test_axes_removal", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_tuple[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_fail[x1-There are duplicate keys .* between the outer layout]", "lib/matplotlib/tests/test_figure.py::test_autofmt_xdate[both]", "lib/matplotlib/tests/test_figure.py::test_add_axes_kwargs", "lib/matplotlib/tests/test_figure.py::test_tightbbox", "lib/matplotlib/tests/test_figure.py::test_add_subplot_invalid", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x3-None-png]", "lib/matplotlib/tests/test_figure.py::test_clf_not_redefined", "lib/matplotlib/tests/test_figure.py::test_add_subplot_twotuple", "lib/matplotlib/tests/test_figure.py::test_animated_with_canvas_change[pdf]", "lib/matplotlib/tests/test_figure.py::test_figure[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested[png]", "lib/matplotlib/tests/test_figure.py::test_savefig_preserve_layout_engine", "lib/matplotlib/tests/test_figure.py::test_subfigure_scatter_size[png]", "lib/matplotlib/tests/test_figure.py::test_figure[svg]", "lib/matplotlib/tests/test_figure.py::test_savefig_transparent[png]", "lib/matplotlib/tests/test_figure.py::test_fspath[ps]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_single_str_input[\\nAAA\\nBBB\\n-png]", "lib/matplotlib/tests/test_figure.py::test_deepcopy", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[cab]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[tiff]", "lib/matplotlib/tests/test_figure.py::test_picking_does_not_stale", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[rgba]", "lib/matplotlib/tests/test_figure.py::test_waitforbuttonpress", "lib/matplotlib/tests/test_figure.py::test_subfigure_spanning", "lib/matplotlib/tests/test_figure.py::test_layout_change_warning[compressed]", "lib/matplotlib/tests/test_figure.py::test_invalid_figure_size[-1-1]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[abc]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x0-None-png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_user_order", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[webp]", "lib/matplotlib/tests/test_figure.py::test_subfigure[png]", "lib/matplotlib/tests/test_figure.py::test_rcparams[png]", "lib/matplotlib/tests/test_figure.py::test_animated_with_canvas_change[eps]", "lib/matplotlib/tests/test_figure.py::test_alpha[svg]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[raw]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_basic[x0-png]", "lib/matplotlib/tests/test_figure.py::test_suptitle_fontproperties", "lib/matplotlib/tests/test_figure.py::test_fspath[png]", "lib/matplotlib/tests/test_figure.py::test_reused_gridspec", "lib/matplotlib/tests/test_figure.py::test_savefig_pixel_ratio[Agg]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[bac]", "lib/matplotlib/tests/test_figure.py::test_align_labels[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[cba]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_fail_list_of_str", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[ps]", "lib/matplotlib/tests/test_figure.py::test_add_artist[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_subplot_kw[None-png]", "lib/matplotlib/tests/test_figure.py::test_fignum_exists", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_share_all", "lib/matplotlib/tests/test_figure.py::test_add_artist[pdf]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_string_parser", "lib/matplotlib/tests/test_figure.py::test_figure_legend[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x4-SKIP-png]", "lib/matplotlib/tests/test_figure.py::test_autofmt_xdate[major]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[tif]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[svg]", "lib/matplotlib/tests/test_figure.py::test_layout_change_warning[constrained]", "lib/matplotlib/tests/test_figure.py::test_figure_clear[clear]", "lib/matplotlib/tests/test_figure.py::test_suptitle[png]", "lib/matplotlib/tests/test_figure.py::test_savefig_locate_colorbar", "lib/matplotlib/tests/test_figure.py::test_invalid_layouts", "lib/matplotlib/tests/test_figure.py::test_animated_with_canvas_change[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_subplot_kw[subplot_kw0-png]", "lib/matplotlib/tests/test_figure.py::test_fspath[svg]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_per_subplot_kw[multi_value1-png]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[svgz]", "lib/matplotlib/tests/test_figure.py::test_suptitle[pdf]", "lib/matplotlib/tests/test_figure.py::test_clf_keyword", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x2-0-png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_extra_per_subplot_kw", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_height_ratios", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[pdf]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_per_subplot_kw_expander", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_empty[x5-0-png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_single_str_input[AAA\\nBBB-png]", "lib/matplotlib/tests/test_figure.py::test_savefig_warns", "lib/matplotlib/tests/test_figure.py::test_kwargs_pass", "lib/matplotlib/tests/test_figure.py::test_subfigure_ticks", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[jpg]", "lib/matplotlib/tests/test_figure.py::test_savefig_backend", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[eps]", "lib/matplotlib/tests/test_figure.py::test_figure_repr", "lib/matplotlib/tests/test_figure.py::test_fspath[pdf]", "lib/matplotlib/tests/test_figure.py::test_subfigure_double[png]", "lib/matplotlib/tests/test_figure.py::test_tightlayout_autolayout_deconflict[png]", "lib/matplotlib/tests/test_figure.py::test_fspath[eps]", "lib/matplotlib/tests/test_figure.py::test_autofmt_xdate[minor]", "lib/matplotlib/tests/test_figure.py::test_suptitle_subfigures", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_fail[x0-(?m)we found that the label .A. specifies a non-rectangular or non-contiguous area.]", "lib/matplotlib/tests/test_figure.py::test_axes_remove", "lib/matplotlib/tests/test_figure.py::test_subfigure_tightbbox", "lib/matplotlib/tests/test_figure.py::test_align_labels[svg]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_per_subplot_kw[BC-png]", "lib/matplotlib/tests/test_figure.py::test_align_labels_stray_axes", "lib/matplotlib/tests/test_figure.py::test_subfigure_ss[png]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_single_str_input[ABC\\nDEF-png]", "lib/matplotlib/tests/test_figure.py::test_subfigure_pdf", "lib/matplotlib/tests/test_figure.py::test_removed_axis", "lib/matplotlib/tests/test_figure.py::test_unpickle_with_device_pixel_ratio", "lib/matplotlib/tests/test_figure.py::test_figure_clear[clf]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_user_order[bca]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata[png]", "lib/matplotlib/tests/test_figure.py::test_add_subplot_kwargs", "lib/matplotlib/tests/test_figure.py::test_suptitle[svg]", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_basic[x2-png]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[jpeg]" ]
[ "lib/matplotlib/tests/test_figure.py::test_get_suptitle_supxlabel_supylabel" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/get_suptitle.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/get_suptitle.rst", "metadata": "diff --git a/doc/users/next_whats_new/get_suptitle.rst b/doc/users/next_whats_new/get_suptitle.rst\nnew file mode 100644\nindex 000000000000..b03ad10b1b4c\n--- /dev/null\n+++ b/doc/users/next_whats_new/get_suptitle.rst\n@@ -0,0 +1,4 @@\n+``Figure.get_suptitle()``, ``Figure.get_supxlabel()``, ``Figure.get_supylabel()``\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+These methods return the strings set by ``Figure.suptitle()``, ``Figure.supxlabel()``\n+and ``Figure.supylabel()`` respectively.\n" } ]
diff --git a/doc/users/next_whats_new/get_suptitle.rst b/doc/users/next_whats_new/get_suptitle.rst new file mode 100644 index 000000000000..b03ad10b1b4c --- /dev/null +++ b/doc/users/next_whats_new/get_suptitle.rst @@ -0,0 +1,4 @@ +``Figure.get_suptitle()``, ``Figure.get_supxlabel()``, ``Figure.get_supylabel()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These methods return the strings set by ``Figure.suptitle()``, ``Figure.supxlabel()`` +and ``Figure.supylabel()`` respectively.
matplotlib/matplotlib
matplotlib__matplotlib-23191
https://github.com/matplotlib/matplotlib/pull/23191
diff --git a/doc/users/next_whats_new/width_height_ratios.rst b/doc/users/next_whats_new/width_height_ratios.rst new file mode 100644 index 000000000000..017c34a55cc4 --- /dev/null +++ b/doc/users/next_whats_new/width_height_ratios.rst @@ -0,0 +1,7 @@ +``subplots``, ``subplot_mosaic`` accept *height_ratios* and *width_ratios* arguments +------------------------------------------------------------------------------------ + +The relative width and height of columns and rows in `~.Figure.subplots` and +`~.Figure.subplot_mosaic` can be controlled by passing *height_ratios* and +*width_ratios* keyword arguments to the methods. Previously, this required +passing the ratios in *gridspec_kws* arguments. diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index f8aa99d48a09..dedaaa7dcf5a 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -764,7 +764,8 @@ def _add_axes_internal(self, ax, key): return ax def subplots(self, nrows=1, ncols=1, *, sharex=False, sharey=False, - squeeze=True, subplot_kw=None, gridspec_kw=None): + squeeze=True, width_ratios=None, height_ratios=None, + subplot_kw=None, gridspec_kw=None): """ Add a set of subplots to this figure. @@ -807,6 +808,18 @@ def subplots(self, nrows=1, ncols=1, *, sharex=False, sharey=False, is always a 2D array containing Axes instances, even if it ends up being 1x1. + width_ratios : array-like of length *ncols*, optional + Defines the relative widths of the columns. Each column gets a + relative width of ``width_ratios[i] / sum(width_ratios)``. + If not given, all columns will have the same width. Equivalent + to ``gridspec_kw={'width_ratios': [...]}``. + + height_ratios : array-like of length *nrows*, optional + Defines the relative heights of the rows. Each row gets a + relative height of ``height_ratios[i] / sum(height_ratios)``. + If not given, all rows will have the same height. Equivalent + to ``gridspec_kw={'height_ratios': [...]}``. + subplot_kw : dict, optional Dict with keywords passed to the `.Figure.add_subplot` call used to create each subplot. @@ -871,6 +884,17 @@ def subplots(self, nrows=1, ncols=1, *, sharex=False, sharey=False, """ if gridspec_kw is None: gridspec_kw = {} + if height_ratios is not None: + if 'height_ratios' in gridspec_kw: + raise ValueError("'height_ratios' must not be defined both as " + "parameter and as key in 'gridspec_kw'") + gridspec_kw['height_ratios'] = height_ratios + if width_ratios is not None: + if 'width_ratios' in gridspec_kw: + raise ValueError("'width_ratios' must not be defined both as " + "parameter and as key in 'gridspec_kw'") + gridspec_kw['width_ratios'] = width_ratios + gs = self.add_gridspec(nrows, ncols, figure=self, **gridspec_kw) axs = gs.subplots(sharex=sharex, sharey=sharey, squeeze=squeeze, subplot_kw=subplot_kw) @@ -1683,7 +1707,8 @@ def _normalize_grid_string(layout): return [list(ln) for ln in layout.strip('\n').split('\n')] def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False, - subplot_kw=None, gridspec_kw=None, empty_sentinel='.'): + width_ratios=None, height_ratios=None, + empty_sentinel='.', subplot_kw=None, gridspec_kw=None): """ Build a layout of Axes based on ASCII art or nested lists. @@ -1739,6 +1764,18 @@ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False, units behave as for `subplots`. If False, each subplot's x- or y-axis will be independent. + width_ratios : array-like of length *ncols*, optional + Defines the relative widths of the columns. Each column gets a + relative width of ``width_ratios[i] / sum(width_ratios)``. + If not given, all columns will have the same width. Equivalent + to ``gridspec_kw={'width_ratios': [...]}``. + + height_ratios : array-like of length *nrows*, optional + Defines the relative heights of the rows. Each row gets a + relative height of ``height_ratios[i] / sum(height_ratios)``. + If not given, all rows will have the same height. Equivalent + to ``gridspec_kw={'height_ratios': [...]}``. + subplot_kw : dict, optional Dictionary with keywords passed to the `.Figure.add_subplot` call used to create each subplot. @@ -1763,6 +1800,17 @@ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False, """ subplot_kw = subplot_kw or {} gridspec_kw = gridspec_kw or {} + if height_ratios is not None: + if 'height_ratios' in gridspec_kw: + raise ValueError("'height_ratios' must not be defined both as " + "parameter and as key in 'gridspec_kw'") + gridspec_kw['height_ratios'] = height_ratios + if width_ratios is not None: + if 'width_ratios' in gridspec_kw: + raise ValueError("'width_ratios' must not be defined both as " + "parameter and as key in 'gridspec_kw'") + gridspec_kw['width_ratios'] = width_ratios + # special-case string input if isinstance(mosaic, str): mosaic = self._normalize_grid_string(mosaic) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index e3c66ea67cad..faa023f8c082 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1323,6 +1323,7 @@ def subplot(*args, **kwargs): def subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True, + width_ratios=None, height_ratios=None, subplot_kw=None, gridspec_kw=None, **fig_kw): """ Create a figure and a set of subplots. @@ -1368,6 +1369,18 @@ def subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True, always a 2D array containing Axes instances, even if it ends up being 1x1. + width_ratios : array-like of length *ncols*, optional + Defines the relative widths of the columns. Each column gets a + relative width of ``width_ratios[i] / sum(width_ratios)``. + If not given, all columns will have the same width. Equivalent + to ``gridspec_kw={'width_ratios': [...]}``. + + height_ratios : array-like of length *nrows*, optional + Defines the relative heights of the rows. Each row gets a + relative height of ``height_ratios[i] / sum(height_ratios)``. + If not given, all rows will have the same height. Convenience + for ``gridspec_kw={'height_ratios': [...]}``. + subplot_kw : dict, optional Dict with keywords passed to the `~matplotlib.figure.Figure.add_subplot` call used to create each @@ -1458,13 +1471,14 @@ def subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True, fig = figure(**fig_kw) axs = fig.subplots(nrows=nrows, ncols=ncols, sharex=sharex, sharey=sharey, squeeze=squeeze, subplot_kw=subplot_kw, - gridspec_kw=gridspec_kw) + gridspec_kw=gridspec_kw, height_ratios=height_ratios, + width_ratios=width_ratios) return fig, axs def subplot_mosaic(mosaic, *, sharex=False, sharey=False, - subplot_kw=None, gridspec_kw=None, empty_sentinel='.', - **fig_kw): + width_ratios=None, height_ratios=None, empty_sentinel='.', + subplot_kw=None, gridspec_kw=None, **fig_kw): """ Build a layout of Axes based on ASCII art or nested lists. @@ -1515,13 +1529,17 @@ def subplot_mosaic(mosaic, *, sharex=False, sharey=False, behave as for `subplots`. If False, each subplot's x- or y-axis will be independent. - subplot_kw : dict, optional - Dictionary with keywords passed to the `.Figure.add_subplot` call - used to create each subplot. + width_ratios : array-like of length *ncols*, optional + Defines the relative widths of the columns. Each column gets a + relative width of ``width_ratios[i] / sum(width_ratios)``. + If not given, all columns will have the same width. Convenience + for ``gridspec_kw={'width_ratios': [...]}``. - gridspec_kw : dict, optional - Dictionary with keywords passed to the `.GridSpec` constructor used - to create the grid the subplots are placed on. + height_ratios : array-like of length *nrows*, optional + Defines the relative heights of the rows. Each row gets a + relative height of ``height_ratios[i] / sum(height_ratios)``. + If not given, all rows will have the same height. Convenience + for ``gridspec_kw={'height_ratios': [...]}``. empty_sentinel : object, optional Entry in the layout to mean "leave this space empty". Defaults @@ -1529,6 +1547,14 @@ def subplot_mosaic(mosaic, *, sharex=False, sharey=False, `inspect.cleandoc` to remove leading white space, which may interfere with using white-space as the empty sentinel. + subplot_kw : dict, optional + Dictionary with keywords passed to the `.Figure.add_subplot` call + used to create each subplot. + + gridspec_kw : dict, optional + Dictionary with keywords passed to the `.GridSpec` constructor used + to create the grid the subplots are placed on. + **fig_kw All additional keyword arguments are passed to the `.pyplot.figure` call. @@ -1547,6 +1573,7 @@ def subplot_mosaic(mosaic, *, sharex=False, sharey=False, fig = figure(**fig_kw) ax_dict = fig.subplot_mosaic( mosaic, sharex=sharex, sharey=sharey, + height_ratios=height_ratios, width_ratios=width_ratios, subplot_kw=subplot_kw, gridspec_kw=gridspec_kw, empty_sentinel=empty_sentinel ) diff --git a/tutorials/provisional/mosaic.py b/tutorials/provisional/mosaic.py index 05623e852ed7..202ada6eb332 100644 --- a/tutorials/provisional/mosaic.py +++ b/tutorials/provisional/mosaic.py @@ -219,12 +219,10 @@ def identify_axes(ax_dict, fontsize=48): bAc .d. """, - gridspec_kw={ - # set the height ratios between the rows - "height_ratios": [1, 3.5, 1], - # set the width ratios between the columns - "width_ratios": [1, 3.5, 1], - }, + # set the height ratios between the rows + height_ratios=[1, 3.5, 1], + # set the width ratios between the columns + width_ratios=[1, 3.5, 1], ) identify_axes(axd) @@ -301,7 +299,7 @@ def identify_axes(ax_dict, fontsize=48): ["main", "BLANK"], ], empty_sentinel="BLANK", - gridspec_kw={"width_ratios": [2, 1]}, + width_ratios=[2, 1], ) identify_axes(axd)
diff --git a/lib/matplotlib/tests/test_subplots.py b/lib/matplotlib/tests/test_subplots.py index 8d707e014749..f299440ef53e 100644 --- a/lib/matplotlib/tests/test_subplots.py +++ b/lib/matplotlib/tests/test_subplots.py @@ -4,7 +4,7 @@ import pytest import matplotlib.pyplot as plt -from matplotlib.testing.decorators import image_comparison +from matplotlib.testing.decorators import check_figures_equal, image_comparison import matplotlib.axes as maxes @@ -212,3 +212,42 @@ def test_dont_mutate_kwargs(): def test_subplot_factory_reapplication(): assert maxes.subplot_class_factory(maxes.Axes) is maxes.Subplot assert maxes.subplot_class_factory(maxes.Subplot) is maxes.Subplot + + +@pytest.mark.parametrize("width_ratios", [None, [1, 3, 2]]) +@pytest.mark.parametrize("height_ratios", [None, [1, 2]]) +@check_figures_equal(extensions=['png']) +def test_width_and_height_ratios(fig_test, fig_ref, + height_ratios, width_ratios): + fig_test.subplots(2, 3, height_ratios=height_ratios, + width_ratios=width_ratios) + fig_ref.subplots(2, 3, gridspec_kw={ + 'height_ratios': height_ratios, + 'width_ratios': width_ratios}) + + +@pytest.mark.parametrize("width_ratios", [None, [1, 3, 2]]) +@pytest.mark.parametrize("height_ratios", [None, [1, 2]]) +@check_figures_equal(extensions=['png']) +def test_width_and_height_ratios_mosaic(fig_test, fig_ref, + height_ratios, width_ratios): + mosaic_spec = [['A', 'B', 'B'], ['A', 'C', 'D']] + fig_test.subplot_mosaic(mosaic_spec, height_ratios=height_ratios, + width_ratios=width_ratios) + fig_ref.subplot_mosaic(mosaic_spec, gridspec_kw={ + 'height_ratios': height_ratios, + 'width_ratios': width_ratios}) + + +@pytest.mark.parametrize('method,args', [ + ('subplots', (2, 3)), + ('subplot_mosaic', ('abc;def', )) + ] +) +def test_ratio_overlapping_kws(method, args): + with pytest.raises(ValueError, match='height_ratios'): + getattr(plt, method)(*args, height_ratios=[1, 2], + gridspec_kw={'height_ratios': [1, 2]}) + with pytest.raises(ValueError, match='width_ratios'): + getattr(plt, method)(*args, width_ratios=[1, 2, 3], + gridspec_kw={'width_ratios': [1, 2, 3]})
[ { "path": "doc/users/next_whats_new/width_height_ratios.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/width_height_ratios.rst", "metadata": "diff --git a/doc/users/next_whats_new/width_height_ratios.rst b/doc/users/next_whats_new/width_height_ratios.rst\nnew file mode 100644\nindex 000000000000..017c34a55cc4\n--- /dev/null\n+++ b/doc/users/next_whats_new/width_height_ratios.rst\n@@ -0,0 +1,7 @@\n+``subplots``, ``subplot_mosaic`` accept *height_ratios* and *width_ratios* arguments\n+------------------------------------------------------------------------------------\n+\n+The relative width and height of columns and rows in `~.Figure.subplots` and\n+`~.Figure.subplot_mosaic` can be controlled by passing *height_ratios* and\n+*width_ratios* keyword arguments to the methods. Previously, this required\n+passing the ratios in *gridspec_kws* arguments.\n" } ]
3.5
3522217386b0ba888e47d931a79c87085d51137b
[ "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_axislabels[right-top]", "lib/matplotlib/tests/test_subplots.py::test_label_outer_span", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_axislabels[left-bottom]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-True-True-False]", "lib/matplotlib/tests/test_subplots.py::test_shared_and_moved", "lib/matplotlib/tests/test_subplots.py::test_exceptions", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-False-False-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-False-True-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_offsettext[pdf]", "lib/matplotlib/tests/test_subplots.py::test_subplot_factory_reapplication", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-False-False-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-True-True-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-False-False-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-False-True-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-False-True-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-False-True-False]", "lib/matplotlib/tests/test_subplots.py::test_shared", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-True-True-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-True-False-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-True-False-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_axislabels[left-top]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-True-False-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-False-False-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_offsettext[svg]", "lib/matplotlib/tests/test_subplots.py::test_dont_mutate_kwargs", "lib/matplotlib/tests/test_subplots.py::test_get_gridspec", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[False-True-False-False]", "lib/matplotlib/tests/test_subplots.py::test_subplots_offsettext[png]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_ticklabels[True-True-True-True]", "lib/matplotlib/tests/test_subplots.py::test_subplots_hide_axislabels[right-bottom]" ]
[ "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios_mosaic[png-height_ratios1-width_ratios1]", "lib/matplotlib/tests/test_subplots.py::test_ratio_overlapping_kws[subplot_mosaic-args1]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios[png-None-width_ratios1]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios_mosaic[png-None-None]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios_mosaic[png-height_ratios1-None]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios[png-None-None]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios[png-height_ratios1-width_ratios1]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios[png-height_ratios1-None]", "lib/matplotlib/tests/test_subplots.py::test_width_and_height_ratios_mosaic[png-None-width_ratios1]", "lib/matplotlib/tests/test_subplots.py::test_ratio_overlapping_kws[subplots-args0]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/width_height_ratios.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/width_height_ratios.rst", "metadata": "diff --git a/doc/users/next_whats_new/width_height_ratios.rst b/doc/users/next_whats_new/width_height_ratios.rst\nnew file mode 100644\nindex 000000000000..017c34a55cc4\n--- /dev/null\n+++ b/doc/users/next_whats_new/width_height_ratios.rst\n@@ -0,0 +1,7 @@\n+``subplots``, ``subplot_mosaic`` accept *height_ratios* and *width_ratios* arguments\n+------------------------------------------------------------------------------------\n+\n+The relative width and height of columns and rows in `~.Figure.subplots` and\n+`~.Figure.subplot_mosaic` can be controlled by passing *height_ratios* and\n+*width_ratios* keyword arguments to the methods. Previously, this required\n+passing the ratios in *gridspec_kws* arguments.\n" } ]
diff --git a/doc/users/next_whats_new/width_height_ratios.rst b/doc/users/next_whats_new/width_height_ratios.rst new file mode 100644 index 000000000000..017c34a55cc4 --- /dev/null +++ b/doc/users/next_whats_new/width_height_ratios.rst @@ -0,0 +1,7 @@ +``subplots``, ``subplot_mosaic`` accept *height_ratios* and *width_ratios* arguments +------------------------------------------------------------------------------------ + +The relative width and height of columns and rows in `~.Figure.subplots` and +`~.Figure.subplot_mosaic` can be controlled by passing *height_ratios* and +*width_ratios* keyword arguments to the methods. Previously, this required +passing the ratios in *gridspec_kws* arguments.
matplotlib/matplotlib
matplotlib__matplotlib-21143
https://github.com/matplotlib/matplotlib/pull/21143
diff --git a/doc/api/next_api_changes/behavior/19515-GL.rst b/doc/api/next_api_changes/behavior/19515-GL.rst new file mode 100644 index 000000000000..cb6d925b797c --- /dev/null +++ b/doc/api/next_api_changes/behavior/19515-GL.rst @@ -0,0 +1,10 @@ +Colorbars now have pan and zoom functionality +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Interactive plots with colorbars can now be zoomed and panned on +the colorbar axis. This adjusts the *vmin* and *vmax* of the +``ScalarMappable`` associated with the colorbar. This is currently +only enabled for continuous norms. Norms used with contourf and +categoricals, such as ``BoundaryNorm`` and ``NoNorm``, have the +interactive capability disabled by default. ``cb.ax.set_navigate()`` +can be used to set whether a colorbar axes is interactive or not. diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 97ed781b00f6..7cea32d849d0 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -4255,41 +4255,14 @@ def _set_view(self, view): self.set_xlim((xmin, xmax)) self.set_ylim((ymin, ymax)) - def _set_view_from_bbox(self, bbox, direction='in', - mode=None, twinx=False, twiny=False): + def _prepare_view_from_bbox(self, bbox, direction='in', + mode=None, twinx=False, twiny=False): """ - Update view from a selection bbox. - - .. note:: - - Intended to be overridden by new projection types, but if not, the - default implementation sets the view limits to the bbox directly. - - Parameters - ---------- - bbox : 4-tuple or 3 tuple - * If bbox is a 4 tuple, it is the selected bounding box limits, - in *display* coordinates. - * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where - (xp, yp) is the center of zooming and scl the scale factor to - zoom by. + Helper function to prepare the new bounds from a bbox. - direction : str - The direction to apply the bounding box. - * `'in'` - The bounding box describes the view directly, i.e., - it zooms in. - * `'out'` - The bounding box describes the size to make the - existing view, i.e., it zooms out. - - mode : str or None - The selection mode, whether to apply the bounding box in only the - `'x'` direction, `'y'` direction or both (`None`). - - twinx : bool - Whether this axis is twinned in the *x*-direction. - - twiny : bool - Whether this axis is twinned in the *y*-direction. + This helper function returns the new x and y bounds from the zoom + bbox. This a convenience method to abstract the bbox logic + out of the base setter. """ if len(bbox) == 3: xp, yp, scl = bbox # Zooming code @@ -4360,6 +4333,46 @@ def _set_view_from_bbox(self, bbox, direction='in', symax1 = symax0 + factor * (symax0 - symax) new_ybound = y_trf.inverted().transform([symin1, symax1]) + return new_xbound, new_ybound + + def _set_view_from_bbox(self, bbox, direction='in', + mode=None, twinx=False, twiny=False): + """ + Update view from a selection bbox. + + .. note:: + + Intended to be overridden by new projection types, but if not, the + default implementation sets the view limits to the bbox directly. + + Parameters + ---------- + bbox : 4-tuple or 3 tuple + * If bbox is a 4 tuple, it is the selected bounding box limits, + in *display* coordinates. + * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where + (xp, yp) is the center of zooming and scl the scale factor to + zoom by. + + direction : str + The direction to apply the bounding box. + * `'in'` - The bounding box describes the view directly, i.e., + it zooms in. + * `'out'` - The bounding box describes the size to make the + existing view, i.e., it zooms out. + + mode : str or None + The selection mode, whether to apply the bounding box in only the + `'x'` direction, `'y'` direction or both (`None`). + + twinx : bool + Whether this axis is twinned in the *x*-direction. + + twiny : bool + Whether this axis is twinned in the *y*-direction. + """ + new_xbound, new_ybound = self._prepare_view_from_bbox( + bbox, direction=direction, mode=mode, twinx=twinx, twiny=twiny) if not twinx and mode != "y": self.set_xbound(new_xbound) self.set_autoscalex_on(False) @@ -4400,22 +4413,13 @@ def end_pan(self): """ del self._pan_start - def drag_pan(self, button, key, x, y): + def _get_pan_points(self, button, key, x, y): """ - Called when the mouse moves during a pan operation. + Helper function to return the new points after a pan. - Parameters - ---------- - button : `.MouseButton` - The pressed mouse button. - key : str or None - The pressed key, if any. - x, y : float - The mouse coordinates in display coords. - - Notes - ----- - This is intended to be overridden by new projection types. + This helper function returns the points on the axis after a pan has + occurred. This is a convenience method to abstract the pan logic + out of the base setter. """ def format_deltas(key, dx, dy): if key == 'control': @@ -4469,8 +4473,29 @@ def format_deltas(key, dx, dy): points = result.get_points().astype(object) # Just ignore invalid limits (typically, underflow in log-scale). points[~valid] = None - self.set_xlim(points[:, 0]) - self.set_ylim(points[:, 1]) + return points + + def drag_pan(self, button, key, x, y): + """ + Called when the mouse moves during a pan operation. + + Parameters + ---------- + button : `.MouseButton` + The pressed mouse button. + key : str or None + The pressed key, if any. + x, y : float + The mouse coordinates in display coords. + + Notes + ----- + This is intended to be overridden by new projection types. + """ + points = self._get_pan_points(button, key, x, y) + if points is not None: + self.set_xlim(points[:, 0]) + self.set_ylim(points[:, 1]) def get_children(self): # docstring inherited. diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 89a3980de52a..42ac8d2a4164 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -3136,7 +3136,7 @@ def zoom(self, *args): a.set_navigate_mode(self.mode._navigate_mode) self.set_message(self.mode) - _ZoomInfo = namedtuple("_ZoomInfo", "direction start_xy axes cid") + _ZoomInfo = namedtuple("_ZoomInfo", "direction start_xy axes cid cbar") def press_zoom(self, event): """Callback for mouse button press in zoom to rect mode.""" @@ -3151,9 +3151,16 @@ def press_zoom(self, event): self.push_current() # set the home button to this view id_zoom = self.canvas.mpl_connect( "motion_notify_event", self.drag_zoom) + # A colorbar is one-dimensional, so we extend the zoom rectangle out + # to the edge of the axes bbox in the other dimension. To do that we + # store the orientation of the colorbar for later. + if hasattr(axes[0], "_colorbar"): + cbar = axes[0]._colorbar.orientation + else: + cbar = None self._zoom_info = self._ZoomInfo( direction="in" if event.button == 1 else "out", - start_xy=(event.x, event.y), axes=axes, cid=id_zoom) + start_xy=(event.x, event.y), axes=axes, cid=id_zoom, cbar=cbar) def drag_zoom(self, event): """Callback for dragging in zoom mode.""" @@ -3161,10 +3168,17 @@ def drag_zoom(self, event): ax = self._zoom_info.axes[0] (x1, y1), (x2, y2) = np.clip( [start_xy, [event.x, event.y]], ax.bbox.min, ax.bbox.max) - if event.key == "x": + key = event.key + # Force the key on colorbars to extend the short-axis bbox + if self._zoom_info.cbar == "horizontal": + key = "x" + elif self._zoom_info.cbar == "vertical": + key = "y" + if key == "x": y1, y2 = ax.bbox.intervaly - elif event.key == "y": + elif key == "y": x1, x2 = ax.bbox.intervalx + self.draw_rubberband(event, x1, y1, x2, y2) def release_zoom(self, event): @@ -3178,10 +3192,17 @@ def release_zoom(self, event): self.remove_rubberband() start_x, start_y = self._zoom_info.start_xy + key = event.key + # Force the key on colorbars to ignore the zoom-cancel on the + # short-axis side + if self._zoom_info.cbar == "horizontal": + key = "x" + elif self._zoom_info.cbar == "vertical": + key = "y" # Ignore single clicks: 5 pixels is a threshold that allows the user to # "cancel" a zoom action by zooming by less than 5 pixels. - if ((abs(event.x - start_x) < 5 and event.key != "y") - or (abs(event.y - start_y) < 5 and event.key != "x")): + if ((abs(event.x - start_x) < 5 and key != "y") or + (abs(event.y - start_y) < 5 and key != "x")): self.canvas.draw_idle() self._zoom_info = None return @@ -3195,7 +3216,7 @@ def release_zoom(self, event): for prev in self._zoom_info.axes[:i]) ax._set_view_from_bbox( (start_x, start_y, event.x, event.y), - self._zoom_info.direction, event.key, twinx, twiny) + self._zoom_info.direction, key, twinx, twiny) self.canvas.draw_idle() self._zoom_info = None diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index a5439bf8ea75..ea5acffbe949 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -422,7 +422,6 @@ def __init__(self, ax, mappable=None, *, cmap=None, self.ax = ax self.ax._axes_locator = _ColorbarAxesLocator(self) - ax.set(navigate=False) if extend is None: if (not isinstance(mappable, contour.ContourSet) @@ -496,6 +495,29 @@ def __init__(self, ax, mappable=None, *, cmap=None, if isinstance(mappable, contour.ContourSet) and not mappable.filled: self.add_lines(mappable) + # Link the Axes and Colorbar for interactive use + self.ax._colorbar = self + # Don't navigate on any of these types of mappables + if (isinstance(self.norm, (colors.BoundaryNorm, colors.NoNorm)) or + isinstance(self.mappable, contour.ContourSet)): + self.ax.set_navigate(False) + + # These are the functions that set up interactivity on this colorbar + self._interactive_funcs = ["_get_view", "_set_view", + "_set_view_from_bbox", "drag_pan"] + for x in self._interactive_funcs: + setattr(self.ax, x, getattr(self, x)) + # Set the cla function to the cbar's method to override it + self.ax.cla = self._cbar_cla + + def _cbar_cla(self): + """Function to clear the interactive colorbar state.""" + for x in self._interactive_funcs: + delattr(self.ax, x) + # We now restore the old cla() back and can call it directly + del self.ax.cla + self.ax.cla() + # Also remove ._patch after deprecation elapses. patch = _api.deprecate_privatize_attribute("3.5", alternative="ax") @@ -1280,6 +1302,36 @@ def _short_axis(self): return self.ax.xaxis return self.ax.yaxis + def _get_view(self): + # docstring inherited + # An interactive view for a colorbar is the norm's vmin/vmax + return self.norm.vmin, self.norm.vmax + + def _set_view(self, view): + # docstring inherited + # An interactive view for a colorbar is the norm's vmin/vmax + self.norm.vmin, self.norm.vmax = view + + def _set_view_from_bbox(self, bbox, direction='in', + mode=None, twinx=False, twiny=False): + # docstring inherited + # For colorbars, we use the zoom bbox to scale the norm's vmin/vmax + new_xbound, new_ybound = self.ax._prepare_view_from_bbox( + bbox, direction=direction, mode=mode, twinx=twinx, twiny=twiny) + if self.orientation == 'horizontal': + self.norm.vmin, self.norm.vmax = new_xbound + elif self.orientation == 'vertical': + self.norm.vmin, self.norm.vmax = new_ybound + + def drag_pan(self, button, key, x, y): + # docstring inherited + points = self.ax._get_pan_points(button, key, x, y) + if points is not None: + if self.orientation == 'horizontal': + self.norm.vmin, self.norm.vmax = points[:, 0] + elif self.orientation == 'vertical': + self.norm.vmin, self.norm.vmax = points[:, 1] + ColorbarBase = Colorbar # Backcompat API
diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 1550d3256c04..4abaf1a78ed5 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -181,6 +181,66 @@ def test_interactive_zoom(): assert not ax.get_autoscalex_on() and not ax.get_autoscaley_on() +@pytest.mark.parametrize("plot_func", ["imshow", "contourf"]) +@pytest.mark.parametrize("orientation", ["vertical", "horizontal"]) +@pytest.mark.parametrize("tool,button,expected", + [("zoom", MouseButton.LEFT, (4, 6)), # zoom in + ("zoom", MouseButton.RIGHT, (-20, 30)), # zoom out + ("pan", MouseButton.LEFT, (-2, 8))]) +def test_interactive_colorbar(plot_func, orientation, tool, button, expected): + fig, ax = plt.subplots() + data = np.arange(12).reshape((4, 3)) + vmin0, vmax0 = 0, 10 + coll = getattr(ax, plot_func)(data, vmin=vmin0, vmax=vmax0) + + cb = fig.colorbar(coll, ax=ax, orientation=orientation) + if plot_func == "contourf": + # Just determine we can't navigate and exit out of the test + assert not cb.ax.get_navigate() + return + + assert cb.ax.get_navigate() + + # Mouse from 4 to 6 (data coordinates, "d"). + vmin, vmax = 4, 6 + # The y coordinate doesn't matter, it just needs to be between 0 and 1 + # However, we will set d0/d1 to the same y coordinate to test that small + # pixel changes in that coordinate doesn't cancel the zoom like a normal + # axes would. + d0 = (vmin, 0.5) + d1 = (vmax, 0.5) + # Swap them if the orientation is vertical + if orientation == "vertical": + d0 = d0[::-1] + d1 = d1[::-1] + # Convert to screen coordinates ("s"). Events are defined only with pixel + # precision, so round the pixel values, and below, check against the + # corresponding xdata/ydata, which are close but not equal to d0/d1. + s0 = cb.ax.transData.transform(d0).astype(int) + s1 = cb.ax.transData.transform(d1).astype(int) + + # Set up the mouse movements + start_event = MouseEvent( + "button_press_event", fig.canvas, *s0, button) + stop_event = MouseEvent( + "button_release_event", fig.canvas, *s1, button) + + tb = NavigationToolbar2(fig.canvas) + if tool == "zoom": + tb.zoom() + tb.press_zoom(start_event) + tb.drag_zoom(stop_event) + tb.release_zoom(stop_event) + else: + tb.pan() + tb.press_pan(start_event) + tb.drag_pan(stop_event) + tb.release_pan(stop_event) + + # Should be close, but won't be exact due to screen integer resolution + assert (cb.vmin, cb.vmax) == pytest.approx(expected, abs=0.15) + + def test_toolbar_zoompan(): expected_warning_regex = ( r"Treat the new Tool classes introduced in "
[ { "path": "doc/api/next_api_changes/behavior/19515-GL.rst", "old_path": "/dev/null", "new_path": "b/doc/api/next_api_changes/behavior/19515-GL.rst", "metadata": "diff --git a/doc/api/next_api_changes/behavior/19515-GL.rst b/doc/api/next_api_changes/behavior/19515-GL.rst\nnew file mode 100644\nindex 000000000000..cb6d925b797c\n--- /dev/null\n+++ b/doc/api/next_api_changes/behavior/19515-GL.rst\n@@ -0,0 +1,10 @@\n+Colorbars now have pan and zoom functionality\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Interactive plots with colorbars can now be zoomed and panned on\n+the colorbar axis. This adjusts the *vmin* and *vmax* of the\n+``ScalarMappable`` associated with the colorbar. This is currently\n+only enabled for continuous norms. Norms used with contourf and\n+categoricals, such as ``BoundaryNorm`` and ``NoNorm``, have the\n+interactive capability disabled by default. ``cb.ax.set_navigate()``\n+can be used to set whether a colorbar axes is interactive or not.\n" } ]
3.4
eb7bcb41e272cad354e8ee703f5e276450cbf967
[ "lib/matplotlib/tests/test_backend_bases.py::test_draw[pdf]", "lib/matplotlib/tests/test_backend_bases.py::test_uses_per_path", "lib/matplotlib/tests/test_backend_bases.py::test_location_event_position[None-42]", "lib/matplotlib/tests/test_backend_bases.py::test_location_event_position[205.75-2.0]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.LEFT-expected0-horizontal-contourf]", "lib/matplotlib/tests/test_backend_bases.py::test_pick", "lib/matplotlib/tests/test_backend_bases.py::test_non_gui_warning", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[pan-MouseButton.LEFT-expected2-horizontal-contourf]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.RIGHT-expected1-horizontal-contourf]", "lib/matplotlib/tests/test_backend_bases.py::test_draw[ps]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_zoom", "lib/matplotlib/tests/test_backend_bases.py::test_toolbar_zoompan", "lib/matplotlib/tests/test_backend_bases.py::test_location_event_position[None-None]", "lib/matplotlib/tests/test_backend_bases.py::test_location_event_position[42-24]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[pan-MouseButton.LEFT-expected2-vertical-contourf]", "lib/matplotlib/tests/test_backend_bases.py::test_draw[svg]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.LEFT-expected0-vertical-contourf]", "lib/matplotlib/tests/test_backend_bases.py::test_location_event_position[200-100.01]", "lib/matplotlib/tests/test_backend_bases.py::test_get_default_filename", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_change", "lib/matplotlib/tests/test_backend_bases.py::test_draw[pgf]", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_ctor", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.RIGHT-expected1-vertical-contourf]" ]
[ "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.LEFT-expected0-vertical-imshow]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[pan-MouseButton.LEFT-expected2-horizontal-imshow]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[pan-MouseButton.LEFT-expected2-vertical-imshow]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.LEFT-expected0-horizontal-imshow]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.RIGHT-expected1-horizontal-imshow]", "lib/matplotlib/tests/test_backend_bases.py::test_interactive_colorbar[zoom-MouseButton.RIGHT-expected1-vertical-imshow]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "function", "name": "drag_pan" }, { "type": "field", "name": "button" } ] }
[ { "path": "doc/api/next_api_changes/behavior/<PRID>-GL.rst", "old_path": "/dev/null", "new_path": "b/doc/api/next_api_changes/behavior/<PRID>-GL.rst", "metadata": "diff --git a/doc/api/next_api_changes/behavior/<PRID>-GL.rst b/doc/api/next_api_changes/behavior/<PRID>-GL.rst\nnew file mode 100644\nindex 000000000000..cb6d925b797c\n--- /dev/null\n+++ b/doc/api/next_api_changes/behavior/<PRID>-GL.rst\n@@ -0,0 +1,10 @@\n+Colorbars now have pan and zoom functionality\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Interactive plots with colorbars can now be zoomed and panned on\n+the colorbar axis. This adjusts the *vmin* and *vmax* of the\n+``ScalarMappable`` associated with the colorbar. This is currently\n+only enabled for continuous norms. Norms used with contourf and\n+categoricals, such as ``BoundaryNorm`` and ``NoNorm``, have the\n+interactive capability disabled by default. ``cb.ax.set_navigate()``\n+can be used to set whether a colorbar axes is interactive or not.\n" } ]
diff --git a/doc/api/next_api_changes/behavior/<PRID>-GL.rst b/doc/api/next_api_changes/behavior/<PRID>-GL.rst new file mode 100644 index 000000000000..cb6d925b797c --- /dev/null +++ b/doc/api/next_api_changes/behavior/<PRID>-GL.rst @@ -0,0 +1,10 @@ +Colorbars now have pan and zoom functionality +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Interactive plots with colorbars can now be zoomed and panned on +the colorbar axis. This adjusts the *vmin* and *vmax* of the +``ScalarMappable`` associated with the colorbar. This is currently +only enabled for continuous norms. Norms used with contourf and +categoricals, such as ``BoundaryNorm`` and ``NoNorm``, have the +interactive capability disabled by default. ``cb.ax.set_navigate()`` +can be used to set whether a colorbar axes is interactive or not. If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'function', 'name': 'drag_pan'}, {'type': 'field', 'name': 'button'}]
matplotlib/matplotlib
matplotlib__matplotlib-21374
https://github.com/matplotlib/matplotlib/pull/21374
diff --git a/doc/users/next_whats_new/snap_selector.rst b/doc/users/next_whats_new/snap_selector.rst new file mode 100644 index 000000000000..9ff0ccd87e0c --- /dev/null +++ b/doc/users/next_whats_new/snap_selector.rst @@ -0,0 +1,4 @@ +SpanSelector widget can now be snapped to specified values +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The SpanSelector widget can now be snapped to values specified by the *snap_values* +argument. diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 78d484168263..cd79e9523a04 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2238,6 +2238,9 @@ def on_select(min: float, max: float) -> Any If `True`, the event triggered outside the span selector will be ignored. + snap_values : 1D array-like, optional + Snap the selector edges to the given values. + Examples -------- >>> import matplotlib.pyplot as plt @@ -2259,7 +2262,7 @@ def __init__(self, ax, onselect, direction, minspan=0, useblit=False, props=None, onmove_callback=None, interactive=False, button=None, handle_props=None, grab_range=10, state_modifier_keys=None, drag_from_anywhere=False, - ignore_event_outside=False): + ignore_event_outside=False, snap_values=None): if state_modifier_keys is None: state_modifier_keys = dict(clear='escape', @@ -2278,6 +2281,7 @@ def __init__(self, ax, onselect, direction, minspan=0, useblit=False, self.visible = True self._extents_on_press = None + self.snap_values = snap_values # self._pressv is deprecated and we don't use it internally anymore # but we maintain it until it is removed @@ -2577,6 +2581,15 @@ def _contains(self, event): """Return True if event is within the patch.""" return self._selection_artist.contains(event, radius=0)[0] + @staticmethod + def _snap(values, snap_values): + """Snap values to a given array values (snap_values).""" + # take into account machine precision + eps = np.min(np.abs(np.diff(snap_values))) * 1e-12 + return tuple( + snap_values[np.abs(snap_values - v + np.sign(v) * eps).argmin()] + for v in values) + @property def extents(self): """Return extents of the span selector.""" @@ -2591,6 +2604,8 @@ def extents(self): @extents.setter def extents(self, extents): # Update displayed shape + if self.snap_values is not None: + extents = tuple(self._snap(extents, self.snap_values)) self._draw_shape(*extents) if self._interactive: # Update displayed handles
diff --git a/lib/matplotlib/tests/test_widgets.py b/lib/matplotlib/tests/test_widgets.py index cf98e3aea85e..11db0493a711 100644 --- a/lib/matplotlib/tests/test_widgets.py +++ b/lib/matplotlib/tests/test_widgets.py @@ -67,8 +67,7 @@ def test_rectangle_selector(): @pytest.mark.parametrize('spancoords', ['data', 'pixels']) @pytest.mark.parametrize('minspanx, x1', [[0, 10], [1, 10.5], [1, 11]]) @pytest.mark.parametrize('minspany, y1', [[0, 10], [1, 10.5], [1, 11]]) -def test_rectangle_minspan(spancoords, minspanx, x1, minspany, y1): - ax = get_ax() +def test_rectangle_minspan(ax, spancoords, minspanx, x1, minspany, y1): # attribute to track number of onselect calls ax._n_onselect = 0 @@ -924,6 +923,37 @@ def mean(vmin, vmax): assert ln2.stale is False +def test_snapping_values_span_selector(ax): + def onselect(*args): + pass + + tool = widgets.SpanSelector(ax, onselect, direction='horizontal',) + snap_function = tool._snap + + snap_values = np.linspace(0, 5, 11) + values = np.array([-0.1, 0.1, 0.2, 0.5, 0.6, 0.7, 0.9, 4.76, 5.0, 5.5]) + expect = np.array([00.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 5.00, 5.0, 5.0]) + values = snap_function(values, snap_values) + assert_allclose(values, expect) + + +def test_span_selector_snap(ax): + def onselect(vmin, vmax): + ax._got_onselect = True + + snap_values = np.arange(50) * 4 + + tool = widgets.SpanSelector(ax, onselect, direction='horizontal', + snap_values=snap_values) + tool.extents = (17, 35) + assert tool.extents == (16, 36) + + tool.snap_values = None + assert tool.snap_values is None + tool.extents = (17, 35) + assert tool.extents == (17, 35) + + def check_lasso_selector(**kwargs): ax = get_ax()
[ { "path": "doc/users/next_whats_new/snap_selector.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/snap_selector.rst", "metadata": "diff --git a/doc/users/next_whats_new/snap_selector.rst b/doc/users/next_whats_new/snap_selector.rst\nnew file mode 100644\nindex 000000000000..9ff0ccd87e0c\n--- /dev/null\n+++ b/doc/users/next_whats_new/snap_selector.rst\n@@ -0,0 +1,4 @@\n+SpanSelector widget can now be snapped to specified values\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+The SpanSelector widget can now be snapped to values specified by the *snap_values*\n+argument.\n" } ]
3.5
574580c7d173bf08a23678d302b711492b971f3c
[ "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-0-10-pixels]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-0-10-data]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_onselect[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_ignore_outside[False]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_direction", "lib/matplotlib/tests/test_widgets.py::test_range_slider[vertical]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[True-1]", "lib/matplotlib/tests/test_widgets.py::test_selector_clear[rectangle]", "lib/matplotlib/tests/test_widgets.py::test_TextBox[none]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[True-2]", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[True-False]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_handles", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-0-10-data]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_rotate[RectangleSelector]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-10.5-pixels]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[False-3]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_set_props_handle_props[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-10.5-data]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_drag[True]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_bound[vertical]", "lib/matplotlib/tests/test_widgets.py::test_selector_clear_method[span]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-1-10.5-data]", "lib/matplotlib/tests/test_widgets.py::test_check_radio_buttons_image[png]", "lib/matplotlib/tests/test_widgets.py::test_slider_valstep_snapping", "lib/matplotlib/tests/test_widgets.py::test_CheckButtons", "lib/matplotlib/tests/test_widgets.py::test_slider_valmin_valmax", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_set_props_handle_props[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-0-10-data]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_square_center_aspect[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_add_state", "lib/matplotlib/tests/test_widgets.py::test_slider_slidermin_slidermax", "lib/matplotlib/tests/test_widgets.py::test_range_slider[horizontal]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_verts_setter[png-False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_center[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_set_props_handle_props", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-1-10.5-pixels]", "lib/matplotlib/tests/test_widgets.py::test_selector_clear_method[rectangle]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-1-11-data]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[False-1]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove_first_point[False]", "lib/matplotlib/tests/test_widgets.py::test_span_selector", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-11-pixels]", "lib/matplotlib/tests/test_widgets.py::test_ellipse", "lib/matplotlib/tests/test_widgets.py::test_slider_slidermin_slidermax_invalid", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-0-10-pixels]", "lib/matplotlib/tests/test_widgets.py::test_slider_horizontal_vertical", "lib/matplotlib/tests/test_widgets.py::test_span_selector_ignore_outside[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_drag[True-new_center0]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_onselect[True]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_bound[horizontal]", "lib/matplotlib/tests/test_widgets.py::test_rect_visibility[svg]", "lib/matplotlib/tests/test_widgets.py::test_selector_clear[span]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-1-11-pixels]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[False-2]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_ignore_outside[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_onselect[False]", "lib/matplotlib/tests/test_widgets.py::test_check_bunch_of_radio_buttons[png]", "lib/matplotlib/tests/test_widgets.py::test_tool_line_handle", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_square[False]", "lib/matplotlib/tests/test_widgets.py::test_TextBox[toolbar2]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_square_center", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-1-10.5-pixels]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-10.5-1-11-pixels]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize", "lib/matplotlib/tests/test_widgets.py::test_slider_reset", "lib/matplotlib/tests/test_widgets.py::test_lasso_selector", "lib/matplotlib/tests/test_widgets.py::test_TextBox[toolmanager]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-1-10.5-data]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_square[True]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_box", "lib/matplotlib/tests/test_widgets.py::test_span_selector_drag[False]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_onselect[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-0-10-pixels]", "lib/matplotlib/tests/test_widgets.py::test_rect_visibility[pdf]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_center[False]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-11-data]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_verts_setter[png-True]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove_first_point[True]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_redraw[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_drag[False-new_center1]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_redraw[False]", "lib/matplotlib/tests/test_widgets.py::test_rectange_add_remove_set", "lib/matplotlib/tests/test_widgets.py::test_rectangle_rotate[EllipseSelector]", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[True-True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[1-11-1-11-data]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_ignore_outside[True]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_set_props_handle_props", "lib/matplotlib/tests/test_widgets.py::test_rect_visibility[png]", "lib/matplotlib/tests/test_widgets.py::test_polygon_selector_remove[True-3]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_add_state", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[False-True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_resize_square_center_aspect[True]" ]
[ "lib/matplotlib/tests/test_widgets.py::test_span_selector_snap", "lib/matplotlib/tests/test_widgets.py::test_snapping_values_span_selector" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "field", "name": "_snap" }, { "type": "function", "name": "_snap" } ] }
[ { "path": "doc/users/next_whats_new/snap_selector.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/snap_selector.rst", "metadata": "diff --git a/doc/users/next_whats_new/snap_selector.rst b/doc/users/next_whats_new/snap_selector.rst\nnew file mode 100644\nindex 000000000000..9ff0ccd87e0c\n--- /dev/null\n+++ b/doc/users/next_whats_new/snap_selector.rst\n@@ -0,0 +1,4 @@\n+SpanSelector widget can now be snapped to specified values\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+The SpanSelector widget can now be snapped to values specified by the *snap_values*\n+argument.\n" } ]
diff --git a/doc/users/next_whats_new/snap_selector.rst b/doc/users/next_whats_new/snap_selector.rst new file mode 100644 index 000000000000..9ff0ccd87e0c --- /dev/null +++ b/doc/users/next_whats_new/snap_selector.rst @@ -0,0 +1,4 @@ +SpanSelector widget can now be snapped to specified values +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The SpanSelector widget can now be snapped to values specified by the *snap_values* +argument. If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'field', 'name': '_snap'}, {'type': 'function', 'name': '_snap'}]
matplotlib/matplotlib
matplotlib__matplotlib-20816
https://github.com/matplotlib/matplotlib/pull/20816
diff --git a/doc/users/next_whats_new/callback_blocking.rst b/doc/users/next_whats_new/callback_blocking.rst new file mode 100644 index 000000000000..090e06c61bbf --- /dev/null +++ b/doc/users/next_whats_new/callback_blocking.rst @@ -0,0 +1,25 @@ +``CallbackRegistry`` objects gain a method to temporarily block signals +----------------------------------------------------------------------- + +The context manager `~matplotlib.cbook.CallbackRegistry.blocked` can be used +to block callback signals from being processed by the ``CallbackRegistry``. +The optional keyword, *signal*, can be used to block a specific signal +from being processed and let all other signals pass. + +.. code-block:: + + import matplotlib.pyplot as plt + + fig, ax = plt.subplots() + ax.imshow([[0, 1], [2, 3]]) + + # Block all interactivity through the canvas callbacks + with fig.canvas.callbacks.blocked(): + plt.show() + + fig, ax = plt.subplots() + ax.imshow([[0, 1], [2, 3]]) + + # Only block key press events + with fig.canvas.callbacks.blocked(signal="key_press_event"): + plt.show() diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py index ae7e5cd056e0..109b9ea69cc9 100644 --- a/lib/matplotlib/cbook/__init__.py +++ b/lib/matplotlib/cbook/__init__.py @@ -122,7 +122,8 @@ def _weak_or_strong_ref(func, callback): class CallbackRegistry: """ - Handle registering and disconnecting for a set of signals and callbacks: + Handle registering, processing, blocking, and disconnecting + for a set of signals and callbacks: >>> def oneat(x): ... print('eat', x) @@ -140,9 +141,15 @@ class CallbackRegistry: >>> callbacks.process('eat', 456) eat 456 >>> callbacks.process('be merry', 456) # nothing will be called + >>> callbacks.disconnect(id_eat) >>> callbacks.process('eat', 456) # nothing will be called + >>> with callbacks.blocked(signal='drink'): + ... callbacks.process('drink', 123) # nothing will be called + >>> callbacks.process('drink', 123) + drink 123 + In practice, one should always disconnect all callbacks when they are no longer needed to avoid dangling references (and thus memory leaks). However, real code in Matplotlib rarely does so, and due to its design, @@ -280,6 +287,31 @@ def process(self, s, *args, **kwargs): else: raise + @contextlib.contextmanager + def blocked(self, *, signal=None): + """ + Block callback signals from being processed. + + A context manager to temporarily block/disable callback signals + from being processed by the registered listeners. + + Parameters + ---------- + signal : str, optional + The callback signal to block. The default is to block all signals. + """ + orig = self.callbacks + try: + if signal is None: + # Empty out the callbacks + self.callbacks = {} + else: + # Only remove the specific signal + self.callbacks = {k: orig[k] for k in orig if k != signal} + yield + finally: + self.callbacks = orig + class silent_list(list): """
diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py index 47287524afde..474ea1a41d93 100644 --- a/lib/matplotlib/tests/test_cbook.py +++ b/lib/matplotlib/tests/test_cbook.py @@ -361,6 +361,39 @@ def test_callbackregistry_custom_exception_handler(monkeypatch, cb, excp): cb.process('foo') +def test_callbackregistry_blocking(): + # Needs an exception handler for interactive testing environments + # that would only print this out instead of raising the exception + def raise_handler(excp): + raise excp + cb = cbook.CallbackRegistry(exception_handler=raise_handler) + def test_func1(): + raise ValueError("1 should be blocked") + def test_func2(): + raise ValueError("2 should be blocked") + cb.connect("test1", test_func1) + cb.connect("test2", test_func2) + + # block all of the callbacks to make sure they aren't processed + with cb.blocked(): + cb.process("test1") + cb.process("test2") + + # block individual callbacks to make sure the other is still processed + with cb.blocked(signal="test1"): + # Blocked + cb.process("test1") + # Should raise + with pytest.raises(ValueError, match="2 should be blocked"): + cb.process("test2") + + # Make sure the original callback functions are there after blocking + with pytest.raises(ValueError, match="1 should be blocked"): + cb.process("test1") + with pytest.raises(ValueError, match="2 should be blocked"): + cb.process("test2") + + def test_sanitize_sequence(): d = {'a': 1, 'b': 2, 'c': 3} k = ['a', 'b', 'c']
[ { "path": "doc/users/next_whats_new/callback_blocking.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callback_blocking.rst", "metadata": "diff --git a/doc/users/next_whats_new/callback_blocking.rst b/doc/users/next_whats_new/callback_blocking.rst\nnew file mode 100644\nindex 000000000000..090e06c61bbf\n--- /dev/null\n+++ b/doc/users/next_whats_new/callback_blocking.rst\n@@ -0,0 +1,25 @@\n+``CallbackRegistry`` objects gain a method to temporarily block signals\n+-----------------------------------------------------------------------\n+\n+The context manager `~matplotlib.cbook.CallbackRegistry.blocked` can be used\n+to block callback signals from being processed by the ``CallbackRegistry``.\n+The optional keyword, *signal*, can be used to block a specific signal\n+from being processed and let all other signals pass.\n+\n+.. code-block::\n+\n+ import matplotlib.pyplot as plt\n+ \n+ fig, ax = plt.subplots()\n+ ax.imshow([[0, 1], [2, 3]])\n+\n+ # Block all interactivity through the canvas callbacks\n+ with fig.canvas.callbacks.blocked():\n+ plt.show()\n+\n+ fig, ax = plt.subplots()\n+ ax.imshow([[0, 1], [2, 3]])\n+\n+ # Only block key press events\n+ with fig.canvas.callbacks.blocked(signal=\"key_press_event\"):\n+ plt.show()\n" } ]
3.4
586fcffaae03e40f851c5bc854de290b89bae18e
[ "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[inp1-expected1-kwargs_to_norm1]", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_fail[inp1-kwargs_to_norm1]", "lib/matplotlib/tests/test_cbook.py::Test_boxplot_stats::test_boxplot_stats_autorange_false", "lib/matplotlib/tests/test_cbook.py::test_grouper_private", "lib/matplotlib/tests/test_cbook.py::Test_boxplot_stats::test_bad_dims", "lib/matplotlib/tests/test_cbook.py::test_flatiter", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[None-expected0-kwargs_to_norm0]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_datetime", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[inp2-expected2-kwargs_to_norm2]", "lib/matplotlib/tests/test_cbook.py::test_safe_first_element_pandas_series", "lib/matplotlib/tests/test_cbook.py::test_to_poststep", "lib/matplotlib/tests/test_cbook.py::test_array_patch_perimeters", "lib/matplotlib/tests/test_cbook.py::test_format_approx", "lib/matplotlib/tests/test_cbook.py::Test_callback_registry::test_pickling", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_bad_first_arg", "lib/matplotlib/tests/test_cbook.py::test_warn_external", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb1-TestException]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_string_seq", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args1]", "lib/matplotlib/tests/test_cbook.py::test_contiguous_regions", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb2-ValueError]", "lib/matplotlib/tests/test_cbook.py::test_warn_external_frame_embedded_python", "lib/matplotlib/tests/test_cbook.py::test_grouper", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args0]", "lib/matplotlib/tests/test_cbook.py::test_reshape2d", "lib/matplotlib/tests/test_cbook.py::test_to_prestep_empty", "lib/matplotlib/tests/test_cbook.py::test_reshape2d_pandas", "lib/matplotlib/tests/test_cbook.py::test_to_prestep", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_fail[inp0-kwargs_to_norm0]", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb0-RuntimeError]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_rgba", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_default_exception_handler", "lib/matplotlib/tests/test_cbook.py::test_to_poststep_empty", "lib/matplotlib/tests/test_cbook.py::test_to_midstep", "lib/matplotlib/tests/test_cbook.py::test_to_midstep_empty", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args2]", "lib/matplotlib/tests/test_cbook.py::test_sanitize_sequence", "lib/matplotlib/tests/test_cbook.py::test_setattr_cm" ]
[ "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_blocking" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/callback_blocking.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callback_blocking.rst", "metadata": "diff --git a/doc/users/next_whats_new/callback_blocking.rst b/doc/users/next_whats_new/callback_blocking.rst\nnew file mode 100644\nindex 000000000000..090e06c61bbf\n--- /dev/null\n+++ b/doc/users/next_whats_new/callback_blocking.rst\n@@ -0,0 +1,25 @@\n+``CallbackRegistry`` objects gain a method to temporarily block signals\n+-----------------------------------------------------------------------\n+\n+The context manager `~matplotlib.cbook.CallbackRegistry.blocked` can be used\n+to block callback signals from being processed by the ``CallbackRegistry``.\n+The optional keyword, *signal*, can be used to block a specific signal\n+from being processed and let all other signals pass.\n+\n+.. code-block::\n+\n+ import matplotlib.pyplot as plt\n+ \n+ fig, ax = plt.subplots()\n+ ax.imshow([[0, 1], [2, 3]])\n+\n+ # Block all interactivity through the canvas callbacks\n+ with fig.canvas.callbacks.blocked():\n+ plt.show()\n+\n+ fig, ax = plt.subplots()\n+ ax.imshow([[0, 1], [2, 3]])\n+\n+ # Only block key press events\n+ with fig.canvas.callbacks.blocked(signal=\"key_press_event\"):\n+ plt.show()\n" } ]
diff --git a/doc/users/next_whats_new/callback_blocking.rst b/doc/users/next_whats_new/callback_blocking.rst new file mode 100644 index 000000000000..090e06c61bbf --- /dev/null +++ b/doc/users/next_whats_new/callback_blocking.rst @@ -0,0 +1,25 @@ +``CallbackRegistry`` objects gain a method to temporarily block signals +----------------------------------------------------------------------- + +The context manager `~matplotlib.cbook.CallbackRegistry.blocked` can be used +to block callback signals from being processed by the ``CallbackRegistry``. +The optional keyword, *signal*, can be used to block a specific signal +from being processed and let all other signals pass. + +.. code-block:: + + import matplotlib.pyplot as plt + + fig, ax = plt.subplots() + ax.imshow([[0, 1], [2, 3]]) + + # Block all interactivity through the canvas callbacks + with fig.canvas.callbacks.blocked(): + plt.show() + + fig, ax = plt.subplots() + ax.imshow([[0, 1], [2, 3]]) + + # Only block key press events + with fig.canvas.callbacks.blocked(signal="key_press_event"): + plt.show()
matplotlib/matplotlib
matplotlib__matplotlib-23690
https://github.com/matplotlib/matplotlib/pull/23690
diff --git a/doc/users/next_whats_new/bar_label_formatting.rst b/doc/users/next_whats_new/bar_label_formatting.rst new file mode 100644 index 000000000000..cf64436086d4 --- /dev/null +++ b/doc/users/next_whats_new/bar_label_formatting.rst @@ -0,0 +1,31 @@ +Additional format string options in `~matplotlib.axes.Axes.bar_label` +--------------------------------------------------------------------- + +The ``fmt`` argument of `~matplotlib.axes.Axes.bar_label` now accepts +{}-style format strings: + +.. code-block:: python + + import matplotlib.pyplot as plt + + fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio'] + fruit_counts = [4000, 2000, 7000] + + fig, ax = plt.subplots() + bar_container = ax.bar(fruit_names, fruit_counts) + ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000)) + ax.bar_label(bar_container, fmt='{:,.0f}') + +It also accepts callables: + +.. code-block:: python + + animal_names = ['Lion', 'Gazelle', 'Cheetah'] + mph_speed = [50, 60, 75] + + fig, ax = plt.subplots() + bar_container = ax.bar(animal_names, mph_speed) + ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80)) + ax.bar_label( + bar_container, fmt=lambda x: '{:.1f} km/h'.format(x * 1.61) + ) diff --git a/examples/lines_bars_and_markers/bar_label_demo.py b/examples/lines_bars_and_markers/bar_label_demo.py index 3ed3f79018cc..2bf0be68af63 100644 --- a/examples/lines_bars_and_markers/bar_label_demo.py +++ b/examples/lines_bars_and_markers/bar_label_demo.py @@ -94,6 +94,30 @@ plt.show() +############################################################################### +# Bar labels using {}-style format string + +fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio'] +fruit_counts = [4000, 2000, 7000] + +fig, ax = plt.subplots() +bar_container = ax.bar(fruit_names, fruit_counts) +ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000)) +ax.bar_label(bar_container, fmt='{:,.0f}') + +############################################################################### +# Bar labels using a callable + +animal_names = ['Lion', 'Gazelle', 'Cheetah'] +mph_speed = [50, 60, 75] + +fig, ax = plt.subplots() +bar_container = ax.bar(animal_names, mph_speed) +ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80)) +ax.bar_label( + bar_container, fmt=lambda x: '{:.1f} km/h'.format(x * 1.61) +) + ############################################################################# # # .. admonition:: References diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index cb1d4c989c23..a353e70e21b2 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2622,8 +2622,11 @@ def bar_label(self, container, labels=None, *, fmt="%g", label_type="edge", A list of label texts, that should be displayed. If not given, the label texts will be the data values formatted with *fmt*. - fmt : str, default: '%g' - A format string for the label. + fmt : str or callable, default: '%g' + An unnamed %-style or {}-style format string for the label or a + function to call with the value as the first argument. + When *fmt* is a string and can be interpreted in both formats, + %-style takes precedence over {}-style. label_type : {'edge', 'center'}, default: 'edge' The label type. Possible values: @@ -2745,7 +2748,14 @@ def sign(x): if np.isnan(dat): lbl = '' - annotation = self.annotate(fmt % value if lbl is None else lbl, + if lbl is None: + if isinstance(fmt, str): + lbl = cbook._auto_format_str(fmt, value) + elif callable(fmt): + lbl = fmt(value) + else: + raise TypeError("fmt must be a str or callable") + annotation = self.annotate(lbl, xy, xytext, textcoords="offset points", ha=ha, va=va, **kwargs) annotations.append(annotation) diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py index f364b8d178f2..664fcc71a262 100644 --- a/lib/matplotlib/cbook/__init__.py +++ b/lib/matplotlib/cbook/__init__.py @@ -2312,3 +2312,30 @@ def _unpack_to_numpy(x): if isinstance(xtmp, np.ndarray): return xtmp return x + + +def _auto_format_str(fmt, value): + """ + Apply *value* to the format string *fmt*. + + This works both with unnamed %-style formatting and + unnamed {}-style formatting. %-style formatting has priority. + If *fmt* is %-style formattable that will be used. Otherwise, + {}-formatting is applied. Strings without formatting placeholders + are passed through as is. + + Examples + -------- + >>> _auto_format_str('%.2f m', 0.2) + '0.20 m' + >>> _auto_format_str('{} m', 0.2) + '0.2 m' + >>> _auto_format_str('const', 0.2) + 'const' + >>> _auto_format_str('%d or {}', 0.2) + '0 or {}' + """ + try: + return fmt % (value,) + except (TypeError, ValueError): + return fmt.format(value)
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 268eb957f470..6141d3220d06 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -7762,14 +7762,24 @@ def test_bar_label_location_errorbars(): assert labels[1].get_va() == 'top' -def test_bar_label_fmt(): +@pytest.mark.parametrize('fmt', [ + '%.2f', '{:.2f}', '{:.2f}'.format +]) +def test_bar_label_fmt(fmt): ax = plt.gca() rects = ax.bar([1, 2], [3, -4]) - labels = ax.bar_label(rects, fmt='%.2f') + labels = ax.bar_label(rects, fmt=fmt) assert labels[0].get_text() == '3.00' assert labels[1].get_text() == '-4.00' +def test_bar_label_fmt_error(): + ax = plt.gca() + rects = ax.bar([1, 2], [3, -4]) + with pytest.raises(TypeError, match='str or callable'): + _ = ax.bar_label(rects, fmt=10) + + def test_bar_label_labels(): ax = plt.gca() rects = ax.bar([1, 2], [3, -4]) diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py index 70f2c2499418..c2f7c8d17ab2 100644 --- a/lib/matplotlib/tests/test_cbook.py +++ b/lib/matplotlib/tests/test_cbook.py @@ -895,3 +895,19 @@ def test_safe_first_element_with_none(): datetime_lst[0] = None actual = cbook._safe_first_non_none(datetime_lst) assert actual is not None and actual == datetime_lst[1] + + +@pytest.mark.parametrize('fmt, value, result', [ + ('%.2f m', 0.2, '0.20 m'), + ('{:.2f} m', 0.2, '0.20 m'), + ('{} m', 0.2, '0.2 m'), + ('const', 0.2, 'const'), + ('%d or {}', 0.2, '0 or {}'), + ('{{{:,.0f}}}', 2e5, '{200,000}'), + ('{:.2%}', 2/3, '66.67%'), + ('$%g', 2.54, '$2.54'), +]) +def test_auto_format_str(fmt, value, result): + """Apply *value* to the format string *fmt*.""" + assert cbook._auto_format_str(fmt, value) == result + assert cbook._auto_format_str(fmt, np.float64(value)) == result
[ { "path": "doc/users/next_whats_new/bar_label_formatting.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/bar_label_formatting.rst", "metadata": "diff --git a/doc/users/next_whats_new/bar_label_formatting.rst b/doc/users/next_whats_new/bar_label_formatting.rst\nnew file mode 100644\nindex 000000000000..cf64436086d4\n--- /dev/null\n+++ b/doc/users/next_whats_new/bar_label_formatting.rst\n@@ -0,0 +1,31 @@\n+Additional format string options in `~matplotlib.axes.Axes.bar_label`\n+---------------------------------------------------------------------\n+\n+The ``fmt`` argument of `~matplotlib.axes.Axes.bar_label` now accepts\n+{}-style format strings:\n+\n+.. code-block:: python\n+\n+ import matplotlib.pyplot as plt\n+\n+ fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio']\n+ fruit_counts = [4000, 2000, 7000]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.bar(fruit_names, fruit_counts)\n+ ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000))\n+ ax.bar_label(bar_container, fmt='{:,.0f}')\n+\n+It also accepts callables:\n+\n+.. code-block:: python\n+\n+ animal_names = ['Lion', 'Gazelle', 'Cheetah']\n+ mph_speed = [50, 60, 75]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.bar(animal_names, mph_speed)\n+ ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80))\n+ ax.bar_label(\n+ bar_container, fmt=lambda x: '{:.1f} km/h'.format(x * 1.61)\n+ )\n" } ]
3.5
9b1fcf67c4228c4a2788af5bcaf0c6fde09a55bf
[ "lib/matplotlib/tests/test_axes.py::test_bxp_percentilewhis[png]", "lib/matplotlib/tests/test_axes.py::test_hexbin_log_clim", "lib/matplotlib/tests/test_axes.py::test_title_pad", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_across_transforms[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data0]", "lib/matplotlib/tests/test_axes.py::test_boxplot[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-symlog]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[png]", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_fail[inp1-kwargs_to_norm1]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[svg]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-y]", "lib/matplotlib/tests/test_axes.py::test_inverted_limits", "lib/matplotlib/tests/test_axes.py::test_color_length_mismatch", "lib/matplotlib/tests/test_cbook.py::test_warn_external", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym2[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_marker[png]", "lib/matplotlib/tests/test_axes.py::test_spy[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_formatter", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-y]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args0-kwargs0-axis\\\\(\\\\) takes 0 or 1 positional arguments but 2 were given]", "lib/matplotlib/tests/test_axes.py::test_log_scales_invalid", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[y]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[medium]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[png]", "lib/matplotlib/tests/test_cbook.py::test_to_midstep_empty", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_cbook.py::test_safe_first_element_pandas_series", "lib/matplotlib/tests/test_axes.py::test_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_canonical[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[svg]", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_nobox[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[12]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every_invalid", "lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs32]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_center", "lib/matplotlib/tests/test_axes.py::test_rc_grid[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_scatter_empty_data", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[center title kept]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[svg]", "lib/matplotlib/tests/test_axes.py::test_relim_visible_only", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : \"quoted str\" # comment-a : \"quoted str\"]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple[png]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[svg]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[8]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_2[png]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[png]", "lib/matplotlib/tests/test_axes.py::test_autoscale_log_shared", "lib/matplotlib/tests/test_axes.py::test_boxplot_zorder", "lib/matplotlib/tests/test_axes.py::test_symlog2[pdf]", "lib/matplotlib/tests/test_axes.py::test_patch_bounds", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params2-expected_result2]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_rgba", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata_inverted", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs10]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_pie_rotatelabels_true[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[svg]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_stairs_datetime[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_retick", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[minor-False-True]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params0-expected_result0]", "lib/matplotlib/tests/test_axes.py::test_pandas_bar_align_center", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_ci", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_xlabelside", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[both-True-True]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case11-shape]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical_yinverted", "lib/matplotlib/tests/test_axes.py::test_pie_ccw_true[png]", "lib/matplotlib/tests/test_axes.py::test_hist_bar_empty[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[pdf]", "lib/matplotlib/tests/test_axes.py::test_pie_center_radius[png]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_timedelta", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_fill_units[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs21]", "lib/matplotlib/tests/test_cbook.py::test_to_poststep_empty", "lib/matplotlib/tests/test_axes.py::test_loglog_nonpos[png]", "lib/matplotlib/tests/test_axes.py::test_hist_labels", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[inp2-expected2-kwargs_to_norm2]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_bbox_aspect_axes_init", "lib/matplotlib/tests/test_axes.py::test_bar_color_none_alpha", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs7]", "lib/matplotlib/tests/test_axes.py::test_errorbar_shape", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs8]", "lib/matplotlib/tests/test_axes.py::test_nan_bar_values", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data0]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case18-shape]", "lib/matplotlib/tests/test_axes.py::test_cla_not_redefined", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_log[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-True]", "lib/matplotlib/tests/test_axes.py::test_eventplot[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs4-r]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_height[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs50]", "lib/matplotlib/tests/test_axes.py::test_arrow_simple[png]", "lib/matplotlib/tests/test_axes.py::test_empty_shared_subplots", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom[png]", "lib/matplotlib/tests/test_axes.py::test_psd_csd_edge_cases", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_empty_ticks_fixed_loc", "lib/matplotlib/tests/test_axes.py::test_pandas_errorbar_indexing", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[svg]", "lib/matplotlib/tests/test_axes.py::test_bezier_autoscale", "lib/matplotlib/tests/test_axes.py::test_hist_log[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_filled[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs27]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case1-conversion]", "lib/matplotlib/tests/test_axes.py::test_use_sticky_edges", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[pdf]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs33]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmeans[png]", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_arrow_empty", "lib/matplotlib/tests/test_axes.py::test_hist_barstacked_bottom_unchanged", "lib/matplotlib/tests/test_axes.py::test_log_margins", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs39]", "lib/matplotlib/tests/test_axes.py::test_rc_spines[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[svg]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[svg]", "lib/matplotlib/tests/test_cbook.py::test_setattr_cm", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case16-shape]", "lib/matplotlib/tests/test_axes.py::test_boxplot_marker_behavior", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args4-kwargs4-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_annotate_signature", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args2]", "lib/matplotlib/tests/test_axes.py::test_stairs_baseline_0[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth1]", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matplotlib/tests/test_axes.py::test_secondary_xy[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[pdf]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_normal_axes", "lib/matplotlib/tests/test_axes.py::test_specgram_magnitude[png]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvspan-axhspan-args1]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data2]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidth[png]", "lib/matplotlib/tests/test_axes.py::test_stem_markerfmt", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case19-None]", "lib/matplotlib/tests/test_axes.py::test_o_marker_path_snap[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_single_list_quantiles[png]", "lib/matplotlib/tests/test_axes.py::test_title_location_roundtrip", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_mismatch", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args5-kwargs5-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb0-RuntimeError]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case20-shape]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case28-conversion]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-True]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical", "lib/matplotlib/tests/test_axes.py::test_set_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs19]", "lib/matplotlib/tests/test_axes.py::test_inset", "lib/matplotlib/tests/test_cbook.py::test_array_patch_perimeters", "lib/matplotlib/tests/test_axes.py::test_barb_units", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs34]", "lib/matplotlib/tests/test_axes.py::test_boxplot_dates_pandas", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[png]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_problem_kwargs[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[svg]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_y[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-log]", "lib/matplotlib/tests/test_axes.py::test_hist_step_geometry", "lib/matplotlib/tests/test_axes.py::test_inset_projection", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_positions", "lib/matplotlib/tests/test_axes.py::test_stairs_edge_handling[png]", "lib/matplotlib/tests/test_axes.py::test_bar_edgecolor_none_alpha", "lib/matplotlib/tests/test_axes.py::test_log_scales_no_data", "lib/matplotlib/tests/test_axes.py::test_bxp_shownotches[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs49]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[center]", "lib/matplotlib/tests/test_axes.py::test_get_xticklabel", "lib/matplotlib/tests/test_axes.py::test_shared_bool", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_rangewhis[png]", "lib/matplotlib/tests/test_cbook.py::test_sanitize_sequence", "lib/matplotlib/tests/test_axes.py::test_boxplot_autorange_whiskers[png]", "lib/matplotlib/tests/test_axes.py::test_hist2d[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[pdf]", "lib/matplotlib/tests/test_axes.py::test_text_labelsize", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x[png]", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case10-None]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_linewidths", "lib/matplotlib/tests/test_axes.py::test_shaped_data[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs14]", "lib/matplotlib/tests/test_axes.py::test_offset_text_visible", "lib/matplotlib/tests/test_axes.py::test_symlog[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_inset_polar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[svg]", "lib/matplotlib/tests/test_axes.py::test_spectrum[png]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[pdf]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data0]", "lib/matplotlib/tests/test_axes.py::test_structured_data", "lib/matplotlib/tests/test_axes.py::test_minor_accountedfor", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-y]", "lib/matplotlib/tests/test_axes.py::test_pie_frame_grid[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x2_input]", "lib/matplotlib/tests/test_axes.py::test_axis_bool_arguments[png]", "lib/matplotlib/tests/test_axes.py::test_markers_fillstyle_rcparams[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_autoscale", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes_relim", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[pdf]", "lib/matplotlib/tests/test_axes.py::test_tick_param_label_rotation", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-y]", "lib/matplotlib/tests/test_axes.py::test_errorbar[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_widths", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_edgecolor_RGB", "lib/matplotlib/tests/test_axes.py::test_plot_format_kwarg_redundant", "lib/matplotlib/tests/test_cbook.py::test_flatiter", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-plot]", "lib/matplotlib/tests/test_axes.py::test_boxplot_no_weird_whisker[png]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[png]", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_rcparam[png]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[True]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs5-face]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[bar-1]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_0[png]", "lib/matplotlib/tests/test_axes.py::test_automatic_legend", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case27-conversion]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_string_seq", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case29-conversion]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs_5205", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_manage_xticks", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[png]", "lib/matplotlib/tests/test_axes.py::test_unicode_hist_label", "lib/matplotlib/tests/test_axes.py::test_bxp_nocaps[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs5]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[pdf]", "lib/matplotlib/tests/test_cbook.py::test_reshape2d", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params1-expected_result1]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_hist_density[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_colorcycle", "lib/matplotlib/tests/test_axes.py::test_bxp_showcustommean[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs26]", "lib/matplotlib/tests/test_axes.py::test_mismatched_ticklabels", "lib/matplotlib/tests/test_axes.py::test_stairs_update[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs4]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors2]", "lib/matplotlib/tests/test_axes.py::test_pie_get_negative_values", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y2_input]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[svg]", "lib/matplotlib/tests/test_axes.py::test_stackplot[svg]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_bar_labels_length", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_small[eps]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_twin_spines[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_aitoff_proj[png]", "lib/matplotlib/tests/test_axes.py::test_xerr_yerr_not_negative", "lib/matplotlib/tests/test_axes.py::test_adjust_numtick_aspect", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data1]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfillable", "lib/matplotlib/tests/test_axes.py::test_empty_line_plots", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_blocking", "lib/matplotlib/tests/test_axes.py::test_axis_set_tick_params_labelsize_labelcolor", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-True]", "lib/matplotlib/tests/test_axes.py::test_mollweide_forward_inverse_closure", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_default_exception_handler", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_warn_ignored_scatter_kwargs", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[%.2f]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_medians", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : [\"#000000\", \"#FFFFFF\"] # comment-a : [\"#000000\", \"#FFFFFF\"]]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[pdf]", "lib/matplotlib/tests/test_cbook.py::test_to_prestep_empty", "lib/matplotlib/tests/test_axes.py::test_redraw_in_frame", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_boxplot_with_CIarray[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params4-expected_result4]", "lib/matplotlib/tests/test_axes.py::test_quiver_units", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_datalim", "lib/matplotlib/tests/test_axes.py::test_specgram_fs_none", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[png]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvline-axhline-args0]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-large]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_datetime", "lib/matplotlib/tests/test_axes.py::test_pyplot_axes", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-x]", "lib/matplotlib/tests/test_axes.py::test_sharing_does_not_link_positions", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_step_empty[png]", "lib/matplotlib/tests/test_axes.py::test_vlines_default", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top_both", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[step-2]", "lib/matplotlib/tests/test_cbook.py::Test_boxplot_stats::test_bad_dims", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x_and_y[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[png]", "lib/matplotlib/tests/test_axes.py::test_spines_properbbox_after_zoom", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[svg]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case26-shape]", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb2-ValueError]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_gridlines", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_barh_tick_label[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[png]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : \"#000000\" # comment-a : \"#000000\"]", "lib/matplotlib/tests/test_axes.py::test_set_get_ticklabels[png]", "lib/matplotlib/tests/test_axes.py::test_hist_emptydata", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[svg]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[svg]", "lib/matplotlib/tests/test_axes.py::test_move_offsetlabel", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[None-None]", "lib/matplotlib/tests/test_axes.py::test_grid", "lib/matplotlib/tests/test_axes.py::test_bxp_customwidths[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs20]", "lib/matplotlib/tests/test_axes.py::test_pcolor_datetime_axis[png]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : val # a comment \"with quotes\"-a : val]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_dates", "lib/matplotlib/tests/test_axes.py::test_multiplot_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case13-None]", "lib/matplotlib/tests/test_axes.py::test_axline[pdf]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-False]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_y_input]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_no_flier_stats[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case7-conversion]", "lib/matplotlib/tests/test_axes.py::test_axis_method_errors", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case17-None]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[png]", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_fail[inp0-kwargs_to_norm0]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[pdf]", "lib/matplotlib/tests/test_axes.py::test_zoom_inset", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data2]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case12-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs44]", "lib/matplotlib/tests/test_axes.py::test_bar_ticklabel_fail", "lib/matplotlib/tests/test_axes.py::test_errorbar_nan[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_positions", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_imshow_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfilled", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data1-1]", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[None-expected0-kwargs_to_norm0]", "lib/matplotlib/tests/test_axes.py::test_bad_plot_args", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case8-conversion]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_1", "lib/matplotlib/tests/test_axes.py::test_vertex_markers[png]", "lib/matplotlib/tests/test_axes.py::test_2dcolor_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_violinplot_pandas_series[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-y]", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data0]", "lib/matplotlib/tests/test_axes.py::test_retain_tick_visibility[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[pdf]", "lib/matplotlib/tests/test_axes.py::test_hexbin_empty[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_2D[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case22-shape]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_x_input]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_axline[svg]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_xticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-small]", "lib/matplotlib/tests/test_axes.py::test_secondary_resize", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[png]", "lib/matplotlib/tests/test_axes.py::test_offset_label_color", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-log]", "lib/matplotlib/tests/test_axes.py::test_artist_sublists", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs8-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_line_specific_kwargs", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs3-expected_edgecolors3]", "lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data1]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[right]", "lib/matplotlib/tests/test_axes.py::test_reset_grid", "lib/matplotlib/tests/test_cbook.py::test_step_fails[args0]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case23-None]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_hist", "lib/matplotlib/tests/test_axes.py::test_errorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_color_None", "lib/matplotlib/tests/test_axes.py::test_markevery_line[svg]", "lib/matplotlib/tests/test_axes.py::test_normalize_kwarg_pie", "lib/matplotlib/tests/test_axes.py::test_axisbelow[png]", "lib/matplotlib/tests/test_cbook.py::test_reshape2d_pandas", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_annotate_default_arrow", "lib/matplotlib/tests/test_axes.py::test_tick_padding_tightbbox", "lib/matplotlib/tests/test_axes.py::test_bxp_customoutlier[png]", "lib/matplotlib/tests/test_cbook.py::test_to_poststep", "lib/matplotlib/tests/test_axes.py::test_canonical[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-y]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[png]", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_custom_exception_handler[cb1-TestException]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompatchartist[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar[pdf]", "lib/matplotlib/tests/test_cbook.py::test_normalize_kwargs_pass[inp1-expected1-kwargs_to_norm1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs43]", "lib/matplotlib/tests/test_axes.py::test_titletwiny", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs17]", "lib/matplotlib/tests/test_axes.py::test_box_aspect", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_ylabelside", "lib/matplotlib/tests/test_cbook.py::Test_boxplot_stats::test_boxplot_stats_autorange_false", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_patchartist[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[small]", "lib/matplotlib/tests/test_axes.py::test_psd_csd[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_set_noniterable_ticklabels", "lib/matplotlib/tests/test_axes.py::test_canonical[pdf]", "lib/matplotlib/tests/test_axes.py::test_shared_scale", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_errorbars", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[stepfilled-1]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case5-None]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x3-width3-bars-expected_labels3-bars]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_stem_dates", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs40]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-symlog]", "lib/matplotlib/tests/test_axes.py::test_stairs_empty", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[png]", "lib/matplotlib/tests/test_axes.py::test_inset_subclass", "lib/matplotlib/tests/test_axes.py::test_funcformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_dash_offset[pdf]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[png]", "lib/matplotlib/tests/test_axes.py::test_axline[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_in_view", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-x]", "lib/matplotlib/tests/test_axes.py::test_hist_range_and_density", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_no_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_yticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_violinplot_outofrange_quantiles", "lib/matplotlib/tests/test_axes.py::test_boxplot[svg]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[png]", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_bad_first_arg", "lib/matplotlib/tests/test_axes.py::test_invisible_axes_events", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs35]", "lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_matshow[png]", "lib/matplotlib/tests/test_axes.py::test_hist_log_2[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_clim", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[svg]", "lib/matplotlib/tests/test_axes.py::test_gettightbbox_ignore_nan", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case14-conversion]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case21-None]", "lib/matplotlib/tests/test_axes.py::test_inverted_cla", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[pdf]", "lib/matplotlib/tests/test_axes.py::test_sticky_shared_axes[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y1_input]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs9-r]", "lib/matplotlib/tests/test_axes.py::test_hexbin_extent[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompositions[png]", "lib/matplotlib/tests/test_axes.py::test_nan_barlabels", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xyinverted", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_geometry", "lib/matplotlib/tests/test_axes.py::test_pathological_hexbin", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_margins", "lib/matplotlib/tests/test_axes.py::test_boxplot_mod_artist_after_plotting[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-False]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : no_comment-a : no_comment]", "lib/matplotlib/tests/test_axes.py::test_pie_default[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[svg]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args2-kwargs2-the first argument to axis*]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs45]", "lib/matplotlib/tests/test_axes.py::test_subplot_key_hash", "lib/matplotlib/tests/test_axes.py::test_errorbar_dashes[png]", "lib/matplotlib/tests/test_axes.py::test_axes_margins", "lib/matplotlib/tests/test_axes.py::test_fillbetween_cycle", "lib/matplotlib/tests/test_axes.py::test_hexbin_pickable", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[datetime.datetime]", "lib/matplotlib/tests/test_axes.py::test_polar_interpolation_steps_variable_r[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x1_input]", "lib/matplotlib/tests/test_axes.py::test_pie_textprops", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-scatter]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs24]", "lib/matplotlib/tests/test_axes.py::test_hist2d[svg]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-x]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tight", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_error", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_bar_color_cycle", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs10-g]", "lib/matplotlib/tests/test_axes.py::test_vline_limit", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[left]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[left title moved]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_single[png]", "lib/matplotlib/tests/test_axes.py::test_large_offset", "lib/matplotlib/tests/test_axes.py::test_rc_tick", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[large]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_sticky", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_eventplot_defaults[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_labels", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args3-kwargs3-axis\\\\(\\\\) got an unexpected keyword argument 'foo']", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs48]", "lib/matplotlib/tests/test_cbook.py::test_to_midstep", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs12]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[10]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : \"quoted str\"-a : \"quoted str\"]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-x]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas", "lib/matplotlib/tests/test_axes.py::test_empty_errorbar_legend", "lib/matplotlib/tests/test_axes.py::test_length_one_hist", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_color_c[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot[svg]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : \"#000000\"-a : \"#000000\"]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_with_labels[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_bxp_customcap[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs30]", "lib/matplotlib/tests/test_axes.py::test_hexbin_linear[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs25]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_ylabels[png]", "lib/matplotlib/tests/test_axes.py::test_bar_uint8", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-large]", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[# only comment \"with quotes\" xx-]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmeanasline[png]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_custommedian[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nonefmt", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-fill_between]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs0-None]", "lib/matplotlib/tests/test_axes.py::test_hist_step_horiz[png]", "lib/matplotlib/tests/test_axes.py::test_nodecorator", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg", "lib/matplotlib/tests/test_axes.py::test_stairs[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[svg]", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data1]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[red-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[1]", "lib/matplotlib/tests/test_axes.py::test_mollweide_inverse_forward_closure", "lib/matplotlib/tests/test_cbook.py::test_warn_external_frame_embedded_python", "lib/matplotlib/tests/test_cbook.py::test_strip_comment[a : [\"#000000\", \"#FFFFFF\"]-a : [\"#000000\", \"#FFFFFF\"]]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs16]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs28]", "lib/matplotlib/tests/test_axes.py::test_stem_args", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_width[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[svg]", "lib/matplotlib/tests/test_axes.py::test_secondary_repr", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x-1-x-expected_labels0-x]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-x]", "lib/matplotlib/tests/test_axes.py::test_stairs_fill[png]", "lib/matplotlib/tests/test_axes.py::test_specgram[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[np.datetime64]", "lib/matplotlib/tests/test_cbook.py::test_grouper", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xinverted", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[pdf]", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_series_non_zero_index", "lib/matplotlib/tests/test_axes.py::test_rc_major_minor_tick", "lib/matplotlib/tests/test_axes.py::test_hist_log_barstacked", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs9]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs23]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_tick_space_size_0", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs46]", "lib/matplotlib/tests/test_axes.py::test_label_shift", "lib/matplotlib/tests/test_axes.py::test_pandas_pcolormesh", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_xlabels[png]", "lib/matplotlib/tests/test_axes.py::test_set_xy_bound", "lib/matplotlib/tests/test_axes.py::test_boxplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_acorr[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs11]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[none-None]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-x]", "lib/matplotlib/tests/test_axes.py::test_vlines[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas_indexed", "lib/matplotlib/tests/test_axes.py::test_hist_log[svg]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[svg]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_remove[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs36]", "lib/matplotlib/tests/test_axes.py::test_imshow[png]", "lib/matplotlib/tests/test_cbook.py::test_to_prestep", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_plot_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_inverted", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[svg]", "lib/matplotlib/tests/test_cbook.py::test_contiguous_regions", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[png]", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_box", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[png]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_3", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_quantiles", "lib/matplotlib/tests/test_axes.py::test_square_plot", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[x]", "lib/matplotlib/tests/test_axes.py::test_zero_linewidth", "lib/matplotlib/tests/test_axes.py::test_stairs_options[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[larger]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params3-expected_result3]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-x]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_nan", "lib/matplotlib/tests/test_axes.py::test_as_mpl_axes_api", "lib/matplotlib/tests/test_axes.py::test_empty_eventplot", "lib/matplotlib/tests/test_axes.py::test_title_no_move_off_page", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs51]", "lib/matplotlib/tests/test_axes.py::test_bar_timedelta", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_kwarg", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_marker_as_markerstyle", "lib/matplotlib/tests/test_axes.py::test_titlesetpos", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[pdf]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[svg]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-small]", "lib/matplotlib/tests/test_axes.py::test_single_point[svg]", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs13]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs6]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case15-None]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs2-r]", "lib/matplotlib/tests/test_axes.py::test_hist2d[pdf]", "lib/matplotlib/tests/test_axes.py::test_color_alias", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs7-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs15]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_with_prop_cycle[png]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x2-width2-label2-expected_labels2-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_density", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs18]", "lib/matplotlib/tests/test_axes.py::test_eventplot_legend", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_index_shape", "lib/matplotlib/tests/test_axes.py::test_marker_edges[pdf]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs42]", "lib/matplotlib/tests/test_axes.py::test_box_aspect_custom_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::test_tickdirs", "lib/matplotlib/tests/test_axes.py::test_set_margin_updates_limits", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-x]", "lib/matplotlib/tests/test_cbook.py::test_index_of_pandas", "lib/matplotlib/tests/test_axes.py::test_bxp_custombox[png]", "lib/matplotlib/tests/test_axes.py::test_twin_spines_on_top[png]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[svg]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_widths", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_plot_errors", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-False]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data1]", "lib/matplotlib/tests/test_axes.py::test_pcolorflaterror", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[major-True-False]", "lib/matplotlib/tests/test_axes.py::test_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_invalid_axis_limits", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs31]", "lib/matplotlib/tests/test_axes.py::test_pcolornearestunits[png]", "lib/matplotlib/tests/test_axes.py::test_displaced_spine", "lib/matplotlib/tests/test_axes.py::test_pcolornearest[png]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-y]", "lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data0-1]", "lib/matplotlib/tests/test_axes.py::test_boxplot_not_single", "lib/matplotlib/tests/test_axes.py::test_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks_log", "lib/matplotlib/tests/test_axes.py::test_log_scales", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x1-width1-label1-expected_labels1-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_tick_label_update", "lib/matplotlib/tests/test_axes.py::test_markerfacecolor_none_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[png]", "lib/matplotlib/tests/test_axes.py::test_none_kwargs", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-y]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_hist_nan_data", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg2", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]", "lib/matplotlib/tests/test_axes.py::test_hist_unequal_bins_density", "lib/matplotlib/tests/test_axes.py::test_secondary_minorloc", "lib/matplotlib/tests/test_axes.py::test_hexbin_log[png]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[ValueError-args1-kwargs1-Unrecognized string 'foo' to axis; try 'on' or 'off']", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[pdf]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_args", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs6-none]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs29]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy3-PcolorImage]", "lib/matplotlib/tests/test_cbook.py::test_grouper_private", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[jaune-conversion]", "lib/matplotlib/tests/test_axes.py::test_boxplot_capwidths", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs38]", "lib/matplotlib/tests/test_axes.py::test_pandas_minimal_plot", "lib/matplotlib/tests/test_cbook.py::test_safe_first_element_with_none", "lib/matplotlib/tests/test_axes.py::test_pcolor_regression", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case9-None]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args6-kwargs6-Must pass a single positional argument]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs22]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_numerical_hist_label", "lib/matplotlib/tests/test_axes.py::test_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs41]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_specgram_angle[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_auto_bins", "lib/matplotlib/tests/test_axes.py::test_pie_nolabel_but_legend[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[pdf]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[both titles aligned]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwhisker[png]", "lib/matplotlib/tests/test_axes.py::test_hlines_default", "lib/matplotlib/tests/test_axes.py::test_subsampled_ticklabels", "lib/matplotlib/tests/test_axes.py::test_arc_angles[png]", "lib/matplotlib/tests/test_axes.py::test_single_point[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_hist_float16", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_yinverted", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs47]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update2", "lib/matplotlib/tests/test_axes.py::test_bxp_scalarwidth[png]", "lib/matplotlib/tests/test_axes.py::test_twinx_knows_limits", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors1]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmean[png]", "lib/matplotlib/tests/test_axes.py::test_violin_point_mass", "lib/matplotlib/tests/test_axes.py::test_bar_broadcast_args", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[smaller]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy1-AxesImage]", "lib/matplotlib/tests/test_cbook.py::test_callbackregistry_signals", "lib/matplotlib/tests/test_axes.py::test_tick_apply_tickdir_deprecation", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case25-None]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[pdf]", "lib/matplotlib/tests/test_axes.py::test_strmethodformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[png]", "lib/matplotlib/tests/test_axes.py::test_marker_styles[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs1]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case24-shape]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[pdf]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs37]", "lib/matplotlib/tests/test_axes.py::test_single_date[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_capwidths", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple_old_alignment[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_fail", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[pdf]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on_rcParams_both[png]", "lib/matplotlib/tests/test_cbook.py::Test_callback_registry::test_pickling", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[date2num]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[pdf]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_empty", "lib/matplotlib/tests/test_cbook.py::test_strip_comment_invalid", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[svg]", "lib/matplotlib/tests/test_axes.py::test_hlines[png]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_2", "lib/matplotlib/tests/test_cbook.py::test_format_approx", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data2-2]", "lib/matplotlib/tests/test_axes.py::test_shared_aspect_error", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs1-None]" ]
[ "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[%d or {}-0.2-0 or {}]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt_error", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[{:.2f} m-0.2-0.20 m]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[{:.2%}-0.6666666666666666-66.67%]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[%.2f m-0.2-0.20 m]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[const-0.2-const]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[{{{:,.0f}}}-200000.0-{200,000}]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[$%g-2.54-$2.54]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[{:.2f}]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[format]", "lib/matplotlib/tests/test_cbook.py::test_auto_format_str[{} m-0.2-0.2 m]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "function", "name": "_auto_format_str" }, { "type": "field", "name": "_auto_format_str" } ] }
[ { "path": "doc/users/next_whats_new/bar_label_formatting.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/bar_label_formatting.rst", "metadata": "diff --git a/doc/users/next_whats_new/bar_label_formatting.rst b/doc/users/next_whats_new/bar_label_formatting.rst\nnew file mode 100644\nindex 000000000000..cf64436086d4\n--- /dev/null\n+++ b/doc/users/next_whats_new/bar_label_formatting.rst\n@@ -0,0 +1,31 @@\n+Additional format string options in `~matplotlib.axes.Axes.bar_label`\n+---------------------------------------------------------------------\n+\n+The ``fmt`` argument of `~matplotlib.axes.Axes.bar_label` now accepts\n+{}-style format strings:\n+\n+.. code-block:: python\n+\n+ import matplotlib.pyplot as plt\n+\n+ fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio']\n+ fruit_counts = [4000, 2000, 7000]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.bar(fruit_names, fruit_counts)\n+ ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000))\n+ ax.bar_label(bar_container, fmt='{:,.0f}')\n+\n+It also accepts callables:\n+\n+.. code-block:: python\n+\n+ animal_names = ['Lion', 'Gazelle', 'Cheetah']\n+ mph_speed = [50, 60, 75]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.bar(animal_names, mph_speed)\n+ ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80))\n+ ax.bar_label(\n+ bar_container, fmt=lambda x: '{:.1f} km/h'.format(x * 1.61)\n+ )\n" } ]
diff --git a/doc/users/next_whats_new/bar_label_formatting.rst b/doc/users/next_whats_new/bar_label_formatting.rst new file mode 100644 index 000000000000..cf64436086d4 --- /dev/null +++ b/doc/users/next_whats_new/bar_label_formatting.rst @@ -0,0 +1,31 @@ +Additional format string options in `~matplotlib.axes.Axes.bar_label` +--------------------------------------------------------------------- + +The ``fmt`` argument of `~matplotlib.axes.Axes.bar_label` now accepts +{}-style format strings: + +.. code-block:: python + + import matplotlib.pyplot as plt + + fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio'] + fruit_counts = [4000, 2000, 7000] + + fig, ax = plt.subplots() + bar_container = ax.bar(fruit_names, fruit_counts) + ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000)) + ax.bar_label(bar_container, fmt='{:,.0f}') + +It also accepts callables: + +.. code-block:: python + + animal_names = ['Lion', 'Gazelle', 'Cheetah'] + mph_speed = [50, 60, 75] + + fig, ax = plt.subplots() + bar_container = ax.bar(animal_names, mph_speed) + ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80)) + ax.bar_label( + bar_container, fmt=lambda x: '{:.1f} km/h'.format(x * 1.61) + ) If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'function', 'name': '_auto_format_str'}, {'type': 'field', 'name': '_auto_format_str'}]
matplotlib/matplotlib
matplotlib__matplotlib-20966
https://github.com/matplotlib/matplotlib/pull/20966
diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst new file mode 100644 index 000000000000..1904a92d2fba --- /dev/null +++ b/doc/users/next_whats_new/callbacks_on_norms.rst @@ -0,0 +1,8 @@ +A callback registry has been added to Normalize objects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`.colors.Normalize` objects now have a callback registry, ``callbacks``, +that can be connected to by other objects to be notified when the norm is +updated. The callback emits the key ``changed`` when the norm is modified. +`.cm.ScalarMappable` is now a listener and will register a change +when the norm's vmin, vmax or other attributes are changed. diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index 0af2f0f327d9..76c1c5d4f7f2 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -337,7 +337,7 @@ def __init__(self, norm=None, cmap=None): The colormap used to map normalized data values to RGBA colors. """ self._A = None - self.norm = None # So that the setter knows we're initializing. + self._norm = None # So that the setter knows we're initializing. self.set_norm(norm) # The Normalize instance of this ScalarMappable. self.cmap = None # So that the setter knows we're initializing. self.set_cmap(cmap) # The Colormap instance of this ScalarMappable. @@ -496,6 +496,8 @@ def set_clim(self, vmin=None, vmax=None): .. ACCEPTS: (vmin: float, vmax: float) """ + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm if vmax is None: try: vmin, vmax = vmin @@ -505,7 +507,6 @@ def set_clim(self, vmin=None, vmax=None): self.norm.vmin = colors._sanitize_extrema(vmin) if vmax is not None: self.norm.vmax = colors._sanitize_extrema(vmax) - self.changed() def get_alpha(self): """ @@ -531,6 +532,30 @@ def set_cmap(self, cmap): if not in_init: self.changed() # Things are not set up properly yet. + @property + def norm(self): + return self._norm + + @norm.setter + def norm(self, norm): + _api.check_isinstance((colors.Normalize, None), norm=norm) + if norm is None: + norm = colors.Normalize() + + if norm is self.norm: + # We aren't updating anything + return + + in_init = self.norm is None + # Remove the current callback and connect to the new one + if not in_init: + self.norm.callbacks.disconnect(self._id_norm) + self._norm = norm + self._id_norm = self.norm.callbacks.connect('changed', + self.changed) + if not in_init: + self.changed() + def set_norm(self, norm): """ Set the normalization instance. @@ -545,13 +570,7 @@ def set_norm(self, norm): the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default. """ - _api.check_isinstance((colors.Normalize, None), norm=norm) - in_init = self.norm is None - if norm is None: - norm = colors.Normalize() self.norm = norm - if not in_init: - self.changed() # Things are not set up properly yet. def autoscale(self): """ @@ -560,8 +579,9 @@ def autoscale(self): """ if self._A is None: raise TypeError('You must first set_array for mappable') + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm self.norm.autoscale(self._A) - self.changed() def autoscale_None(self): """ @@ -570,8 +590,9 @@ def autoscale_None(self): """ if self._A is None: raise TypeError('You must first set_array for mappable') + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm self.norm.autoscale_None(self._A) - self.changed() def changed(self): """ diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 459b14f6c5a7..9d40ac8e5e9c 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -471,6 +471,7 @@ def __init__(self, ax, mappable=None, *, cmap=None, self.ax.add_collection(self.dividers) self.locator = None + self.minorlocator = None self.formatter = None self.__scale = None # linear, log10 for now. Hopefully more? @@ -1096,7 +1097,7 @@ def _mesh(self): # vmax of the colorbar, not the norm. This allows the situation # where the colormap has a narrower range than the colorbar, to # accommodate extra contours: - norm = copy.copy(self.norm) + norm = copy.deepcopy(self.norm) norm.vmin = self.vmin norm.vmax = self.vmax x = np.array([0.0, 1.0]) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index c5db6117f1bc..58e3fe198498 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1123,10 +1123,50 @@ def __init__(self, vmin=None, vmax=None, clip=False): ----- Returns 0 if ``vmin == vmax``. """ - self.vmin = _sanitize_extrema(vmin) - self.vmax = _sanitize_extrema(vmax) - self.clip = clip - self._scale = None # will default to LinearScale for colorbar + self._vmin = _sanitize_extrema(vmin) + self._vmax = _sanitize_extrema(vmax) + self._clip = clip + self._scale = None + self.callbacks = cbook.CallbackRegistry() + + @property + def vmin(self): + return self._vmin + + @vmin.setter + def vmin(self, value): + value = _sanitize_extrema(value) + if value != self._vmin: + self._vmin = value + self._changed() + + @property + def vmax(self): + return self._vmax + + @vmax.setter + def vmax(self, value): + value = _sanitize_extrema(value) + if value != self._vmax: + self._vmax = value + self._changed() + + @property + def clip(self): + return self._clip + + @clip.setter + def clip(self, value): + if value != self._clip: + self._clip = value + self._changed() + + def _changed(self): + """ + Call this whenever the norm is changed to notify all the + callback listeners to the 'changed' signal. + """ + self.callbacks.process('changed') @staticmethod def process_value(value): @@ -1273,7 +1313,7 @@ def __init__(self, vcenter, vmin=None, vmax=None): """ super().__init__(vmin=vmin, vmax=vmax) - self.vcenter = vcenter + self._vcenter = vcenter if vcenter is not None and vmax is not None and vcenter >= vmax: raise ValueError('vmin, vcenter, and vmax must be in ' 'ascending order') @@ -1281,6 +1321,16 @@ def __init__(self, vcenter, vmin=None, vmax=None): raise ValueError('vmin, vcenter, and vmax must be in ' 'ascending order') + @property + def vcenter(self): + return self._vcenter + + @vcenter.setter + def vcenter(self, value): + if value != self._vcenter: + self._vcenter = value + self._changed() + def autoscale_None(self, A): """ Get vmin and vmax, and then clip at vcenter @@ -1387,7 +1437,9 @@ def vcenter(self): @vcenter.setter def vcenter(self, vcenter): - self._vcenter = vcenter + if vcenter != self._vcenter: + self._vcenter = vcenter + self._changed() if self.vmax is not None: # recompute halfrange assuming vmin and vmax represent # min and max of data diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 7dec80943993..4d124ce8c57c 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1090,6 +1090,15 @@ def _make_paths(self, segs, kinds): in zip(segs, kinds)] def changed(self): + if not hasattr(self, "cvalues"): + # Just return after calling the super() changed function + cm.ScalarMappable.changed(self) + return + # Force an autoscale immediately because self.to_rgba() calls + # autoscale_None() internally with the data passed to it, + # so if vmin/vmax are not set yet, this would override them with + # content from *cvalues* rather than levels like we want + self.norm.autoscale_None(self.levels) tcolors = [(tuple(rgba),) for rgba in self.to_rgba(self.cvalues, alpha=self.alpha)] self.tcolors = tcolors diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index ca5b7da5f808..2036bf7e17c9 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -537,11 +537,14 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0, if isinstance(self.norm, mcolors.LogNorm) and s_vmin <= 0: # Don't give 0 or negative values to LogNorm s_vmin = np.finfo(scaled_dtype).eps - with cbook._setattr_cm(self.norm, - vmin=s_vmin, - vmax=s_vmax, - ): - output = self.norm(resampled_masked) + # Block the norm from sending an update signal during the + # temporary vmin/vmax change + with self.norm.callbacks.blocked(): + with cbook._setattr_cm(self.norm, + vmin=s_vmin, + vmax=s_vmax, + ): + output = self.norm(resampled_masked) else: if A.ndim == 2: # _interpolation_stage == 'rgba' self.norm.autoscale_None(A)
diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py index ae004e957591..bf89a3a82364 100644 --- a/lib/matplotlib/tests/test_colors.py +++ b/lib/matplotlib/tests/test_colors.py @@ -1,5 +1,6 @@ import copy import itertools +import unittest.mock from io import BytesIO import numpy as np @@ -17,7 +18,7 @@ import matplotlib.cbook as cbook import matplotlib.pyplot as plt import matplotlib.scale as mscale -from matplotlib.testing.decorators import image_comparison +from matplotlib.testing.decorators import image_comparison, check_figures_equal @pytest.mark.parametrize('N, result', [ @@ -1408,3 +1409,69 @@ def test_norm_deepcopy(): norm2 = copy.deepcopy(norm) assert norm2._scale is None assert norm2.vmin == norm.vmin + + +def test_norm_callback(): + increment = unittest.mock.Mock(return_value=None) + + norm = mcolors.Normalize() + norm.callbacks.connect('changed', increment) + # Haven't updated anything, so call count should be 0 + assert increment.call_count == 0 + + # Now change vmin and vmax to test callbacks + norm.vmin = 1 + assert increment.call_count == 1 + norm.vmax = 5 + assert increment.call_count == 2 + # callback shouldn't be called if setting to the same value + norm.vmin = 1 + assert increment.call_count == 2 + norm.vmax = 5 + assert increment.call_count == 2 + + +def test_scalarmappable_norm_update(): + norm = mcolors.Normalize() + sm = matplotlib.cm.ScalarMappable(norm=norm, cmap='plasma') + # sm doesn't have a stale attribute at first, set it to False + sm.stale = False + # The mappable should be stale after updating vmin/vmax + norm.vmin = 5 + assert sm.stale + sm.stale = False + norm.vmax = 5 + assert sm.stale + sm.stale = False + norm.clip = True + assert sm.stale + # change to the CenteredNorm and TwoSlopeNorm to test those + # Also make sure that updating the norm directly and with + # set_norm both update the Norm callback + norm = mcolors.CenteredNorm() + sm.norm = norm + sm.stale = False + norm.vcenter = 1 + assert sm.stale + norm = mcolors.TwoSlopeNorm(vcenter=0, vmin=-1, vmax=1) + sm.set_norm(norm) + sm.stale = False + norm.vcenter = 1 + assert sm.stale + + +@check_figures_equal() +def test_norm_update_figs(fig_test, fig_ref): + ax_ref = fig_ref.add_subplot() + ax_test = fig_test.add_subplot() + + z = np.arange(100).reshape((10, 10)) + ax_ref.imshow(z, norm=mcolors.Normalize(10, 90)) + + # Create the norm beforehand with different limits and then update + # after adding to the plot + norm = mcolors.Normalize(0, 1) + ax_test.imshow(z, norm=norm) + # Force initial draw to make sure it isn't already stale + fig_test.canvas.draw() + norm.vmin, norm.vmax = 10, 90 diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index 37dddd4e4706..2e7fae6c58d8 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -1017,8 +1017,8 @@ def test_imshow_bool(): def test_full_invalid(): fig, ax = plt.subplots() ax.imshow(np.full((10, 10), np.nan)) - with pytest.warns(UserWarning): - fig.canvas.draw() + + fig.canvas.draw() @pytest.mark.parametrize("fmt,counted",
[ { "path": "doc/users/next_whats_new/callbacks_on_norms.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callbacks_on_norms.rst", "metadata": "diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst\nnew file mode 100644\nindex 000000000000..1904a92d2fba\n--- /dev/null\n+++ b/doc/users/next_whats_new/callbacks_on_norms.rst\n@@ -0,0 +1,8 @@\n+A callback registry has been added to Normalize objects\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+`.colors.Normalize` objects now have a callback registry, ``callbacks``,\n+that can be connected to by other objects to be notified when the norm is\n+updated. The callback emits the key ``changed`` when the norm is modified.\n+`.cm.ScalarMappable` is now a listener and will register a change\n+when the norm's vmin, vmax or other attributes are changed.\n" } ]
3.4
1dff078a4645666af374dc55812788d37bea7612
[ "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues]", "lib/matplotlib/tests/test_image.py::test_load_from_url", "lib/matplotlib/tests/test_image.py::test_composite[False-2-ps- colorimage]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminGTVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic]", "lib/matplotlib/tests/test_colors.py::test_conversions", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_alpha_array", "lib/matplotlib/tests/test_colors.py::test_LogNorm", "lib/matplotlib/tests/test_image.py::test_image_alpha[pdf]", "lib/matplotlib/tests/test_image.py::test_image_cursor_formatting", "lib/matplotlib/tests/test_colors.py::test_colormap_equals", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VcenterGTVmax", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[pdf]", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[png]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_empty_mask", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm]", "lib/matplotlib/tests/test_colors.py::test_cn", "lib/matplotlib/tests/test_image.py::test_axesimage_setdata", "lib/matplotlib/tests/test_image.py::test_image_clip[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Even", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges]", "lib/matplotlib/tests/test_colors.py::test_pandas_iterable", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2_r]", "lib/matplotlib/tests/test_image.py::test_imshow_float128", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot_r]", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[pdf]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center", "lib/matplotlib/tests/test_image.py::test_imsave[png]", "lib/matplotlib/tests/test_image.py::test_imshow[png]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[<lambda>1]", "lib/matplotlib/tests/test_colors.py::test_light_source_planar_hillshading", "lib/matplotlib/tests/test_image.py::test_rotate_image[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno_r]", "lib/matplotlib/tests/test_colors.py::test_BoundaryNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-10-nearest]", "lib/matplotlib/tests/test_image.py::test_imshow_pil[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap_r]", "lib/matplotlib/tests/test_image.py::test_imread_pil_uint16", "lib/matplotlib/tests/test_image.py::test_jpeg_2d", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm_r]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[png]", "lib/matplotlib/tests/test_image.py::test_spy_box[pdf]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[1-result2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG]", "lib/matplotlib/tests/test_image.py::test_imsave_pil_kwargs_tiff", "lib/matplotlib/tests/test_colors.py::test_FuncNorm", "lib/matplotlib/tests/test_image.py::test_figimage[png-True]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3]", "lib/matplotlib/tests/test_colors.py::test_Normalize", "lib/matplotlib/tests/test_image.py::test_imshow_bignumbers[png]", "lib/matplotlib/tests/test_image.py::test_spy_box[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c]", "lib/matplotlib/tests/test_image.py::test_imshow_pil[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow_r]", "lib/matplotlib/tests/test_image.py::test_imshow_endianess[png]", "lib/matplotlib/tests/test_image.py::test_imsave[tiff]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VmaxEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_copy", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-3-9.1-nearest]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scale", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[svg]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[2-result1]", "lib/matplotlib/tests/test_colors.py::test_light_source_hillshading", "lib/matplotlib/tests/test_image.py::test_mask_image[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype1]", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_5", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn]", "lib/matplotlib/tests/test_image.py::test_bbox_image_inverted[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG]", "lib/matplotlib/tests/test_colors.py::test_norm_deepcopy", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm", "lib/matplotlib/tests/test_image.py::test_norm_change[png]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[Normalize]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn]", "lib/matplotlib/tests/test_image.py::test_cursor_data", "lib/matplotlib/tests/test_image.py::test_unclipped", "lib/matplotlib/tests/test_image.py::test_nonuniformimage_setnorm", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmax", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain_r]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn_r]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[5-result0]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype3]", "lib/matplotlib/tests/test_image.py::test_huge_range_log[png--1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper]", "lib/matplotlib/tests/test_image.py::test_format_cursor_data[data1-[0.123]-[0.123]]", "lib/matplotlib/tests/test_image.py::test_imsave_pil_kwargs_png", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia]", "lib/matplotlib/tests/test_colors.py::test_double_register_builtin_cmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg_r]", "lib/matplotlib/tests/test_image.py::test_zoom_and_clip_upper_origin[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20_r]", "lib/matplotlib/tests/test_colors.py::test_resample", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_dict_deprecate", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth]", "lib/matplotlib/tests/test_image.py::test_exact_vmin", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn]", "lib/matplotlib/tests/test_image.py::test_image_interps[pdf]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_single_str", "lib/matplotlib/tests/test_image.py::test_full_invalid", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_TwoSlopeNorm_VminGTVmax", "lib/matplotlib/tests/test_image.py::test_imshow_zoom[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool]", "lib/matplotlib/tests/test_image.py::test_figimage[pdf-True]", "lib/matplotlib/tests/test_image.py::test_imshow_no_warn_invalid", "lib/matplotlib/tests/test_image.py::test_huge_range_log[png-1]", "lib/matplotlib/tests/test_colors.py::test_colormap_endian", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu_r]", "lib/matplotlib/tests/test_image.py::test_setdata_xya[PcolorImage-x1-y1-a1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG_r]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_single_zero", "lib/matplotlib/tests/test_image.py::test_imshow_float16", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia_r]", "lib/matplotlib/tests/test_image.py::test_image_preserve_size2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu_r]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha_validation", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu]", "lib/matplotlib/tests/test_colors.py::test_tableau_order", "lib/matplotlib/tests/test_image.py::test_spy_box[svg]", "lib/matplotlib/tests/test_colors.py::test_light_source_topo_surface[png]", "lib/matplotlib/tests/test_colors.py::test_rgb_hsv_round_trip", "lib/matplotlib/tests/test_colors.py::test_grey_gray", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer_r]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[eps]", "lib/matplotlib/tests/test_colors.py::test_colormap_bad_data_with_alpha", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds]", "lib/matplotlib/tests/test_colors.py::test_set_dict_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm_translation_invariance", "lib/matplotlib/tests/test_colors.py::test_colormap_return_types", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain]", "lib/matplotlib/tests/test_image.py::test_image_shift[pdf]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center_max", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1_r]", "lib/matplotlib/tests/test_colors.py::test_same_color", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples_r]", "lib/matplotlib/tests/test_image.py::test_alpha_interp[png]", "lib/matplotlib/tests/test_colors.py::test_autoscale_masked", "lib/matplotlib/tests/test_image.py::test_figimage[pdf-False]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu_r]", "lib/matplotlib/tests/test_image.py::test_imshow[svg]", "lib/matplotlib/tests/test_colors.py::test_CenteredNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmin", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[png]", "lib/matplotlib/tests/test_colors.py::test_repr_html", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c_r]", "lib/matplotlib/tests/test_image.py::test_image_composite_background[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv]", "lib/matplotlib/tests/test_colors.py::test_2d_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray]", "lib/matplotlib/tests/test_colors.py::test_LogNorm_inverse", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[png]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[svg]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype4]", "lib/matplotlib/tests/test_image.py::test_image_alpha[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr]", "lib/matplotlib/tests/test_image.py::test_format_cursor_data[data0-[1e+04]-[10001]]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Odd", "lib/matplotlib/tests/test_image.py::test_image_interps[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr]", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo]", "lib/matplotlib/tests/test_colors.py::test_repr_png", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[pdf]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype5]", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[pdf]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[ps]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_colorbar", "lib/matplotlib/tests/test_colors.py::test_ndarray_subclass_norm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma_r]", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[3-1]", "lib/matplotlib/tests/test_colors.py::test_colormap_invalid", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma]", "lib/matplotlib/tests/test_image.py::test_image_cliprect[svg]", "lib/matplotlib/tests/test_colors.py::test_color_names", "lib/matplotlib/tests/test_image.py::test_rasterize_dpi[svg]", "lib/matplotlib/tests/test_image.py::test_mask_image[png]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype0]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent_r]", "lib/matplotlib/tests/test_colors.py::test_register_cmap", "lib/matplotlib/tests/test_image.py::test_imshow_pil[png]", "lib/matplotlib/tests/test_image.py::test_imshow_flatfield[png]", "lib/matplotlib/tests/test_image.py::test_imread_fspath", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn]", "lib/matplotlib/tests/test_colors.py::test_failed_conversions", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2_r]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[svg]", "lib/matplotlib/tests/test_image.py::test_composite[True-1-svg-<image]", "lib/matplotlib/tests/test_image.py::test_composite[True-1-ps- colorimage]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean_r]", "lib/matplotlib/tests/test_image.py::test_bbox_image_inverted[svg]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_default", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys]", "lib/matplotlib/tests/test_image.py::test_image_clip[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[svg]", "lib/matplotlib/tests/test_image.py::test_minimized_rasterized", "lib/matplotlib/tests/test_colors.py::test_light_source_masked_shading", "lib/matplotlib/tests/test_image.py::test_https_imread_smoketest", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr]", "lib/matplotlib/tests/test_image.py::test_clip_path_disables_compositing[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired]", "lib/matplotlib/tests/test_image.py::test_image_composite_background[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism]", "lib/matplotlib/tests/test_colors.py::test_colormap_global_set_warn", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray_r]", "lib/matplotlib/tests/test_image.py::test_imsave[jpg]", "lib/matplotlib/tests/test_image.py::test_figimage[png-False]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_r]", "lib/matplotlib/tests/test_image.py::test_mask_image_all", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[png]", "lib/matplotlib/tests/test_image.py::test_get_window_extent_for_AxisImage", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn]", "lib/matplotlib/tests/test_colors.py::test_conversions_masked", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar]", "lib/matplotlib/tests/test_image.py::test_respects_bbox", "lib/matplotlib/tests/test_colors.py::test_boundarynorm_and_colorbarbase[png]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_premature_scaling", "lib/matplotlib/tests/test_image.py::test_empty_imshow[LogNorm]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b]", "lib/matplotlib/tests/test_colors.py::test_get_under_over_bad", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[bad]", "lib/matplotlib/tests/test_image.py::test_image_alpha[png]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot_r]", "lib/matplotlib/tests/test_image.py::test_image_cliprect[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis_r]", "lib/matplotlib/tests/test_image.py::test_rotate_image[pdf]", "lib/matplotlib/tests/test_image.py::test_imsave_color_alpha", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale", "lib/matplotlib/tests/test_image.py::test_relim", "lib/matplotlib/tests/test_image.py::test_rotate_image[png]", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[-1-2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2]", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[svg]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-5-nearest]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu]", "lib/matplotlib/tests/test_colors.py::test_hex_shorthand_notation", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-2-hanning]", "lib/matplotlib/tests/test_image.py::test_mask_image_over_under[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot]", "lib/matplotlib/tests/test_image.py::test_image_shift[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1_r]", "lib/matplotlib/tests/test_image.py::test_image_preserve_size", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype6]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone_r]", "lib/matplotlib/tests/test_image.py::test_jpeg_alpha", "lib/matplotlib/tests/test_image.py::test_setdata_xya[NonUniformImage-x0-y0-a0]", "lib/matplotlib/tests/test_image.py::test_imshow_bignumbers_real[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy]", "lib/matplotlib/tests/test_image.py::test_nonuniform_and_pcolor[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds_r]", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors[png]", "lib/matplotlib/tests/test_image.py::test_interp_nearest_vs_none[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_alpha_array", "lib/matplotlib/tests/test_image.py::test_imshow[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral_r]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype2]", "lib/matplotlib/tests/test_image.py::test_image_python_io", "lib/matplotlib/tests/test_image.py::test_image_interps[svg]", "lib/matplotlib/tests/test_image.py::test_quantitynd", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[pdf]", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[over]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[<lambda>0]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-3-2.9-hanning]", "lib/matplotlib/tests/test_image.py::test_rgba_antialias[png]", "lib/matplotlib/tests/test_image.py::test_image_edges", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[under]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow_r]", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_1[png]", "lib/matplotlib/tests/test_colors.py::test_unregister_builtin_cmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot_r]", "lib/matplotlib/tests/test_image.py::test_composite[False-2-svg-<image]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean]", "lib/matplotlib/tests/test_image.py::test_imsave[jpeg]", "lib/matplotlib/tests/test_image.py::test_imshow_bool", "lib/matplotlib/tests/test_image.py::test_nonuniformimage_setcmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd_r]", "lib/matplotlib/tests/test_image.py::test_figureimage_setdata" ]
[ "lib/matplotlib/tests/test_colors.py::test_norm_callback", "lib/matplotlib/tests/test_colors.py::test_scalarmappable_norm_update" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/callbacks_on_norms.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callbacks_on_norms.rst", "metadata": "diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst\nnew file mode 100644\nindex 000000000000..1904a92d2fba\n--- /dev/null\n+++ b/doc/users/next_whats_new/callbacks_on_norms.rst\n@@ -0,0 +1,8 @@\n+A callback registry has been added to Normalize objects\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+`.colors.Normalize` objects now have a callback registry, ``callbacks``,\n+that can be connected to by other objects to be notified when the norm is\n+updated. The callback emits the key ``changed`` when the norm is modified.\n+`.cm.ScalarMappable` is now a listener and will register a change\n+when the norm's vmin, vmax or other attributes are changed.\n" } ]
diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst new file mode 100644 index 000000000000..1904a92d2fba --- /dev/null +++ b/doc/users/next_whats_new/callbacks_on_norms.rst @@ -0,0 +1,8 @@ +A callback registry has been added to Normalize objects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`.colors.Normalize` objects now have a callback registry, ``callbacks``, +that can be connected to by other objects to be notified when the norm is +updated. The callback emits the key ``changed`` when the norm is modified. +`.cm.ScalarMappable` is now a listener and will register a change +when the norm's vmin, vmax or other attributes are changed.
matplotlib/matplotlib
matplotlib__matplotlib-24728
https://github.com/matplotlib/matplotlib/pull/24728
diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index 07586690347f..3457368fa51c 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -110,11 +110,12 @@ Statistics :template: autosummary.rst :nosignatures: + Axes.ecdf Axes.boxplot Axes.violinplot - Axes.violin Axes.bxp + Axes.violin Binned ------ diff --git a/doc/api/pyplot_summary.rst b/doc/api/pyplot_summary.rst index 616e9c257aa5..d0def34c4995 100644 --- a/doc/api/pyplot_summary.rst +++ b/doc/api/pyplot_summary.rst @@ -114,6 +114,7 @@ Statistics :template: autosummary.rst :nosignatures: + ecdf boxplot violinplot diff --git a/doc/users/next_whats_new/ecdf.rst b/doc/users/next_whats_new/ecdf.rst new file mode 100644 index 000000000000..01f639aa737b --- /dev/null +++ b/doc/users/next_whats_new/ecdf.rst @@ -0,0 +1,13 @@ +``Axes.ecdf`` +~~~~~~~~~~~~~ +A new Axes method, `~.Axes.ecdf`, allows plotting empirical cumulative +distribution functions without any binning. + +.. plot:: + :include-source: + + import matplotlib.pyplot as plt + import numpy as np + + fig, ax = plt.subplots() + ax.ecdf(np.random.randn(100)) diff --git a/galleries/examples/statistics/histogram_cumulative.py b/galleries/examples/statistics/histogram_cumulative.py index cbe786f2e970..9ce16568d126 100644 --- a/galleries/examples/statistics/histogram_cumulative.py +++ b/galleries/examples/statistics/histogram_cumulative.py @@ -1,36 +1,27 @@ """ -================================================== -Using histograms to plot a cumulative distribution -================================================== - -This shows how to plot a cumulative, normalized histogram as a -step function in order to visualize the empirical cumulative -distribution function (CDF) of a sample. We also show the theoretical CDF. - -A couple of other options to the ``hist`` function are demonstrated. Namely, we -use the *density* parameter to normalize the histogram and a couple of different -options to the *cumulative* parameter. The *density* parameter takes a boolean -value. When ``True``, the bin heights are scaled such that the total area of -the histogram is 1. The *cumulative* keyword argument is a little more nuanced. -Like *density*, you can pass it True or False, but you can also pass it -1 to -reverse the distribution. - -Since we're showing a normalized and cumulative histogram, these curves -are effectively the cumulative distribution functions (CDFs) of the -samples. In engineering, empirical CDFs are sometimes called -"non-exceedance" curves. In other words, you can look at the -y-value for a given-x-value to get the probability of and observation -from the sample not exceeding that x-value. For example, the value of -225 on the x-axis corresponds to about 0.85 on the y-axis, so there's an -85% chance that an observation in the sample does not exceed 225. -Conversely, setting, ``cumulative`` to -1 as is done in the -last series for this example, creates an "exceedance" curve. - -Selecting different bin counts and sizes can significantly affect the -shape of a histogram. The Astropy docs have a great section on how to -select these parameters: -http://docs.astropy.org/en/stable/visualization/histogram.html - +================================= +Plotting cumulative distributions +================================= + +This example shows how to plot the empirical cumulative distribution function +(ECDF) of a sample. We also show the theoretical CDF. + +In engineering, ECDFs are sometimes called "non-exceedance" curves: the y-value +for a given x-value gives probability that an observation from the sample is +below that x-value. For example, the value of 220 on the x-axis corresponds to +about 0.80 on the y-axis, so there is an 80% chance that an observation in the +sample does not exceed 220. Conversely, the empirical *complementary* +cumulative distribution function (the ECCDF, or "exceedance" curve) shows the +probability y that an observation from the sample is above a value x. + +A direct method to plot ECDFs is `.Axes.ecdf`. Passing ``complementary=True`` +results in an ECCDF instead. + +Alternatively, one can use ``ax.hist(data, density=True, cumulative=True)`` to +first bin the data, as if plotting a histogram, and then compute and plot the +cumulative sums of the frequencies of entries in each bin. Here, to plot the +ECCDF, pass ``cumulative=-1``. Note that this approach results in an +approximation of the E(C)CDF, whereas `.Axes.ecdf` is exact. """ import matplotlib.pyplot as plt @@ -40,33 +31,37 @@ mu = 200 sigma = 25 -n_bins = 50 -x = np.random.normal(mu, sigma, size=100) +n_bins = 25 +data = np.random.normal(mu, sigma, size=100) -fig, ax = plt.subplots(figsize=(8, 4)) +fig = plt.figure(figsize=(9, 4), layout="constrained") +axs = fig.subplots(1, 2, sharex=True, sharey=True) -# plot the cumulative histogram -n, bins, patches = ax.hist(x, n_bins, density=True, histtype='step', - cumulative=True, label='Empirical') - -# Add a line showing the expected distribution. +# Cumulative distributions. +axs[0].ecdf(data, label="CDF") +n, bins, patches = axs[0].hist(data, n_bins, density=True, histtype="step", + cumulative=True, label="Cumulative histogram") +x = np.linspace(data.min(), data.max()) y = ((1 / (np.sqrt(2 * np.pi) * sigma)) * - np.exp(-0.5 * (1 / sigma * (bins - mu))**2)) + np.exp(-0.5 * (1 / sigma * (x - mu))**2)) y = y.cumsum() y /= y[-1] - -ax.plot(bins, y, 'k--', linewidth=1.5, label='Theoretical') - -# Overlay a reversed cumulative histogram. -ax.hist(x, bins=bins, density=True, histtype='step', cumulative=-1, - label='Reversed emp.') - -# tidy up the figure -ax.grid(True) -ax.legend(loc='right') -ax.set_title('Cumulative step histograms') -ax.set_xlabel('Annual rainfall (mm)') -ax.set_ylabel('Likelihood of occurrence') +axs[0].plot(x, y, "k--", linewidth=1.5, label="Theory") + +# Complementary cumulative distributions. +axs[1].ecdf(data, complementary=True, label="CCDF") +axs[1].hist(data, bins=bins, density=True, histtype="step", cumulative=-1, + label="Reversed cumulative histogram") +axs[1].plot(x, 1 - y, "k--", linewidth=1.5, label="Theory") + +# Label the figure. +fig.suptitle("Cumulative distributions") +for ax in axs: + ax.grid(True) + ax.legend() + ax.set_xlabel("Annual rainfall (mm)") + ax.set_ylabel("Probability of occurrence") + ax.label_outer() plt.show() @@ -78,3 +73,4 @@ # in this example: # # - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` +# - `matplotlib.axes.Axes.ecdf` / `matplotlib.pyplot.ecdf` diff --git a/galleries/plot_types/stats/ecdf.py b/galleries/plot_types/stats/ecdf.py new file mode 100644 index 000000000000..bd5f9fa9e5b2 --- /dev/null +++ b/galleries/plot_types/stats/ecdf.py @@ -0,0 +1,21 @@ +""" +======= +ecdf(x) +======= + +See `~matplotlib.axes.Axes.ecdf`. +""" + +import matplotlib.pyplot as plt +import numpy as np + +plt.style.use('_mpl-gallery') + +# make data +np.random.seed(1) +x = 4 + np.random.normal(0, 1.5, 200) + +# plot: +fig, ax = plt.subplots() +ax.ecdf(x) +plt.show() diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 23c57105ca5e..99a8a9f6fc51 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7112,6 +7112,108 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None, return h, xedges, yedges, pc + @_preprocess_data(replace_names=["x", "weights"], label_namer="x") + @_docstring.dedent_interpd + def ecdf(self, x, weights=None, *, complementary=False, + orientation="vertical", compress=False, **kwargs): + """ + Compute and plot the empirical cumulative distribution function of *x*. + + .. versionadded:: 3.8 + + Parameters + ---------- + x : 1d array-like + The input data. Infinite entries are kept (and move the relevant + end of the ecdf from 0/1), but NaNs and masked values are errors. + + weights : 1d array-like or None, default: None + The weights of the entries; must have the same shape as *x*. + Weights corresponding to NaN data points are dropped, and then the + remaining weights are normalized to sum to 1. If unset, all + entries have the same weight. + + complementary : bool, default: False + Whether to plot a cumulative distribution function, which increases + from 0 to 1 (the default), or a complementary cumulative + distribution function, which decreases from 1 to 0. + + orientation : {"vertical", "horizontal"}, default: "vertical" + Whether the entries are plotted along the x-axis ("vertical", the + default) or the y-axis ("horizontal"). This parameter takes the + same values as in `~.Axes.hist`. + + compress : bool, default: False + Whether multiple entries with the same values are grouped together + (with a summed weight) before plotting. This is mainly useful if + *x* contains many identical data points, to decrease the rendering + complexity of the plot. If *x* contains no duplicate points, this + has no effect and just uses some time and memory. + + Other Parameters + ---------------- + data : indexable object, optional + DATA_PARAMETER_PLACEHOLDER + + **kwargs + Keyword arguments control the `.Line2D` properties: + + %(Line2D:kwdoc)s + + Returns + ------- + `.Line2D` + + Notes + ----- + The ecdf plot can be thought of as a cumulative histogram with one bin + per data entry; i.e. it reports on the entire dataset without any + arbitrary binning. + + If *x* contains NaNs or masked entries, either remove them first from + the array (if they should not taken into account), or replace them by + -inf or +inf (if they should be sorted at the beginning or the end of + the array). + """ + _api.check_in_list(["horizontal", "vertical"], orientation=orientation) + if "drawstyle" in kwargs or "ds" in kwargs: + raise TypeError("Cannot pass 'drawstyle' or 'ds' to ecdf()") + if np.ma.getmask(x).any(): + raise ValueError("ecdf() does not support masked entries") + x = np.asarray(x) + if np.isnan(x).any(): + raise ValueError("ecdf() does not support NaNs") + argsort = np.argsort(x) + x = x[argsort] + if weights is None: + # Ensure that we end at exactly 1, avoiding floating point errors. + cum_weights = (1 + np.arange(len(x))) / len(x) + else: + weights = np.take(weights, argsort) # Reorder weights like we reordered x. + cum_weights = np.cumsum(weights / np.sum(weights)) + if compress: + # Get indices of unique x values. + compress_idxs = [0, *(x[:-1] != x[1:]).nonzero()[0] + 1] + x = x[compress_idxs] + cum_weights = cum_weights[compress_idxs] + if orientation == "vertical": + if not complementary: + line, = self.plot([x[0], *x], [0, *cum_weights], + drawstyle="steps-post", **kwargs) + else: + line, = self.plot([*x, x[-1]], [1, *1 - cum_weights], + drawstyle="steps-pre", **kwargs) + line.sticky_edges.y[:] = [0, 1] + else: # orientation == "horizontal": + if not complementary: + line, = self.plot([0, *cum_weights], [x[0], *x], + drawstyle="steps-pre", **kwargs) + else: + line, = self.plot([1, *1 - cum_weights], [*x, x[-1]], + drawstyle="steps-post", **kwargs) + line.sticky_edges.x[:] = [0, 1] + return line + @_preprocess_data(replace_names=["x"]) @_docstring.dedent_interpd def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 60e0a91a5860..f1e2918080c9 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2515,6 +2515,17 @@ def csd( **({"data": data} if data is not None else {}), **kwargs) +# Autogenerated by boilerplate.py. Do not edit as changes will be lost. +@_copy_docstring_and_deprecators(Axes.ecdf) +def ecdf( + x, weights=None, *, complementary=False, + orientation='vertical', compress=False, data=None, **kwargs): + return gca().ecdf( + x, weights=weights, complementary=complementary, + orientation=orientation, compress=compress, + **({"data": data} if data is not None else {}), **kwargs) + + # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_copy_docstring_and_deprecators(Axes.errorbar) def errorbar( diff --git a/tools/boilerplate.py b/tools/boilerplate.py index 0b00d7a12b4a..ee61459b3cd3 100644 --- a/tools/boilerplate.py +++ b/tools/boilerplate.py @@ -246,6 +246,7 @@ def boilerplate_gen(): 'contour', 'contourf', 'csd', + 'ecdf', 'errorbar', 'eventplot', 'fill',
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index bd26419dee4d..b68ebcf57ba7 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -8448,3 +8448,36 @@ def test_rc_axes_label_formatting(): assert ax.xaxis.label.get_color() == 'red' assert ax.xaxis.label.get_fontsize() == 20 assert ax.xaxis.label.get_fontweight() == 'bold' + + +@check_figures_equal(extensions=["png"]) +def test_ecdf(fig_test, fig_ref): + data = np.array([0, -np.inf, -np.inf, np.inf, 1, 1, 2]) + weights = range(len(data)) + axs_test = fig_test.subplots(1, 2) + for ax, orientation in zip(axs_test, ["vertical", "horizontal"]): + l0 = ax.ecdf(data, orientation=orientation) + l1 = ax.ecdf("d", "w", data={"d": np.ma.array(data), "w": weights}, + orientation=orientation, + complementary=True, compress=True, ls=":") + assert len(l0.get_xdata()) == (~np.isnan(data)).sum() + 1 + assert len(l1.get_xdata()) == len({*data[~np.isnan(data)]}) + 1 + axs_ref = fig_ref.subplots(1, 2) + axs_ref[0].plot([-np.inf, -np.inf, -np.inf, 0, 1, 1, 2, np.inf], + np.arange(8) / 7, ds="steps-post") + axs_ref[0].plot([-np.inf, 0, 1, 2, np.inf, np.inf], + np.array([21, 20, 18, 14, 3, 0]) / 21, + ds="steps-pre", ls=":") + axs_ref[1].plot(np.arange(8) / 7, + [-np.inf, -np.inf, -np.inf, 0, 1, 1, 2, np.inf], + ds="steps-pre") + axs_ref[1].plot(np.array([21, 20, 18, 14, 3, 0]) / 21, + [-np.inf, 0, 1, 2, np.inf, np.inf], + ds="steps-post", ls=":") + + +def test_ecdf_invalid(): + with pytest.raises(ValueError): + plt.ecdf([1, np.nan]) + with pytest.raises(ValueError): + plt.ecdf(np.ma.array([1, 2], mask=[True, False]))
[ { "path": "doc/api/axes_api.rst", "old_path": "a/doc/api/axes_api.rst", "new_path": "b/doc/api/axes_api.rst", "metadata": "diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst\nindex 07586690347f..3457368fa51c 100644\n--- a/doc/api/axes_api.rst\n+++ b/doc/api/axes_api.rst\n@@ -110,11 +110,12 @@ Statistics\n :template: autosummary.rst\n :nosignatures:\n \n+ Axes.ecdf\n Axes.boxplot\n Axes.violinplot\n \n- Axes.violin\n Axes.bxp\n+ Axes.violin\n \n Binned\n ------\n" }, { "path": "doc/api/pyplot_summary.rst", "old_path": "a/doc/api/pyplot_summary.rst", "new_path": "b/doc/api/pyplot_summary.rst", "metadata": "diff --git a/doc/api/pyplot_summary.rst b/doc/api/pyplot_summary.rst\nindex 616e9c257aa5..d0def34c4995 100644\n--- a/doc/api/pyplot_summary.rst\n+++ b/doc/api/pyplot_summary.rst\n@@ -114,6 +114,7 @@ Statistics\n :template: autosummary.rst\n :nosignatures:\n \n+ ecdf\n boxplot\n violinplot\n \n" }, { "path": "doc/users/next_whats_new/ecdf.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/ecdf.rst", "metadata": "diff --git a/doc/users/next_whats_new/ecdf.rst b/doc/users/next_whats_new/ecdf.rst\nnew file mode 100644\nindex 000000000000..01f639aa737b\n--- /dev/null\n+++ b/doc/users/next_whats_new/ecdf.rst\n@@ -0,0 +1,13 @@\n+``Axes.ecdf``\n+~~~~~~~~~~~~~\n+A new Axes method, `~.Axes.ecdf`, allows plotting empirical cumulative\n+distribution functions without any binning.\n+\n+.. plot::\n+ :include-source:\n+\n+ import matplotlib.pyplot as plt\n+ import numpy as np\n+\n+ fig, ax = plt.subplots()\n+ ax.ecdf(np.random.randn(100))\n" } ]
3.7
5a34696d712dcb9c939e726e234e28a3135974ff
[ "lib/matplotlib/tests/test_axes.py::test_stem_dates", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs12]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[stepfilled-1]", "lib/matplotlib/tests/test_axes.py::test_xaxis_offsetText_color", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_signature", "lib/matplotlib/tests/test_axes.py::test_boxplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_custommedian[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_empty_eventplot", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case11-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-y]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_inverse_forward_closure", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[{:.2f}]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[png]", "lib/matplotlib/tests/test_axes.py::test_color_alias", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_edgecolor_none_alpha", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data1]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_retick", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_quantiles", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_hist", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data0]", "lib/matplotlib/tests/test_axes.py::test_bar_color_none_alpha", "lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs5]", "lib/matplotlib/tests/test_axes.py::test_bxp_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_empty", "lib/matplotlib/tests/test_axes.py::test_hist2d[svg]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-x]", "lib/matplotlib/tests/test_axes.py::test_hist_log[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[svg]", "lib/matplotlib/tests/test_axes.py::test_hlines[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_no_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[png]", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[small]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_kwargs_raise_error_without_labels", "lib/matplotlib/tests/test_axes.py::test_color_None", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[pdf]", "lib/matplotlib/tests/test_axes.py::test_stairs_datetime[png]", "lib/matplotlib/tests/test_axes.py::test_margins", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs3-expected_edgecolors3]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_customoutlier[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[svg]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-x]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes_relim", "lib/matplotlib/tests/test_axes.py::test_symlog[pdf]", "lib/matplotlib/tests/test_axes.py::test_strmethodformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hist_density[png]", "lib/matplotlib/tests/test_axes.py::test_stem_markerfmt", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs22]", "lib/matplotlib/tests/test_axes.py::test_multiplot_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[none-None]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs2-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_colorcycle", "lib/matplotlib/tests/test_axes.py::test_secondary_xy[png]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs36]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[True]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_artist_sublists", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs38]", "lib/matplotlib/tests/test_axes.py::test_eventplot[svg]", "lib/matplotlib/tests/test_axes.py::test_single_date[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_ylabels[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors1]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[ValueError-args1-kwargs1-Unrecognized string 'foo' to axis; try 'on' or 'off']", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs10]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x_and_y[png]", "lib/matplotlib/tests/test_axes.py::test_axline[svg]", "lib/matplotlib/tests/test_axes.py::test_set_get_ticklabels[png]", "lib/matplotlib/tests/test_axes.py::test_box_aspect_custom_position", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case5-None]", "lib/matplotlib/tests/test_axes.py::test_markers_fillstyle_rcparams[png]", "lib/matplotlib/tests/test_axes.py::test_rc_grid[png]", "lib/matplotlib/tests/test_axes.py::test_inset_subclass", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs6]", "lib/matplotlib/tests/test_axes.py::test_spectrum[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[pdf]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[red-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple_old_alignment[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-large]", "lib/matplotlib/tests/test_axes.py::test_eventplot[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs29]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_geometry", "lib/matplotlib/tests/test_axes.py::test_bar_leading_nan", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs43]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case25-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot_legend", "lib/matplotlib/tests/test_axes.py::test_invisible_axes_events", "lib/matplotlib/tests/test_axes.py::test_bxp_custombox[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_rangewhis[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-x]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[datetime.datetime]", "lib/matplotlib/tests/test_axes.py::test_hist_labels", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs40]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_widths", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update2", "lib/matplotlib/tests/test_axes.py::test_tick_space_size_0", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_alpha", "lib/matplotlib/tests/test_axes.py::test_specgram_magnitude[png]", "lib/matplotlib/tests/test_axes.py::test_bar_uint8", "lib/matplotlib/tests/test_axes.py::test_barb_units", "lib/matplotlib/tests/test_axes.py::test_hist_auto_bins", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[12]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_gridlines", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs48]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[both titles aligned]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data1-1]", "lib/matplotlib/tests/test_axes.py::test_stackplot[svg]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_autoscale", "lib/matplotlib/tests/test_axes.py::test_stairs_empty", "lib/matplotlib/tests/test_axes.py::test_pie_nolabel_but_legend[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_in_view", "lib/matplotlib/tests/test_axes.py::test_imshow_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_linewidths", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params2-expected_result2]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmeanasline[png]", "lib/matplotlib/tests/test_axes.py::test_offset_text_visible", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_positions", "lib/matplotlib/tests/test_axes.py::test_canonical[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_default_arrow", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs47]", "lib/matplotlib/tests/test_axes.py::test_inverted_cla", "lib/matplotlib/tests/test_axes.py::test_errorbar_with_prop_cycle[png]", "lib/matplotlib/tests/test_axes.py::test_relim_visible_only", "lib/matplotlib/tests/test_axes.py::test_numerical_hist_label", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[svg]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_pcolormesh", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs20]", "lib/matplotlib/tests/test_axes.py::test_axline[pdf]", "lib/matplotlib/tests/test_axes.py::test_length_one_hist", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[svg]", "lib/matplotlib/tests/test_axes.py::test_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs39]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_outofrange_quantiles", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case9-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_get_xticklabel", "lib/matplotlib/tests/test_axes.py::test_reset_grid", "lib/matplotlib/tests/test_axes.py::test_errorbar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs9]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data2]", "lib/matplotlib/tests/test_axes.py::test_axis_get_tick_params", "lib/matplotlib/tests/test_axes.py::test_hist_offset[png]", "lib/matplotlib/tests/test_axes.py::test_set_xy_bound", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-y]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_series_non_zero_index", "lib/matplotlib/tests/test_axes.py::test_label_shift", "lib/matplotlib/tests/test_axes.py::test_pcolor_regression", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs49]", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_box", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_kwarg", "lib/matplotlib/tests/test_axes.py::test_hist2d[pdf]", "lib/matplotlib/tests/test_axes.py::test_plot_format_kwarg_redundant", "lib/matplotlib/tests/test_axes.py::test_xticks_bad_args", "lib/matplotlib/tests/test_axes.py::test_pie_center_radius[png]", "lib/matplotlib/tests/test_axes.py::test_set_margin_updates_limits", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[pdf]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[png]", "lib/matplotlib/tests/test_axes.py::test_retain_tick_visibility[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_empty[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_single[png]", "lib/matplotlib/tests/test_axes.py::test_stairs_options[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case20-shape]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs24]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs10-g]", "lib/matplotlib/tests/test_axes.py::test_boxplot_not_single", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-small]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[large]", "lib/matplotlib/tests/test_axes.py::test_hexbin_log_clim", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_step[png]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args3-kwargs3-axis\\\\(\\\\) got an unexpected keyword argument 'foo']", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case18-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[y]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_margins", "lib/matplotlib/tests/test_axes.py::test_hist_log[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_dates", "lib/matplotlib/tests/test_axes.py::test_tick_param_label_rotation", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case15-None]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x-1-x-expected_labels0-x]", "lib/matplotlib/tests/test_axes.py::test_shared_aspect_error", "lib/matplotlib/tests/test_axes.py::test_pie_rotatelabels_true[png]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[svg]", "lib/matplotlib/tests/test_axes.py::test_o_marker_path_snap[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_timedelta", "lib/matplotlib/tests/test_axes.py::test_cla_clears_children_axes_and_fig", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_width[png]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-y]", "lib/matplotlib/tests/test_axes.py::test_single_point[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_format", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-large]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_step_geometry", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_rcparam[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[minor-False-True]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors0]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-log]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[center]", "lib/matplotlib/tests/test_axes.py::test_pcolornearestunits[png]", "lib/matplotlib/tests/test_axes.py::test_bar_color_cycle", "lib/matplotlib/tests/test_axes.py::test_marker_edges[png]", "lib/matplotlib/tests/test_axes.py::test_offset_label_color", "lib/matplotlib/tests/test_axes.py::test_empty_shared_subplots", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs23]", "lib/matplotlib/tests/test_axes.py::test_empty_errorbar_legend", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs11]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfilled", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_forward_inverse_closure", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_marker[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_pie_ccw_true[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case26-shape]", "lib/matplotlib/tests/test_axes.py::test_bxp_showcustommean[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args5-kwargs5-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_as_mpl_axes_api", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-True]", "lib/matplotlib/tests/test_axes.py::test_pie_default[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_errorbar_polar_caps[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym2[png]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tight", "lib/matplotlib/tests/test_axes.py::test_bar_pandas", "lib/matplotlib/tests/test_axes.py::test_axis_options[png]", "lib/matplotlib/tests/test_axes.py::test_hist_unequal_bins_density", "lib/matplotlib/tests/test_axes.py::test_bxp_customcap[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case28-conversion]", "lib/matplotlib/tests/test_axes.py::test_twinx_knows_limits", "lib/matplotlib/tests/test_axes.py::test_secondary_formatter", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical_yinverted", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data2-2]", "lib/matplotlib/tests/test_axes.py::test_violinplot_single_list_quantiles[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]", "lib/matplotlib/tests/test_axes.py::test_pcolornearest[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[png]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on_rcParams_both[png]", "lib/matplotlib/tests/test_axes.py::test_axis_bool_arguments[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[date2num]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_mod_artist_after_plotting[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs8-r]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[png]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_nan_data", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_2[png]", "lib/matplotlib/tests/test_axes.py::test_nan_barlabels", "lib/matplotlib/tests/test_axes.py::test_marker_as_markerstyle", "lib/matplotlib/tests/test_axes.py::test_hist_log[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_color_repr_error", "lib/matplotlib/tests/test_axes.py::test_bxp_percentilewhis[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hexbin_linear[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_simple[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_ci", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_fail", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata_inverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs32]", "lib/matplotlib/tests/test_axes.py::test_markerfacecolor_none_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-True]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[png]", "lib/matplotlib/tests/test_axes.py::test_zoom_inset", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-x]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_xticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_set_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs15]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs6-none]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs5-face]", "lib/matplotlib/tests/test_axes.py::test_bxp_patchartist[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[medium]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params0-expected_result0]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[png]", "lib/matplotlib/tests/test_axes.py::test_bar_all_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hist_bar_empty[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data1]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[svg]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_zorder", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs37]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_filled[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case23-None]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_box_aspect", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt_error", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_horiz[png]", "lib/matplotlib/tests/test_axes.py::test_centered_bar_label_nonlinear[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_spines_on_top[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-log]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompatchartist[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params1-expected_result1]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs9-r]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-y]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_error", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-True]", "lib/matplotlib/tests/test_axes.py::test_vline_limit", "lib/matplotlib/tests/test_axes.py::test_invalid_axis_limits", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_scalarwidth[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_limits_after_scroll_zoom", "lib/matplotlib/tests/test_axes.py::test_pie_frame_grid[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[pdf]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case13-None]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[%.2f]", "lib/matplotlib/tests/test_axes.py::test_rc_tick", "lib/matplotlib/tests/test_axes.py::test_boxplot[svg]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_sticky", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_yticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_bar_label_labels", "lib/matplotlib/tests/test_axes.py::test_stem[png]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs51]", "lib/matplotlib/tests/test_axes.py::test_secondary_resize", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_log_scales_no_data", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[png]", "lib/matplotlib/tests/test_axes.py::test_matshow[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_quiver_units", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_warn_ignored_scatter_kwargs", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-4-0.5]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[svg]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_y[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs19]", "lib/matplotlib/tests/test_axes.py::test_boxplot_dates_pandas", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[png]", "lib/matplotlib/tests/test_axes.py::test_psd_csd[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_pandas_series[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[np.datetime64]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[svg]", "lib/matplotlib/tests/test_axes.py::test_barh_tick_label[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d_density", "lib/matplotlib/tests/test_axes.py::test_hexbin_extent[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs16]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_0[png]", "lib/matplotlib/tests/test_axes.py::test_minor_accountedfor", "lib/matplotlib/tests/test_axes.py::test_loglog_nonpos[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas_indexed", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[png]", "lib/matplotlib/tests/test_axes.py::test_inset_projection", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[svg]", "lib/matplotlib/tests/test_axes.py::test_extent_units[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwidths[png]", "lib/matplotlib/tests/test_axes.py::test_clim", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[pdf]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs4]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::test_acorr[png]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[both-True-True]", "lib/matplotlib/tests/test_axes.py::test_displaced_spine", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[step-2]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x1-width1-label1-expected_labels1-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params4-expected_result4]", "lib/matplotlib/tests/test_axes.py::test_mismatched_ticklabels", "lib/matplotlib/tests/test_axes.py::test_dash_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_labels_length", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[10]", "lib/matplotlib/tests/test_axes.py::test_hexbin_empty[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case14-conversion]", "lib/matplotlib/tests/test_axes.py::test_use_sticky_edges", "lib/matplotlib/tests/test_axes.py::test_square_plot", "lib/matplotlib/tests/test_axes.py::test_pandas_index_shape", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_2", "lib/matplotlib/tests/test_axes.py::test_move_offsetlabel", "lib/matplotlib/tests/test_axes.py::test_errorbar_every_invalid", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_shownotches[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nobox[png]", "lib/matplotlib/tests/test_axes.py::test_vertex_markers[png]", "lib/matplotlib/tests/test_axes.py::test_log_margins", "lib/matplotlib/tests/test_axes.py::test_imshow[pdf]", "lib/matplotlib/tests/test_axes.py::test_titlesetpos", "lib/matplotlib/tests/test_axes.py::test_stairs_update[png]", "lib/matplotlib/tests/test_axes.py::test_hist_emptydata", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[png]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-y]", "lib/matplotlib/tests/test_axes.py::test_bxp_no_flier_stats[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvline-axhline-args0]", "lib/matplotlib/tests/test_axes.py::test_axis_set_tick_params_labelsize_labelcolor", "lib/matplotlib/tests/test_axes.py::test_vlines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs25]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_empty", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs35]", "lib/matplotlib/tests/test_axes.py::test_subplot_key_hash", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs7-r]", "lib/matplotlib/tests/test_axes.py::test_log_scales_invalid", "lib/matplotlib/tests/test_axes.py::test_pcolorargs_5205", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[8]", "lib/matplotlib/tests/test_axes.py::test_xerr_yerr_not_negative", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_float16", "lib/matplotlib/tests/test_axes.py::test_manage_xticks", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_empty_line_plots", "lib/matplotlib/tests/test_axes.py::test_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_pandas_errorbar_indexing", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-fill_between]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data0]", "lib/matplotlib/tests/test_axes.py::test_pathological_hexbin", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth0]", "lib/matplotlib/tests/test_axes.py::test_stairs_fill[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case19-None]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_mismatch", "lib/matplotlib/tests/test_axes.py::test_bxp_custompositions[png]", "lib/matplotlib/tests/test_axes.py::test_color_length_mismatch", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_canonical[pdf]", "lib/matplotlib/tests/test_axes.py::test_boxplot_no_weird_whisker[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_imshow[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-small]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs1-None]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs45]", "lib/matplotlib/tests/test_axes.py::test_pandas_minimal_plot", "lib/matplotlib/tests/test_axes.py::test_stairs[png]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[pdf]", "lib/matplotlib/tests/test_axes.py::test_none_kwargs", "lib/matplotlib/tests/test_axes.py::test_specgram[png]", "lib/matplotlib/tests/test_axes.py::test_hlines_default", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case12-None]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-scatter]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_errors", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case21-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_rc_axes_label_formatting", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_3", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case17-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs34]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data2]", "lib/matplotlib/tests/test_axes.py::test_subsampled_ticklabels", "lib/matplotlib/tests/test_axes.py::test_title_pad", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata", "lib/matplotlib/tests/test_axes.py::test_cla_not_redefined_internally", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[png]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[major-True-False]", "lib/matplotlib/tests/test_axes.py::test_shared_scale", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs18]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[pdf]", "lib/matplotlib/tests/test_axes.py::test_text_labelsize", "lib/matplotlib/tests/test_axes.py::test_marker_styles[png]", "lib/matplotlib/tests/test_axes.py::test_bar_broadcast_args", "lib/matplotlib/tests/test_axes.py::test_set_ticks_inverted", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_roundtrip", "lib/matplotlib/tests/test_axes.py::test_nodecorator", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs0-None]", "lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]", "lib/matplotlib/tests/test_axes.py::test_tick_label_update", "lib/matplotlib/tests/test_axes.py::test_sharing_does_not_link_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs50]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data0]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case8-conversion]", "lib/matplotlib/tests/test_axes.py::test_stem_args", "lib/matplotlib/tests/test_axes.py::test_axline[png]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmean[png]", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg2", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case16-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::test_rc_spines[png]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x3-width3-bars-expected_labels3-bars]", "lib/matplotlib/tests/test_axes.py::test_hist_log_barstacked", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_y_input]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case24-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_specgram_fs_none", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[left title moved]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nan[png]", "lib/matplotlib/tests/test_axes.py::test_symlog2[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x2-width2-label2-expected_labels2-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_2D[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xyinverted", "lib/matplotlib/tests/test_axes.py::test_automatic_legend", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-x]", "lib/matplotlib/tests/test_axes.py::test_pyplot_axes", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_yinverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs8]", "lib/matplotlib/tests/test_axes.py::test_tickdirs", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-3-1]", "lib/matplotlib/tests/test_axes.py::test_bar_ticklabel_fail", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs28]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_xlabelside", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-False]", "lib/matplotlib/tests/test_axes.py::test_sticky_shared_axes[png]", "lib/matplotlib/tests/test_axes.py::test_hist_range_and_density", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_nan", "lib/matplotlib/tests/test_axes.py::test_specgram_angle[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[svg]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[bar-1]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-x]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs33]", "lib/matplotlib/tests/test_axes.py::test_large_offset", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top_both", "lib/matplotlib/tests/test_axes.py::test_hist_log_2[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorflaterror", "lib/matplotlib/tests/test_axes.py::test_hexbin_log[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_problem_kwargs[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top", "lib/matplotlib/tests/test_axes.py::test_nan_bar_values", "lib/matplotlib/tests/test_axes.py::test_errorbar_dashes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs41]", "lib/matplotlib/tests/test_axes.py::test_bbox_aspect_axes_init", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[pdf]", "lib/matplotlib/tests/test_axes.py::test_grid", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfillable", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[pdf]", "lib/matplotlib/tests/test_axes.py::test_samesizepcolorflaterror", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_edgecolor_RGB", "lib/matplotlib/tests/test_axes.py::test_spy[png]", "lib/matplotlib/tests/test_axes.py::test_rc_major_minor_tick", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_single_point[pdf]", "lib/matplotlib/tests/test_axes.py::test_arc_angles[png]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data0-1]", "lib/matplotlib/tests/test_axes.py::test_shaped_data[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[format]", "lib/matplotlib/tests/test_axes.py::test_funcformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hexbin_pickable", "lib/matplotlib/tests/test_axes.py::test_patch_bounds", "lib/matplotlib/tests/test_axes.py::test_scatter_empty_data", "lib/matplotlib/tests/test_axes.py::test_zero_linewidth", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs7]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs14]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y2_input]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs4-r]", "lib/matplotlib/tests/test_axes.py::test_adjust_numtick_aspect", "lib/matplotlib/tests/test_axes.py::test_inset", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data0]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args2-kwargs2-the first argument to axis*]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-symlog]", "lib/matplotlib/tests/test_axes.py::test_unicode_hist_label", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[pdf]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-x]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x1_input]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args4-kwargs4-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_fillbetween_cycle", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_1", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case22-shape]", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym[png]", "lib/matplotlib/tests/test_axes.py::test_structured_data", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs13]", "lib/matplotlib/tests/test_axes.py::test_pcolor_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs44]", "lib/matplotlib/tests/test_axes.py::test_pandas_bar_align_center", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-plot]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xinverted", "lib/matplotlib/tests/test_axes.py::test_axline_args", "lib/matplotlib/tests/test_axes.py::test_spines_properbbox_after_zoom", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_center", "lib/matplotlib/tests/test_axes.py::test_secondary_minorloc", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[x]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args0-kwargs0-axis\\\\(\\\\) takes from 0 to 1 positional arguments but 2 were given]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[larger]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs21]", "lib/matplotlib/tests/test_axes.py::test_normal_axes", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[None-None]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[png]", "lib/matplotlib/tests/test_axes.py::test_fill_units[png]", "lib/matplotlib/tests/test_axes.py::test_small_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case10-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs17]", "lib/matplotlib/tests/test_axes.py::test_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_timedelta", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_line_specific_kwargs", "lib/matplotlib/tests/test_axes.py::test_axisbelow[png]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[svg]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[smaller]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_x_input]", "lib/matplotlib/tests/test_axes.py::test_boxplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs27]", "lib/matplotlib/tests/test_axes.py::test_axis_method_errors", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_capwidths", "lib/matplotlib/tests/test_axes.py::test_canonical[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data1]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[png]", "lib/matplotlib/tests/test_axes.py::test_2dcolor_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_shape", "lib/matplotlib/tests/test_axes.py::test_twin_spines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_violin_point_mass", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-y]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-False]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidth[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_widths", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs31]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_errorbars", "lib/matplotlib/tests/test_axes.py::test_inset_polar[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_medians", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_datalim", "lib/matplotlib/tests/test_axes.py::test_boxplot_marker_behavior", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_color_c[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvspan-axhspan-args1]", "lib/matplotlib/tests/test_axes.py::test_markevery[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs26]", "lib/matplotlib/tests/test_axes.py::test_bezier_autoscale", "lib/matplotlib/tests/test_axes.py::test_pie_textprops", "lib/matplotlib/tests/test_axes.py::test_zorder_and_explicit_rasterization", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[left]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[pdf]", "lib/matplotlib/tests/test_axes.py::test_psd_csd_edge_cases", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_annotate_across_transforms[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x2_input]", "lib/matplotlib/tests/test_axes.py::test_log_scales", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-y]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data2]", "lib/matplotlib/tests/test_axes.py::test_empty_ticks_fixed_loc", "lib/matplotlib/tests/test_axes.py::test_bad_plot_args", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs42]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs46]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[svg]", "lib/matplotlib/tests/test_axes.py::test_gettightbbox_ignore_nan", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[svg]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_plot_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_repr", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_xlabels[png]", "lib/matplotlib/tests/test_axes.py::test_twin_remove[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params3-expected_result3]", "lib/matplotlib/tests/test_axes.py::test_tick_padding_tightbbox", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[svg]", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_hist_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_log_shared", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth1]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[pdf]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[pdf]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_with_labels[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-symlog]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case7-conversion]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[center title kept]", "lib/matplotlib/tests/test_axes.py::test_pie_get_negative_values", "lib/matplotlib/tests/test_axes.py::test_aitoff_proj[png]", "lib/matplotlib/tests/test_axes.py::test_polar_interpolation_steps_variable_r[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_height[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args6-kwargs6-Must pass a single positional argument]", "lib/matplotlib/tests/test_axes.py::test_inverted_limits", "lib/matplotlib/tests/test_axes.py::test_boxplot_capwidths", "lib/matplotlib/tests/test_axes.py::test_auto_numticks_log", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_ylabelside", "lib/matplotlib/tests/test_axes.py::test_hist_barstacked_bottom_unchanged", "lib/matplotlib/tests/test_axes.py::test_eventplot_defaults[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nocaps[png]", "lib/matplotlib/tests/test_axes.py::test_set_aspect_negative", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[jaune-conversion]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nonefmt", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_with_CIarray[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_autorange_whiskers[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[svg]", "lib/matplotlib/tests/test_axes.py::test_redraw_in_frame", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[pdf]", "lib/matplotlib/tests/test_axes.py::test_shared_bool", "lib/matplotlib/tests/test_axes.py::test_title_no_move_off_page", "lib/matplotlib/tests/test_axes.py::test_titletwiny", "lib/matplotlib/tests/test_axes.py::test_stairs_edge_handling[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs30]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-y]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[png]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_small[eps]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-x]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case27-conversion]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y1_input]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwhisker[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_subclass_clear_cla", "lib/matplotlib/tests/test_axes.py::test_normalize_kwarg_pie", "lib/matplotlib/tests/test_axes.py::test_vlines_default", "lib/matplotlib/tests/test_axes.py::test_stairs_baseline_0[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case29-conversion]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[right]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case1-conversion]", "lib/matplotlib/tests/test_axes.py::test_yaxis_offsetText_color" ]
[ "lib/matplotlib/tests/test_axes.py::test_ecdf[png]", "lib/matplotlib/tests/test_axes.py::test_ecdf_invalid" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "field", "name": "compress" }, { "type": "field", "name": "compress" }, { "type": "field", "name": "complementary" }, { "type": "field", "name": "complementary" }, { "type": "file", "name": "galleries/plot_types/stats/ecdf.py" }, { "type": "field", "name": "complementary" } ] }
[ { "path": "doc/api/axes_api.rst", "old_path": "a/doc/api/axes_api.rst", "new_path": "b/doc/api/axes_api.rst", "metadata": "diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst\nindex 07586690347f..3457368fa51c 100644\n--- a/doc/api/axes_api.rst\n+++ b/doc/api/axes_api.rst\n@@ -110,11 +110,12 @@ Statistics\n :template: autosummary.rst\n :nosignatures:\n \n+ Axes.ecdf\n Axes.boxplot\n Axes.violinplot\n \n- Axes.violin\n Axes.bxp\n+ Axes.violin\n \n Binned\n ------\n" }, { "path": "doc/api/pyplot_summary.rst", "old_path": "a/doc/api/pyplot_summary.rst", "new_path": "b/doc/api/pyplot_summary.rst", "metadata": "diff --git a/doc/api/pyplot_summary.rst b/doc/api/pyplot_summary.rst\nindex 616e9c257aa5..d0def34c4995 100644\n--- a/doc/api/pyplot_summary.rst\n+++ b/doc/api/pyplot_summary.rst\n@@ -114,6 +114,7 @@ Statistics\n :template: autosummary.rst\n :nosignatures:\n \n+ ecdf\n boxplot\n violinplot\n \n" }, { "path": "doc/users/next_whats_new/ecdf.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/ecdf.rst", "metadata": "diff --git a/doc/users/next_whats_new/ecdf.rst b/doc/users/next_whats_new/ecdf.rst\nnew file mode 100644\nindex 000000000000..01f639aa737b\n--- /dev/null\n+++ b/doc/users/next_whats_new/ecdf.rst\n@@ -0,0 +1,13 @@\n+``Axes.ecdf``\n+~~~~~~~~~~~~~\n+A new Axes method, `~.Axes.ecdf`, allows plotting empirical cumulative\n+distribution functions without any binning.\n+\n+.. plot::\n+ :include-source:\n+\n+ import matplotlib.pyplot as plt\n+ import numpy as np\n+\n+ fig, ax = plt.subplots()\n+ ax.ecdf(np.random.randn(100))\n" } ]
diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index 07586690347f..3457368fa51c 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -110,11 +110,12 @@ Statistics :template: autosummary.rst :nosignatures: + Axes.ecdf Axes.boxplot Axes.violinplot - Axes.violin Axes.bxp + Axes.violin Binned ------ diff --git a/doc/api/pyplot_summary.rst b/doc/api/pyplot_summary.rst index 616e9c257aa5..d0def34c4995 100644 --- a/doc/api/pyplot_summary.rst +++ b/doc/api/pyplot_summary.rst @@ -114,6 +114,7 @@ Statistics :template: autosummary.rst :nosignatures: + ecdf boxplot violinplot diff --git a/doc/users/next_whats_new/ecdf.rst b/doc/users/next_whats_new/ecdf.rst new file mode 100644 index 000000000000..01f639aa737b --- /dev/null +++ b/doc/users/next_whats_new/ecdf.rst @@ -0,0 +1,13 @@ +``Axes.ecdf`` +~~~~~~~~~~~~~ +A new Axes method, `~.Axes.ecdf`, allows plotting empirical cumulative +distribution functions without any binning. + +.. plot:: + :include-source: + + import matplotlib.pyplot as plt + import numpy as np + + fig, ax = plt.subplots() + ax.ecdf(np.random.randn(100)) If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'field', 'name': 'compress'}, {'type': 'field', 'name': 'compress'}, {'type': 'field', 'name': 'complementary'}, {'type': 'field', 'name': 'complementary'}, {'type': 'file', 'name': 'galleries/plot_types/stats/ecdf.py'}, {'type': 'field', 'name': 'complementary'}]
matplotlib/matplotlib
matplotlib__matplotlib-24937
https://github.com/matplotlib/matplotlib/pull/24937
diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst new file mode 100644 index 000000000000..f54def10e954 --- /dev/null +++ b/doc/users/next_whats_new/pie_hatch.rst @@ -0,0 +1,18 @@ +``hatch`` parameter for pie +------------------------------------------- + +`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input +a hatch or list of hatches: + +.. plot:: + :include-source: true + :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice. + + fig, (ax1, ax2) = plt.subplots(ncols=2) + x = [10, 30, 60] + + ax1.pie(x, hatch=['.', 'o', 'O']) + ax2.pie(x, hatch='.O') + + ax1.set_title("hatch=['.', 'o', 'O']") + ax2.set_title("hatch='.O'") diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index e615305793b4..a6fecd374fba 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3075,7 +3075,7 @@ def pie(self, x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), - frame=False, rotatelabels=False, *, normalize=True): + frame=False, rotatelabels=False, *, normalize=True, hatch=None): """ Plot a pie chart. @@ -3101,29 +3101,34 @@ def pie(self, x, explode=None, labels=None, colors=None, A sequence of colors through which the pie chart will cycle. If *None*, will use the colors in the currently active cycle. + hatch : str or list, default: None + Hatching pattern applied to all pie wedges or sequence of patterns + through which the chart will cycle. For a list of valid patterns, + see :doc:`/gallery/shapes_and_collections/hatch_style_reference`. + + .. versionadded:: 3.7 + autopct : None or str or callable, default: None - If not *None*, is a string or function used to label the wedges - with their numeric value. The label will be placed inside the - wedge. If it is a format string, the label will be ``fmt % pct``. - If it is a function, it will be called. + If not *None*, *autopct* is a string or function used to label the + wedges with their numeric value. The label will be placed inside + the wedge. If *autopct* is a format string, the label will be + ``fmt % pct``. If *autopct* is a function, then it will be called. pctdistance : float, default: 0.6 - The ratio between the center of each pie slice and the start of - the text generated by *autopct*. Ignored if *autopct* is *None*. + The relative distance along the radius at which the the text + generated by *autopct* is drawn. To draw the text outside the pie, + set *pctdistance* > 1. This parameter is ignored if *autopct* is + ``None``. + + labeldistance : float or None, default: 1.1 + The relative distance along the radius at which the labels are + drawn. To draw the labels inside the pie, set *labeldistance* < 1. + If set to ``None``, labels are not drawn but are still stored for + use in `.legend`. shadow : bool, default: False Draw a shadow beneath the pie. - normalize : bool, default: True - When *True*, always make a full pie by normalizing x so that - ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1`` - and raises a `ValueError` for ``sum(x) > 1``. - - labeldistance : float or None, default: 1.1 - The radial distance at which the pie labels are drawn. - If set to ``None``, label are not drawn, but are stored for use in - ``legend()`` - startangle : float, default: 0 degrees The angle by which the start of the pie is rotated, counterclockwise from the x-axis. @@ -3135,11 +3140,11 @@ def pie(self, x, explode=None, labels=None, colors=None, Specify fractions direction, clockwise or counterclockwise. wedgeprops : dict, default: None - Dict of arguments passed to the wedge objects making the pie. - For example, you can pass in ``wedgeprops = {'linewidth': 3}`` - to set the width of the wedge border lines equal to 3. - For more details, look at the doc/arguments of the wedge object. - By default, ``clip_on=False``. + Dict of arguments passed to each `.patches.Wedge` of the pie. + For example, ``wedgeprops = {'linewidth': 3}`` sets the width of + the wedge border lines equal to 3. By default, ``clip_on=False``. + When there is a conflict between these properties and other + keywords, properties passed to *wedgeprops* take precedence. textprops : dict, default: None Dict of arguments to pass to the text objects. @@ -3153,6 +3158,11 @@ def pie(self, x, explode=None, labels=None, colors=None, rotatelabels : bool, default: False Rotate each label to the angle of the corresponding slice if true. + normalize : bool, default: True + When *True*, always make a full pie by normalizing x so that + ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1`` + and raises a `ValueError` for ``sum(x) > 1``. + data : indexable object, optional DATA_PARAMETER_PLACEHOLDER @@ -3207,6 +3217,8 @@ def pie(self, x, explode=None, labels=None, colors=None, def get_next_color(): return next(color_cycle) + hatch_cycle = itertools.cycle(np.atleast_1d(hatch)) + _api.check_isinstance(Number, radius=radius, startangle=startangle) if radius <= 0: raise ValueError(f'radius must be a positive number, not {radius}') @@ -3233,6 +3245,7 @@ def get_next_color(): w = mpatches.Wedge((x, y), radius, 360. * min(theta1, theta2), 360. * max(theta1, theta2), facecolor=get_next_color(), + hatch=next(hatch_cycle), clip_on=False, label=label) w.set(**wedgeprops) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 36172522e0d0..acd187d5d1c9 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2779,7 +2779,7 @@ def pie( pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), frame=False, - rotatelabels=False, *, normalize=True, data=None): + rotatelabels=False, *, normalize=True, hatch=None, data=None): return gca().pie( x, explode=explode, labels=labels, colors=colors, autopct=autopct, pctdistance=pctdistance, shadow=shadow, @@ -2787,7 +2787,7 @@ def pie( radius=radius, counterclock=counterclock, wedgeprops=wedgeprops, textprops=textprops, center=center, frame=frame, rotatelabels=rotatelabels, normalize=normalize, - **({"data": data} if data is not None else {})) + hatch=hatch, **({"data": data} if data is not None else {})) # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index f3f6b8938eb5..642316e4c000 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -5744,6 +5744,24 @@ def test_normalize_kwarg_pie(): assert abs(t2[0][-1].theta2 - 360.) > 1e-3 +@check_figures_equal() +def test_pie_hatch_single(fig_test, fig_ref): + x = [0.3, 0.3, 0.1] + hatch = '+' + fig_test.subplots().pie(x, hatch=hatch) + wedges, _ = fig_ref.subplots().pie(x) + [w.set_hatch(hatch) for w in wedges] + + +@check_figures_equal() +def test_pie_hatch_multi(fig_test, fig_ref): + x = [0.3, 0.3, 0.1] + hatch = ['/', '+', '.'] + fig_test.subplots().pie(x, hatch=hatch) + wedges, _ = fig_ref.subplots().pie(x) + [w.set_hatch(hp) for w, hp in zip(wedges, hatch)] + + @image_comparison(['set_get_ticklabels.png']) def test_set_get_ticklabels(): # test issue 2246
[ { "path": "doc/users/next_whats_new/pie_hatch.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/pie_hatch.rst", "metadata": "diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst\nnew file mode 100644\nindex 000000000000..f54def10e954\n--- /dev/null\n+++ b/doc/users/next_whats_new/pie_hatch.rst\n@@ -0,0 +1,18 @@\n+``hatch`` parameter for pie\n+-------------------------------------------\n+\n+`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input\n+a hatch or list of hatches:\n+\n+.. plot::\n+ :include-source: true\n+ :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice.\n+\n+ fig, (ax1, ax2) = plt.subplots(ncols=2)\n+ x = [10, 30, 60]\n+\n+ ax1.pie(x, hatch=['.', 'o', 'O'])\n+ ax2.pie(x, hatch='.O')\n+\n+ ax1.set_title(\"hatch=['.', 'o', 'O']\")\n+ ax2.set_title(\"hatch='.O'\")\n" } ]
3.5
c19b6f5e9dc011c3b31d9996368c0fea4dcd3594
[ "lib/matplotlib/tests/test_axes.py::test_stem_dates", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs12]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[stepfilled-1]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_signature", "lib/matplotlib/tests/test_axes.py::test_boxplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_custommedian[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_empty_eventplot", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case11-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-y]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_inverse_forward_closure", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[{:.2f}]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[png]", "lib/matplotlib/tests/test_axes.py::test_color_alias", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_edgecolor_none_alpha", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data1]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_retick", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_quantiles", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_hist", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data0]", "lib/matplotlib/tests/test_axes.py::test_bar_color_none_alpha", "lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs5]", "lib/matplotlib/tests/test_axes.py::test_bxp_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_empty", "lib/matplotlib/tests/test_axes.py::test_hist2d[svg]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-x]", "lib/matplotlib/tests/test_axes.py::test_hist_log[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[svg]", "lib/matplotlib/tests/test_axes.py::test_hlines[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_no_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[png]", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[small]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_kwargs_raise_error_without_labels", "lib/matplotlib/tests/test_axes.py::test_color_None", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[pdf]", "lib/matplotlib/tests/test_axes.py::test_stairs_datetime[png]", "lib/matplotlib/tests/test_axes.py::test_margins", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs3-expected_edgecolors3]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_customoutlier[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[svg]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-x]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes_relim", "lib/matplotlib/tests/test_axes.py::test_symlog[pdf]", "lib/matplotlib/tests/test_axes.py::test_strmethodformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hist_density[png]", "lib/matplotlib/tests/test_axes.py::test_stem_markerfmt", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs22]", "lib/matplotlib/tests/test_axes.py::test_multiplot_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[none-None]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs2-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_colorcycle", "lib/matplotlib/tests/test_axes.py::test_secondary_xy[png]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs36]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[True]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_artist_sublists", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs38]", "lib/matplotlib/tests/test_axes.py::test_eventplot[svg]", "lib/matplotlib/tests/test_axes.py::test_single_date[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_ylabels[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors1]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[ValueError-args1-kwargs1-Unrecognized string 'foo' to axis; try 'on' or 'off']", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs10]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x_and_y[png]", "lib/matplotlib/tests/test_axes.py::test_axline[svg]", "lib/matplotlib/tests/test_axes.py::test_set_get_ticklabels[png]", "lib/matplotlib/tests/test_axes.py::test_box_aspect_custom_position", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case5-None]", "lib/matplotlib/tests/test_axes.py::test_markers_fillstyle_rcparams[png]", "lib/matplotlib/tests/test_axes.py::test_rc_grid[png]", "lib/matplotlib/tests/test_axes.py::test_inset_subclass", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs6]", "lib/matplotlib/tests/test_axes.py::test_spectrum[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[pdf]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[red-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple_old_alignment[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-large]", "lib/matplotlib/tests/test_axes.py::test_eventplot[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs29]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_geometry", "lib/matplotlib/tests/test_axes.py::test_bar_leading_nan", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs43]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case25-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot_legend", "lib/matplotlib/tests/test_axes.py::test_invisible_axes_events", "lib/matplotlib/tests/test_axes.py::test_bxp_custombox[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_rangewhis[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-x]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[datetime.datetime]", "lib/matplotlib/tests/test_axes.py::test_hist_labels", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs40]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_widths", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update2", "lib/matplotlib/tests/test_axes.py::test_tick_space_size_0", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_alpha", "lib/matplotlib/tests/test_axes.py::test_specgram_magnitude[png]", "lib/matplotlib/tests/test_axes.py::test_bar_uint8", "lib/matplotlib/tests/test_axes.py::test_barb_units", "lib/matplotlib/tests/test_axes.py::test_hist_auto_bins", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[12]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_gridlines", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs48]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[both titles aligned]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data1-1]", "lib/matplotlib/tests/test_axes.py::test_stackplot[svg]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_autoscale", "lib/matplotlib/tests/test_axes.py::test_stairs_empty", "lib/matplotlib/tests/test_axes.py::test_pie_nolabel_but_legend[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_in_view", "lib/matplotlib/tests/test_axes.py::test_imshow_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_linewidths", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params2-expected_result2]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmeanasline[png]", "lib/matplotlib/tests/test_axes.py::test_offset_text_visible", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_positions", "lib/matplotlib/tests/test_axes.py::test_canonical[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_default_arrow", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs47]", "lib/matplotlib/tests/test_axes.py::test_inverted_cla", "lib/matplotlib/tests/test_axes.py::test_errorbar_with_prop_cycle[png]", "lib/matplotlib/tests/test_axes.py::test_relim_visible_only", "lib/matplotlib/tests/test_axes.py::test_numerical_hist_label", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[svg]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_pcolormesh", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs20]", "lib/matplotlib/tests/test_axes.py::test_axline[pdf]", "lib/matplotlib/tests/test_axes.py::test_length_one_hist", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[svg]", "lib/matplotlib/tests/test_axes.py::test_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs39]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_outofrange_quantiles", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case9-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_get_xticklabel", "lib/matplotlib/tests/test_axes.py::test_reset_grid", "lib/matplotlib/tests/test_axes.py::test_errorbar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs9]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data2]", "lib/matplotlib/tests/test_axes.py::test_axis_get_tick_params", "lib/matplotlib/tests/test_axes.py::test_hist_offset[png]", "lib/matplotlib/tests/test_axes.py::test_set_xy_bound", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-y]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_series_non_zero_index", "lib/matplotlib/tests/test_axes.py::test_label_shift", "lib/matplotlib/tests/test_axes.py::test_pcolor_regression", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs49]", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_box", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_kwarg", "lib/matplotlib/tests/test_axes.py::test_hist2d[pdf]", "lib/matplotlib/tests/test_axes.py::test_plot_format_kwarg_redundant", "lib/matplotlib/tests/test_axes.py::test_xticks_bad_args", "lib/matplotlib/tests/test_axes.py::test_pie_center_radius[png]", "lib/matplotlib/tests/test_axes.py::test_set_margin_updates_limits", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[pdf]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[png]", "lib/matplotlib/tests/test_axes.py::test_retain_tick_visibility[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_empty[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_single[png]", "lib/matplotlib/tests/test_axes.py::test_stairs_options[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case20-shape]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs24]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs10-g]", "lib/matplotlib/tests/test_axes.py::test_boxplot_not_single", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-small]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[large]", "lib/matplotlib/tests/test_axes.py::test_hexbin_log_clim", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_step[png]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args3-kwargs3-axis\\\\(\\\\) got an unexpected keyword argument 'foo']", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case18-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[y]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_margins", "lib/matplotlib/tests/test_axes.py::test_hist_log[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_dates", "lib/matplotlib/tests/test_axes.py::test_tick_param_label_rotation", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case15-None]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x-1-x-expected_labels0-x]", "lib/matplotlib/tests/test_axes.py::test_shared_aspect_error", "lib/matplotlib/tests/test_axes.py::test_pie_rotatelabels_true[png]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[svg]", "lib/matplotlib/tests/test_axes.py::test_o_marker_path_snap[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_timedelta", "lib/matplotlib/tests/test_axes.py::test_cla_clears_children_axes_and_fig", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_width[png]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-y]", "lib/matplotlib/tests/test_axes.py::test_single_point[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_format", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-large]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_step_geometry", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_rcparam[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[minor-False-True]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors0]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-log]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[center]", "lib/matplotlib/tests/test_axes.py::test_pcolornearestunits[png]", "lib/matplotlib/tests/test_axes.py::test_bar_color_cycle", "lib/matplotlib/tests/test_axes.py::test_marker_edges[png]", "lib/matplotlib/tests/test_axes.py::test_offset_label_color", "lib/matplotlib/tests/test_axes.py::test_empty_shared_subplots", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs23]", "lib/matplotlib/tests/test_axes.py::test_empty_errorbar_legend", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs11]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfilled", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_forward_inverse_closure", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_marker[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_pie_ccw_true[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case26-shape]", "lib/matplotlib/tests/test_axes.py::test_bxp_showcustommean[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args5-kwargs5-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_as_mpl_axes_api", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-True]", "lib/matplotlib/tests/test_axes.py::test_pie_default[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_errorbar_polar_caps[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym2[png]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tight", "lib/matplotlib/tests/test_axes.py::test_bar_pandas", "lib/matplotlib/tests/test_axes.py::test_axis_options[png]", "lib/matplotlib/tests/test_axes.py::test_hist_unequal_bins_density", "lib/matplotlib/tests/test_axes.py::test_bxp_customcap[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case28-conversion]", "lib/matplotlib/tests/test_axes.py::test_twinx_knows_limits", "lib/matplotlib/tests/test_axes.py::test_secondary_formatter", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical_yinverted", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data2-2]", "lib/matplotlib/tests/test_axes.py::test_violinplot_single_list_quantiles[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]", "lib/matplotlib/tests/test_axes.py::test_pcolornearest[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[png]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on_rcParams_both[png]", "lib/matplotlib/tests/test_axes.py::test_axis_bool_arguments[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[date2num]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_mod_artist_after_plotting[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs8-r]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[png]", "lib/matplotlib/tests/test_axes.py::test_hist_nan_data", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_2[png]", "lib/matplotlib/tests/test_axes.py::test_nan_barlabels", "lib/matplotlib/tests/test_axes.py::test_marker_as_markerstyle", "lib/matplotlib/tests/test_axes.py::test_hist_log[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_color_repr_error", "lib/matplotlib/tests/test_axes.py::test_bxp_percentilewhis[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hexbin_linear[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_simple[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_ci", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_fail", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata_inverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs32]", "lib/matplotlib/tests/test_axes.py::test_markerfacecolor_none_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-True]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[png]", "lib/matplotlib/tests/test_axes.py::test_zoom_inset", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-x]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_xticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_set_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs15]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs6-none]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs5-face]", "lib/matplotlib/tests/test_axes.py::test_bxp_patchartist[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[medium]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params0-expected_result0]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[png]", "lib/matplotlib/tests/test_axes.py::test_bar_all_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hist_bar_empty[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data1]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[svg]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_zorder", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs37]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_filled[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case23-None]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_box_aspect", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt_error", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_horiz[png]", "lib/matplotlib/tests/test_axes.py::test_centered_bar_label_nonlinear[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_spines_on_top[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-log]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompatchartist[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params1-expected_result1]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs9-r]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-y]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_error", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-True]", "lib/matplotlib/tests/test_axes.py::test_vline_limit", "lib/matplotlib/tests/test_axes.py::test_invalid_axis_limits", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_scalarwidth[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_limits_after_scroll_zoom", "lib/matplotlib/tests/test_axes.py::test_pie_frame_grid[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[pdf]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case13-None]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[%.2f]", "lib/matplotlib/tests/test_axes.py::test_rc_tick", "lib/matplotlib/tests/test_axes.py::test_boxplot[svg]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_sticky", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_yticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_bar_label_labels", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs51]", "lib/matplotlib/tests/test_axes.py::test_secondary_resize", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_log_scales_no_data", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[png]", "lib/matplotlib/tests/test_axes.py::test_matshow[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_quiver_units", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_warn_ignored_scatter_kwargs", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-4-0.5]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[svg]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_y[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs19]", "lib/matplotlib/tests/test_axes.py::test_boxplot_dates_pandas", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[png]", "lib/matplotlib/tests/test_axes.py::test_psd_csd[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_pandas_series[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[np.datetime64]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[svg]", "lib/matplotlib/tests/test_axes.py::test_barh_tick_label[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d_density", "lib/matplotlib/tests/test_axes.py::test_hexbin_extent[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs16]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_0[png]", "lib/matplotlib/tests/test_axes.py::test_minor_accountedfor", "lib/matplotlib/tests/test_axes.py::test_loglog_nonpos[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas_indexed", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[png]", "lib/matplotlib/tests/test_axes.py::test_inset_projection", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[svg]", "lib/matplotlib/tests/test_axes.py::test_extent_units[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwidths[png]", "lib/matplotlib/tests/test_axes.py::test_clim", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[pdf]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs4]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::test_acorr[png]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[both-True-True]", "lib/matplotlib/tests/test_axes.py::test_displaced_spine", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[step-2]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x1-width1-label1-expected_labels1-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params4-expected_result4]", "lib/matplotlib/tests/test_axes.py::test_mismatched_ticklabels", "lib/matplotlib/tests/test_axes.py::test_dash_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_labels_length", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[10]", "lib/matplotlib/tests/test_axes.py::test_hexbin_empty[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case14-conversion]", "lib/matplotlib/tests/test_axes.py::test_use_sticky_edges", "lib/matplotlib/tests/test_axes.py::test_square_plot", "lib/matplotlib/tests/test_axes.py::test_pandas_index_shape", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_2", "lib/matplotlib/tests/test_axes.py::test_move_offsetlabel", "lib/matplotlib/tests/test_axes.py::test_errorbar_every_invalid", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_shownotches[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nobox[png]", "lib/matplotlib/tests/test_axes.py::test_vertex_markers[png]", "lib/matplotlib/tests/test_axes.py::test_log_margins", "lib/matplotlib/tests/test_axes.py::test_imshow[pdf]", "lib/matplotlib/tests/test_axes.py::test_titlesetpos", "lib/matplotlib/tests/test_axes.py::test_stairs_update[png]", "lib/matplotlib/tests/test_axes.py::test_hist_emptydata", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[png]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-y]", "lib/matplotlib/tests/test_axes.py::test_bxp_no_flier_stats[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvline-axhline-args0]", "lib/matplotlib/tests/test_axes.py::test_axis_set_tick_params_labelsize_labelcolor", "lib/matplotlib/tests/test_axes.py::test_vlines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs25]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_empty", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs35]", "lib/matplotlib/tests/test_axes.py::test_subplot_key_hash", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs7-r]", "lib/matplotlib/tests/test_axes.py::test_log_scales_invalid", "lib/matplotlib/tests/test_axes.py::test_pcolorargs_5205", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[8]", "lib/matplotlib/tests/test_axes.py::test_xerr_yerr_not_negative", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_float16", "lib/matplotlib/tests/test_axes.py::test_manage_xticks", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_empty_line_plots", "lib/matplotlib/tests/test_axes.py::test_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_pandas_errorbar_indexing", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-fill_between]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data0]", "lib/matplotlib/tests/test_axes.py::test_pathological_hexbin", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth0]", "lib/matplotlib/tests/test_axes.py::test_stairs_fill[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case19-None]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_mismatch", "lib/matplotlib/tests/test_axes.py::test_bxp_custompositions[png]", "lib/matplotlib/tests/test_axes.py::test_color_length_mismatch", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_canonical[pdf]", "lib/matplotlib/tests/test_axes.py::test_boxplot_no_weird_whisker[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_imshow[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-small]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs1-None]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs45]", "lib/matplotlib/tests/test_axes.py::test_pandas_minimal_plot", "lib/matplotlib/tests/test_axes.py::test_stairs[png]", "lib/matplotlib/tests/test_axes.py::test_none_kwargs", "lib/matplotlib/tests/test_axes.py::test_specgram[png]", "lib/matplotlib/tests/test_axes.py::test_hlines_default", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case12-None]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-scatter]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_errors", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case21-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_3", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case17-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs34]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data2]", "lib/matplotlib/tests/test_axes.py::test_subsampled_ticklabels", "lib/matplotlib/tests/test_axes.py::test_title_pad", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata", "lib/matplotlib/tests/test_axes.py::test_cla_not_redefined_internally", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[png]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[major-True-False]", "lib/matplotlib/tests/test_axes.py::test_shared_scale", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs18]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[pdf]", "lib/matplotlib/tests/test_axes.py::test_text_labelsize", "lib/matplotlib/tests/test_axes.py::test_marker_styles[png]", "lib/matplotlib/tests/test_axes.py::test_bar_broadcast_args", "lib/matplotlib/tests/test_axes.py::test_set_ticks_inverted", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_roundtrip", "lib/matplotlib/tests/test_axes.py::test_nodecorator", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs0-None]", "lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]", "lib/matplotlib/tests/test_axes.py::test_tick_label_update", "lib/matplotlib/tests/test_axes.py::test_sharing_does_not_link_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs50]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data0]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case8-conversion]", "lib/matplotlib/tests/test_axes.py::test_stem_args", "lib/matplotlib/tests/test_axes.py::test_axline[png]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmean[png]", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg2", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case16-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::test_rc_spines[png]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x3-width3-bars-expected_labels3-bars]", "lib/matplotlib/tests/test_axes.py::test_hist_log_barstacked", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_y_input]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case24-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_specgram_fs_none", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[left title moved]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nan[png]", "lib/matplotlib/tests/test_axes.py::test_symlog2[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x2-width2-label2-expected_labels2-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_2D[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xyinverted", "lib/matplotlib/tests/test_axes.py::test_automatic_legend", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-x]", "lib/matplotlib/tests/test_axes.py::test_pyplot_axes", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_yinverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs8]", "lib/matplotlib/tests/test_axes.py::test_tickdirs", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-3-1]", "lib/matplotlib/tests/test_axes.py::test_bar_ticklabel_fail", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs28]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_xlabelside", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-False]", "lib/matplotlib/tests/test_axes.py::test_sticky_shared_axes[png]", "lib/matplotlib/tests/test_axes.py::test_hist_range_and_density", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_nan", "lib/matplotlib/tests/test_axes.py::test_specgram_angle[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[svg]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[bar-1]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-x]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs33]", "lib/matplotlib/tests/test_axes.py::test_large_offset", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top_both", "lib/matplotlib/tests/test_axes.py::test_hist_log_2[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorflaterror", "lib/matplotlib/tests/test_axes.py::test_hexbin_log[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_problem_kwargs[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top", "lib/matplotlib/tests/test_axes.py::test_nan_bar_values", "lib/matplotlib/tests/test_axes.py::test_errorbar_dashes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs41]", "lib/matplotlib/tests/test_axes.py::test_bbox_aspect_axes_init", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[pdf]", "lib/matplotlib/tests/test_axes.py::test_grid", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfillable", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_edgecolor_RGB", "lib/matplotlib/tests/test_axes.py::test_spy[png]", "lib/matplotlib/tests/test_axes.py::test_rc_major_minor_tick", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_single_point[pdf]", "lib/matplotlib/tests/test_axes.py::test_arc_angles[png]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data0-1]", "lib/matplotlib/tests/test_axes.py::test_shaped_data[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[format]", "lib/matplotlib/tests/test_axes.py::test_funcformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hexbin_pickable", "lib/matplotlib/tests/test_axes.py::test_patch_bounds", "lib/matplotlib/tests/test_axes.py::test_scatter_empty_data", "lib/matplotlib/tests/test_axes.py::test_zero_linewidth", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs7]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs14]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y2_input]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs4-r]", "lib/matplotlib/tests/test_axes.py::test_adjust_numtick_aspect", "lib/matplotlib/tests/test_axes.py::test_inset", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data0]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args2-kwargs2-the first argument to axis*]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-symlog]", "lib/matplotlib/tests/test_axes.py::test_unicode_hist_label", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[pdf]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-x]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x1_input]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args4-kwargs4-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_fillbetween_cycle", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_1", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case22-shape]", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym[png]", "lib/matplotlib/tests/test_axes.py::test_structured_data", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d[png]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs13]", "lib/matplotlib/tests/test_axes.py::test_pcolor_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs44]", "lib/matplotlib/tests/test_axes.py::test_pandas_bar_align_center", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-plot]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xinverted", "lib/matplotlib/tests/test_axes.py::test_axline_args", "lib/matplotlib/tests/test_axes.py::test_spines_properbbox_after_zoom", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_center", "lib/matplotlib/tests/test_axes.py::test_secondary_minorloc", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[x]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args0-kwargs0-axis\\\\(\\\\) takes from 0 to 1 positional arguments but 2 were given]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[larger]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs21]", "lib/matplotlib/tests/test_axes.py::test_normal_axes", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[None-None]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[png]", "lib/matplotlib/tests/test_axes.py::test_fill_units[png]", "lib/matplotlib/tests/test_axes.py::test_small_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case10-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs17]", "lib/matplotlib/tests/test_axes.py::test_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_timedelta", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_line_specific_kwargs", "lib/matplotlib/tests/test_axes.py::test_axisbelow[png]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[svg]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[smaller]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_x_input]", "lib/matplotlib/tests/test_axes.py::test_boxplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs27]", "lib/matplotlib/tests/test_axes.py::test_axis_method_errors", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_capwidths", "lib/matplotlib/tests/test_axes.py::test_canonical[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data1]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[png]", "lib/matplotlib/tests/test_axes.py::test_2dcolor_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_shape", "lib/matplotlib/tests/test_axes.py::test_twin_spines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_violin_point_mass", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-y]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-False]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidth[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_widths", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs31]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_errorbars", "lib/matplotlib/tests/test_axes.py::test_inset_polar[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_medians", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_datalim", "lib/matplotlib/tests/test_axes.py::test_boxplot_marker_behavior", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_color_c[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvspan-axhspan-args1]", "lib/matplotlib/tests/test_axes.py::test_markevery[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs26]", "lib/matplotlib/tests/test_axes.py::test_bezier_autoscale", "lib/matplotlib/tests/test_axes.py::test_pie_textprops", "lib/matplotlib/tests/test_axes.py::test_zorder_and_explicit_rasterization", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[left]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[pdf]", "lib/matplotlib/tests/test_axes.py::test_psd_csd_edge_cases", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_annotate_across_transforms[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x2_input]", "lib/matplotlib/tests/test_axes.py::test_log_scales", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-y]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data2]", "lib/matplotlib/tests/test_axes.py::test_empty_ticks_fixed_loc", "lib/matplotlib/tests/test_axes.py::test_bad_plot_args", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs42]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs46]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[svg]", "lib/matplotlib/tests/test_axes.py::test_gettightbbox_ignore_nan", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_plot_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_repr", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_xlabels[png]", "lib/matplotlib/tests/test_axes.py::test_twin_remove[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params3-expected_result3]", "lib/matplotlib/tests/test_axes.py::test_tick_padding_tightbbox", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[svg]", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_hist_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_log_shared", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[pdf]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[pdf]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_with_labels[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-symlog]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case7-conversion]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[center title kept]", "lib/matplotlib/tests/test_axes.py::test_pie_get_negative_values", "lib/matplotlib/tests/test_axes.py::test_aitoff_proj[png]", "lib/matplotlib/tests/test_axes.py::test_polar_interpolation_steps_variable_r[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_height[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args6-kwargs6-Must pass a single positional argument]", "lib/matplotlib/tests/test_axes.py::test_inverted_limits", "lib/matplotlib/tests/test_axes.py::test_boxplot_capwidths", "lib/matplotlib/tests/test_axes.py::test_auto_numticks_log", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_ylabelside", "lib/matplotlib/tests/test_axes.py::test_hist_barstacked_bottom_unchanged", "lib/matplotlib/tests/test_axes.py::test_eventplot_defaults[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nocaps[png]", "lib/matplotlib/tests/test_axes.py::test_set_aspect_negative", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[jaune-conversion]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nonefmt", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_with_CIarray[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_autorange_whiskers[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[svg]", "lib/matplotlib/tests/test_axes.py::test_redraw_in_frame", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[pdf]", "lib/matplotlib/tests/test_axes.py::test_shared_bool", "lib/matplotlib/tests/test_axes.py::test_title_no_move_off_page", "lib/matplotlib/tests/test_axes.py::test_titletwiny", "lib/matplotlib/tests/test_axes.py::test_stairs_edge_handling[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs30]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-y]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[png]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_small[eps]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-x]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case27-conversion]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y1_input]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwhisker[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_subclass_clear_cla", "lib/matplotlib/tests/test_axes.py::test_normalize_kwarg_pie", "lib/matplotlib/tests/test_axes.py::test_vlines_default", "lib/matplotlib/tests/test_axes.py::test_stairs_baseline_0[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case29-conversion]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[right]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case1-conversion]" ]
[ "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[pdf]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[pdf]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[svg]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[png]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[svg]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[png]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/pie_hatch.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/pie_hatch.rst", "metadata": "diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst\nnew file mode 100644\nindex 000000000000..f54def10e954\n--- /dev/null\n+++ b/doc/users/next_whats_new/pie_hatch.rst\n@@ -0,0 +1,18 @@\n+``hatch`` parameter for pie\n+-------------------------------------------\n+\n+`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input\n+a hatch or list of hatches:\n+\n+.. plot::\n+ :include-source: true\n+ :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice.\n+\n+ fig, (ax1, ax2) = plt.subplots(ncols=2)\n+ x = [10, 30, 60]\n+\n+ ax1.pie(x, hatch=['.', 'o', 'O'])\n+ ax2.pie(x, hatch='.O')\n+\n+ ax1.set_title(\"hatch=['.', 'o', 'O']\")\n+ ax2.set_title(\"hatch='.O'\")\n" } ]
diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst new file mode 100644 index 000000000000..f54def10e954 --- /dev/null +++ b/doc/users/next_whats_new/pie_hatch.rst @@ -0,0 +1,18 @@ +``hatch`` parameter for pie +------------------------------------------- + +`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input +a hatch or list of hatches: + +.. plot:: + :include-source: true + :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice. + + fig, (ax1, ax2) = plt.subplots(ncols=2) + x = [10, 30, 60] + + ax1.pie(x, hatch=['.', 'o', 'O']) + ax2.pie(x, hatch='.O') + + ax1.set_title("hatch=['.', 'o', 'O']") + ax2.set_title("hatch='.O'")
matplotlib/matplotlib
matplotlib__matplotlib-24470
https://github.com/matplotlib/matplotlib/pull/24470
diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst new file mode 100644 index 000000000000..f54def10e954 --- /dev/null +++ b/doc/users/next_whats_new/pie_hatch.rst @@ -0,0 +1,18 @@ +``hatch`` parameter for pie +------------------------------------------- + +`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input +a hatch or list of hatches: + +.. plot:: + :include-source: true + :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice. + + fig, (ax1, ax2) = plt.subplots(ncols=2) + x = [10, 30, 60] + + ax1.pie(x, hatch=['.', 'o', 'O']) + ax2.pie(x, hatch='.O') + + ax1.set_title("hatch=['.', 'o', 'O']") + ax2.set_title("hatch='.O'") diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 58d95912665b..c46c1b467fc1 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3083,7 +3083,7 @@ def pie(self, x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), - frame=False, rotatelabels=False, *, normalize=True): + frame=False, rotatelabels=False, *, normalize=True, hatch=None): """ Plot a pie chart. @@ -3109,29 +3109,34 @@ def pie(self, x, explode=None, labels=None, colors=None, A sequence of colors through which the pie chart will cycle. If *None*, will use the colors in the currently active cycle. + hatch : str or list, default: None + Hatching pattern applied to all pie wedges or sequence of patterns + through which the chart will cycle. For a list of valid patterns, + see :doc:`/gallery/shapes_and_collections/hatch_style_reference`. + + .. versionadded:: 3.7 + autopct : None or str or callable, default: None - If not *None*, is a string or function used to label the wedges - with their numeric value. The label will be placed inside the - wedge. If it is a format string, the label will be ``fmt % pct``. - If it is a function, it will be called. + If not *None*, *autopct* is a string or function used to label the + wedges with their numeric value. The label will be placed inside + the wedge. If *autopct* is a format string, the label will be + ``fmt % pct``. If *autopct* is a function, then it will be called. pctdistance : float, default: 0.6 - The ratio between the center of each pie slice and the start of - the text generated by *autopct*. Ignored if *autopct* is *None*. + The relative distance along the radius at which the the text + generated by *autopct* is drawn. To draw the text outside the pie, + set *pctdistance* > 1. This parameter is ignored if *autopct* is + ``None``. + + labeldistance : float or None, default: 1.1 + The relative distance along the radius at which the labels are + drawn. To draw the labels inside the pie, set *labeldistance* < 1. + If set to ``None``, labels are not drawn but are still stored for + use in `.legend`. shadow : bool, default: False Draw a shadow beneath the pie. - normalize : bool, default: True - When *True*, always make a full pie by normalizing x so that - ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1`` - and raises a `ValueError` for ``sum(x) > 1``. - - labeldistance : float or None, default: 1.1 - The radial distance at which the pie labels are drawn. - If set to ``None``, label are not drawn, but are stored for use in - ``legend()`` - startangle : float, default: 0 degrees The angle by which the start of the pie is rotated, counterclockwise from the x-axis. @@ -3143,11 +3148,11 @@ def pie(self, x, explode=None, labels=None, colors=None, Specify fractions direction, clockwise or counterclockwise. wedgeprops : dict, default: None - Dict of arguments passed to the wedge objects making the pie. - For example, you can pass in ``wedgeprops = {'linewidth': 3}`` - to set the width of the wedge border lines equal to 3. - For more details, look at the doc/arguments of the wedge object. - By default, ``clip_on=False``. + Dict of arguments passed to each `.patches.Wedge` of the pie. + For example, ``wedgeprops = {'linewidth': 3}`` sets the width of + the wedge border lines equal to 3. By default, ``clip_on=False``. + When there is a conflict between these properties and other + keywords, properties passed to *wedgeprops* take precedence. textprops : dict, default: None Dict of arguments to pass to the text objects. @@ -3161,6 +3166,11 @@ def pie(self, x, explode=None, labels=None, colors=None, rotatelabels : bool, default: False Rotate each label to the angle of the corresponding slice if true. + normalize : bool, default: True + When *True*, always make a full pie by normalizing x so that + ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1`` + and raises a `ValueError` for ``sum(x) > 1``. + data : indexable object, optional DATA_PARAMETER_PLACEHOLDER @@ -3215,6 +3225,8 @@ def pie(self, x, explode=None, labels=None, colors=None, def get_next_color(): return next(color_cycle) + hatch_cycle = itertools.cycle(np.atleast_1d(hatch)) + _api.check_isinstance(Number, radius=radius, startangle=startangle) if radius <= 0: raise ValueError(f'radius must be a positive number, not {radius}') @@ -3241,6 +3253,7 @@ def get_next_color(): w = mpatches.Wedge((x, y), radius, 360. * min(theta1, theta2), 360. * max(theta1, theta2), facecolor=get_next_color(), + hatch=next(hatch_cycle), clip_on=False, label=label) w.set(**wedgeprops) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 4e9734e184dc..e62d4f0b7481 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2784,7 +2784,7 @@ def pie( pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), frame=False, - rotatelabels=False, *, normalize=True, data=None): + rotatelabels=False, *, normalize=True, hatch=None, data=None): return gca().pie( x, explode=explode, labels=labels, colors=colors, autopct=autopct, pctdistance=pctdistance, shadow=shadow, @@ -2792,7 +2792,7 @@ def pie( radius=radius, counterclock=counterclock, wedgeprops=wedgeprops, textprops=textprops, center=center, frame=frame, rotatelabels=rotatelabels, normalize=normalize, - **({"data": data} if data is not None else {})) + hatch=hatch, **({"data": data} if data is not None else {})) # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 3b471d4e0d92..7acd1040c5d6 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -5744,6 +5744,24 @@ def test_normalize_kwarg_pie(): assert abs(t2[0][-1].theta2 - 360.) > 1e-3 +@check_figures_equal() +def test_pie_hatch_single(fig_test, fig_ref): + x = [0.3, 0.3, 0.1] + hatch = '+' + fig_test.subplots().pie(x, hatch=hatch) + wedges, _ = fig_ref.subplots().pie(x) + [w.set_hatch(hatch) for w in wedges] + + +@check_figures_equal() +def test_pie_hatch_multi(fig_test, fig_ref): + x = [0.3, 0.3, 0.1] + hatch = ['/', '+', '.'] + fig_test.subplots().pie(x, hatch=hatch) + wedges, _ = fig_ref.subplots().pie(x) + [w.set_hatch(hp) for w, hp in zip(wedges, hatch)] + + @image_comparison(['set_get_ticklabels.png']) def test_set_get_ticklabels(): # test issue 2246
[ { "path": "doc/users/next_whats_new/pie_hatch.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/pie_hatch.rst", "metadata": "diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst\nnew file mode 100644\nindex 000000000000..f54def10e954\n--- /dev/null\n+++ b/doc/users/next_whats_new/pie_hatch.rst\n@@ -0,0 +1,18 @@\n+``hatch`` parameter for pie\n+-------------------------------------------\n+\n+`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input\n+a hatch or list of hatches:\n+\n+.. plot::\n+ :include-source: true\n+ :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice.\n+\n+ fig, (ax1, ax2) = plt.subplots(ncols=2)\n+ x = [10, 30, 60]\n+\n+ ax1.pie(x, hatch=['.', 'o', 'O'])\n+ ax2.pie(x, hatch='.O')\n+\n+ ax1.set_title(\"hatch=['.', 'o', 'O']\")\n+ ax2.set_title(\"hatch='.O'\")\n" } ]
3.5
e0dc18d51ef29118cc13e394f76641dcb5198846
[ "lib/matplotlib/tests/test_axes.py::test_stem_dates", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs12]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[stepfilled-1]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_signature", "lib/matplotlib/tests/test_axes.py::test_boxplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_custommedian[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_empty_eventplot", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case11-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-y]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_inverse_forward_closure", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[{:.2f}]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[png]", "lib/matplotlib/tests/test_axes.py::test_color_alias", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_edgecolor_none_alpha", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data1]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_retick", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_quantiles", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_hist", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data0]", "lib/matplotlib/tests/test_axes.py::test_bar_color_none_alpha", "lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs5]", "lib/matplotlib/tests/test_axes.py::test_bxp_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_empty", "lib/matplotlib/tests/test_axes.py::test_hist2d[svg]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-x]", "lib/matplotlib/tests/test_axes.py::test_hist_log[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[svg]", "lib/matplotlib/tests/test_axes.py::test_hlines[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_no_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[png]", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[small]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_kwargs_raise_error_without_labels", "lib/matplotlib/tests/test_axes.py::test_color_None", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[pdf]", "lib/matplotlib/tests/test_axes.py::test_stairs_datetime[png]", "lib/matplotlib/tests/test_axes.py::test_margins", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs3-expected_edgecolors3]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_customoutlier[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[svg]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-x]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes_relim", "lib/matplotlib/tests/test_axes.py::test_symlog[pdf]", "lib/matplotlib/tests/test_axes.py::test_strmethodformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hist_density[png]", "lib/matplotlib/tests/test_axes.py::test_stem_markerfmt", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs22]", "lib/matplotlib/tests/test_axes.py::test_multiplot_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[none-None]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs2-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_colorcycle", "lib/matplotlib/tests/test_axes.py::test_secondary_xy[png]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs36]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[True]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_artist_sublists", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs38]", "lib/matplotlib/tests/test_axes.py::test_eventplot[svg]", "lib/matplotlib/tests/test_axes.py::test_single_date[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_ylabels[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors1]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[ValueError-args1-kwargs1-Unrecognized string 'foo' to axis; try 'on' or 'off']", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs10]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x_and_y[png]", "lib/matplotlib/tests/test_axes.py::test_axline[svg]", "lib/matplotlib/tests/test_axes.py::test_set_get_ticklabels[png]", "lib/matplotlib/tests/test_axes.py::test_box_aspect_custom_position", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case5-None]", "lib/matplotlib/tests/test_axes.py::test_markers_fillstyle_rcparams[png]", "lib/matplotlib/tests/test_axes.py::test_rc_grid[png]", "lib/matplotlib/tests/test_axes.py::test_inset_subclass", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs6]", "lib/matplotlib/tests/test_axes.py::test_spectrum[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[pdf]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[red-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple_old_alignment[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-large]", "lib/matplotlib/tests/test_axes.py::test_eventplot[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs29]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_geometry", "lib/matplotlib/tests/test_axes.py::test_bar_leading_nan", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs43]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case25-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot_legend", "lib/matplotlib/tests/test_axes.py::test_invisible_axes_events", "lib/matplotlib/tests/test_axes.py::test_bxp_custombox[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_rangewhis[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-x]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[datetime.datetime]", "lib/matplotlib/tests/test_axes.py::test_hist_labels", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs40]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_widths", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update2", "lib/matplotlib/tests/test_axes.py::test_tick_space_size_0", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_alpha", "lib/matplotlib/tests/test_axes.py::test_specgram_magnitude[png]", "lib/matplotlib/tests/test_axes.py::test_bar_uint8", "lib/matplotlib/tests/test_axes.py::test_barb_units", "lib/matplotlib/tests/test_axes.py::test_hist_auto_bins", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[12]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_gridlines", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs48]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[both titles aligned]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data1-1]", "lib/matplotlib/tests/test_axes.py::test_stackplot[svg]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_autoscale", "lib/matplotlib/tests/test_axes.py::test_stairs_empty", "lib/matplotlib/tests/test_axes.py::test_pie_nolabel_but_legend[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_in_view", "lib/matplotlib/tests/test_axes.py::test_imshow_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_linewidths", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params2-expected_result2]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmeanasline[png]", "lib/matplotlib/tests/test_axes.py::test_offset_text_visible", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_positions", "lib/matplotlib/tests/test_axes.py::test_canonical[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_default_arrow", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs47]", "lib/matplotlib/tests/test_axes.py::test_inverted_cla", "lib/matplotlib/tests/test_axes.py::test_errorbar_with_prop_cycle[png]", "lib/matplotlib/tests/test_axes.py::test_relim_visible_only", "lib/matplotlib/tests/test_axes.py::test_numerical_hist_label", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[svg]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_pcolormesh", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs20]", "lib/matplotlib/tests/test_axes.py::test_axline[pdf]", "lib/matplotlib/tests/test_axes.py::test_length_one_hist", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[svg]", "lib/matplotlib/tests/test_axes.py::test_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs39]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_outofrange_quantiles", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case9-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_get_xticklabel", "lib/matplotlib/tests/test_axes.py::test_reset_grid", "lib/matplotlib/tests/test_axes.py::test_errorbar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs9]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data2]", "lib/matplotlib/tests/test_axes.py::test_axis_get_tick_params", "lib/matplotlib/tests/test_axes.py::test_hist_offset[png]", "lib/matplotlib/tests/test_axes.py::test_set_xy_bound", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-y]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_series_non_zero_index", "lib/matplotlib/tests/test_axes.py::test_label_shift", "lib/matplotlib/tests/test_axes.py::test_pcolor_regression", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs49]", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_box", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_kwarg", "lib/matplotlib/tests/test_axes.py::test_hist2d[pdf]", "lib/matplotlib/tests/test_axes.py::test_plot_format_kwarg_redundant", "lib/matplotlib/tests/test_axes.py::test_xticks_bad_args", "lib/matplotlib/tests/test_axes.py::test_pie_center_radius[png]", "lib/matplotlib/tests/test_axes.py::test_set_margin_updates_limits", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[pdf]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[png]", "lib/matplotlib/tests/test_axes.py::test_retain_tick_visibility[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_empty[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_single[png]", "lib/matplotlib/tests/test_axes.py::test_stairs_options[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case20-shape]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs24]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs10-g]", "lib/matplotlib/tests/test_axes.py::test_boxplot_not_single", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-small]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[large]", "lib/matplotlib/tests/test_axes.py::test_hexbin_log_clim", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_step[png]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args3-kwargs3-axis\\\\(\\\\) got an unexpected keyword argument 'foo']", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case18-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[y]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_margins", "lib/matplotlib/tests/test_axes.py::test_hist_log[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_dates", "lib/matplotlib/tests/test_axes.py::test_tick_param_label_rotation", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case15-None]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x-1-x-expected_labels0-x]", "lib/matplotlib/tests/test_axes.py::test_shared_aspect_error", "lib/matplotlib/tests/test_axes.py::test_pie_rotatelabels_true[png]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[svg]", "lib/matplotlib/tests/test_axes.py::test_o_marker_path_snap[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_timedelta", "lib/matplotlib/tests/test_axes.py::test_cla_clears_children_axes_and_fig", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_width[png]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-y]", "lib/matplotlib/tests/test_axes.py::test_single_point[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_format", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-large]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_step_geometry", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_rcparam[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[minor-False-True]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors0]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-log]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[center]", "lib/matplotlib/tests/test_axes.py::test_pcolornearestunits[png]", "lib/matplotlib/tests/test_axes.py::test_bar_color_cycle", "lib/matplotlib/tests/test_axes.py::test_marker_edges[png]", "lib/matplotlib/tests/test_axes.py::test_offset_label_color", "lib/matplotlib/tests/test_axes.py::test_empty_shared_subplots", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs23]", "lib/matplotlib/tests/test_axes.py::test_empty_errorbar_legend", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs11]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfilled", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_forward_inverse_closure", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_marker[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_pie_ccw_true[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case26-shape]", "lib/matplotlib/tests/test_axes.py::test_bxp_showcustommean[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args5-kwargs5-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_as_mpl_axes_api", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-True]", "lib/matplotlib/tests/test_axes.py::test_pie_default[png]", "lib/matplotlib/tests/test_axes.py::test_mixed_errorbar_polar_caps[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym2[png]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tight", "lib/matplotlib/tests/test_axes.py::test_bar_pandas", "lib/matplotlib/tests/test_axes.py::test_axis_options[png]", "lib/matplotlib/tests/test_axes.py::test_hist_unequal_bins_density", "lib/matplotlib/tests/test_axes.py::test_bxp_customcap[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case28-conversion]", "lib/matplotlib/tests/test_axes.py::test_twinx_knows_limits", "lib/matplotlib/tests/test_axes.py::test_secondary_formatter", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical_yinverted", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data2-2]", "lib/matplotlib/tests/test_axes.py::test_violinplot_single_list_quantiles[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]", "lib/matplotlib/tests/test_axes.py::test_pcolornearest[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[png]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on_rcParams_both[png]", "lib/matplotlib/tests/test_axes.py::test_axis_bool_arguments[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[date2num]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_mod_artist_after_plotting[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs8-r]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[png]", "lib/matplotlib/tests/test_axes.py::test_hist_nan_data", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_2[png]", "lib/matplotlib/tests/test_axes.py::test_nan_barlabels", "lib/matplotlib/tests/test_axes.py::test_marker_as_markerstyle", "lib/matplotlib/tests/test_axes.py::test_hist_log[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_color_repr_error", "lib/matplotlib/tests/test_axes.py::test_bxp_percentilewhis[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hexbin_linear[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_simple[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_ci", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_fail", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata_inverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs32]", "lib/matplotlib/tests/test_axes.py::test_markerfacecolor_none_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-True]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[png]", "lib/matplotlib/tests/test_axes.py::test_zoom_inset", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-x]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_xticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_set_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs15]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs6-none]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs5-face]", "lib/matplotlib/tests/test_axes.py::test_bxp_patchartist[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[medium]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params0-expected_result0]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[png]", "lib/matplotlib/tests/test_axes.py::test_bar_all_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hist_bar_empty[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data1]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[svg]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_zorder", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs37]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_filled[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case23-None]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_box_aspect", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt_error", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_horiz[png]", "lib/matplotlib/tests/test_axes.py::test_centered_bar_label_nonlinear[svg]", "lib/matplotlib/tests/test_axes.py::test_twin_spines_on_top[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-log]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompatchartist[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params1-expected_result1]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs9-r]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-y]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_error", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-True]", "lib/matplotlib/tests/test_axes.py::test_vline_limit", "lib/matplotlib/tests/test_axes.py::test_invalid_axis_limits", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_scalarwidth[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_limits_after_scroll_zoom", "lib/matplotlib/tests/test_axes.py::test_pie_frame_grid[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[pdf]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case13-None]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[%.2f]", "lib/matplotlib/tests/test_axes.py::test_rc_tick", "lib/matplotlib/tests/test_axes.py::test_boxplot[svg]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_sticky", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_yticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_bar_label_labels", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs51]", "lib/matplotlib/tests/test_axes.py::test_secondary_resize", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_log_scales_no_data", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[png]", "lib/matplotlib/tests/test_axes.py::test_matshow[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_quiver_units", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_warn_ignored_scatter_kwargs", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-4-0.5]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[svg]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_y[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs19]", "lib/matplotlib/tests/test_axes.py::test_boxplot_dates_pandas", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[png]", "lib/matplotlib/tests/test_axes.py::test_psd_csd[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_pandas_series[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[np.datetime64]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[svg]", "lib/matplotlib/tests/test_axes.py::test_barh_tick_label[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d_density", "lib/matplotlib/tests/test_axes.py::test_hexbin_extent[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs16]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_0[png]", "lib/matplotlib/tests/test_axes.py::test_minor_accountedfor", "lib/matplotlib/tests/test_axes.py::test_loglog_nonpos[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas_indexed", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[png]", "lib/matplotlib/tests/test_axes.py::test_inset_projection", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[svg]", "lib/matplotlib/tests/test_axes.py::test_extent_units[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwidths[png]", "lib/matplotlib/tests/test_axes.py::test_clim", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[pdf]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs4]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::test_acorr[png]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[both-True-True]", "lib/matplotlib/tests/test_axes.py::test_displaced_spine", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[step-2]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x1-width1-label1-expected_labels1-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params4-expected_result4]", "lib/matplotlib/tests/test_axes.py::test_mismatched_ticklabels", "lib/matplotlib/tests/test_axes.py::test_dash_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_labels_length", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[10]", "lib/matplotlib/tests/test_axes.py::test_hexbin_empty[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case14-conversion]", "lib/matplotlib/tests/test_axes.py::test_use_sticky_edges", "lib/matplotlib/tests/test_axes.py::test_square_plot", "lib/matplotlib/tests/test_axes.py::test_pandas_index_shape", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_2", "lib/matplotlib/tests/test_axes.py::test_move_offsetlabel", "lib/matplotlib/tests/test_axes.py::test_errorbar_every_invalid", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_shownotches[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nobox[png]", "lib/matplotlib/tests/test_axes.py::test_vertex_markers[png]", "lib/matplotlib/tests/test_axes.py::test_log_margins", "lib/matplotlib/tests/test_axes.py::test_imshow[pdf]", "lib/matplotlib/tests/test_axes.py::test_titlesetpos", "lib/matplotlib/tests/test_axes.py::test_stairs_update[png]", "lib/matplotlib/tests/test_axes.py::test_hist_emptydata", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[png]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-y]", "lib/matplotlib/tests/test_axes.py::test_bxp_no_flier_stats[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvline-axhline-args0]", "lib/matplotlib/tests/test_axes.py::test_axis_set_tick_params_labelsize_labelcolor", "lib/matplotlib/tests/test_axes.py::test_vlines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs25]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_empty", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs35]", "lib/matplotlib/tests/test_axes.py::test_subplot_key_hash", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs7-r]", "lib/matplotlib/tests/test_axes.py::test_log_scales_invalid", "lib/matplotlib/tests/test_axes.py::test_pcolorargs_5205", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[8]", "lib/matplotlib/tests/test_axes.py::test_xerr_yerr_not_negative", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_float16", "lib/matplotlib/tests/test_axes.py::test_manage_xticks", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_empty_line_plots", "lib/matplotlib/tests/test_axes.py::test_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_pandas_errorbar_indexing", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-fill_between]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data0]", "lib/matplotlib/tests/test_axes.py::test_pathological_hexbin", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth0]", "lib/matplotlib/tests/test_axes.py::test_stairs_fill[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case19-None]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_mismatch", "lib/matplotlib/tests/test_axes.py::test_bxp_custompositions[png]", "lib/matplotlib/tests/test_axes.py::test_color_length_mismatch", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_canonical[pdf]", "lib/matplotlib/tests/test_axes.py::test_boxplot_no_weird_whisker[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_imshow[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-small]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs1-None]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs45]", "lib/matplotlib/tests/test_axes.py::test_pandas_minimal_plot", "lib/matplotlib/tests/test_axes.py::test_stairs[png]", "lib/matplotlib/tests/test_axes.py::test_none_kwargs", "lib/matplotlib/tests/test_axes.py::test_specgram[png]", "lib/matplotlib/tests/test_axes.py::test_hlines_default", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case12-None]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-scatter]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_errors", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case21-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_3", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case17-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs34]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data2]", "lib/matplotlib/tests/test_axes.py::test_subsampled_ticklabels", "lib/matplotlib/tests/test_axes.py::test_title_pad", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata", "lib/matplotlib/tests/test_axes.py::test_cla_not_redefined_internally", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[png]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[major-True-False]", "lib/matplotlib/tests/test_axes.py::test_shared_scale", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs18]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[pdf]", "lib/matplotlib/tests/test_axes.py::test_text_labelsize", "lib/matplotlib/tests/test_axes.py::test_marker_styles[png]", "lib/matplotlib/tests/test_axes.py::test_bar_broadcast_args", "lib/matplotlib/tests/test_axes.py::test_set_ticks_inverted", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_roundtrip", "lib/matplotlib/tests/test_axes.py::test_nodecorator", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs0-None]", "lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]", "lib/matplotlib/tests/test_axes.py::test_tick_label_update", "lib/matplotlib/tests/test_axes.py::test_sharing_does_not_link_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs50]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data0]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case8-conversion]", "lib/matplotlib/tests/test_axes.py::test_stem_args", "lib/matplotlib/tests/test_axes.py::test_axline[png]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmean[png]", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg2", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case16-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::test_rc_spines[png]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x3-width3-bars-expected_labels3-bars]", "lib/matplotlib/tests/test_axes.py::test_hist_log_barstacked", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_y_input]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case24-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_specgram_fs_none", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[left title moved]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nan[png]", "lib/matplotlib/tests/test_axes.py::test_symlog2[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x2-width2-label2-expected_labels2-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_2D[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xyinverted", "lib/matplotlib/tests/test_axes.py::test_automatic_legend", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-x]", "lib/matplotlib/tests/test_axes.py::test_pyplot_axes", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_yinverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs8]", "lib/matplotlib/tests/test_axes.py::test_tickdirs", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-3-1]", "lib/matplotlib/tests/test_axes.py::test_bar_ticklabel_fail", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs28]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_xlabelside", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-False]", "lib/matplotlib/tests/test_axes.py::test_sticky_shared_axes[png]", "lib/matplotlib/tests/test_axes.py::test_hist_range_and_density", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_nan", "lib/matplotlib/tests/test_axes.py::test_specgram_angle[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[svg]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[bar-1]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-x]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs33]", "lib/matplotlib/tests/test_axes.py::test_large_offset", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top_both", "lib/matplotlib/tests/test_axes.py::test_hist_log_2[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorflaterror", "lib/matplotlib/tests/test_axes.py::test_hexbin_log[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_problem_kwargs[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top", "lib/matplotlib/tests/test_axes.py::test_nan_bar_values", "lib/matplotlib/tests/test_axes.py::test_errorbar_dashes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs41]", "lib/matplotlib/tests/test_axes.py::test_bbox_aspect_axes_init", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[pdf]", "lib/matplotlib/tests/test_axes.py::test_grid", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfillable", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_edgecolor_RGB", "lib/matplotlib/tests/test_axes.py::test_spy[png]", "lib/matplotlib/tests/test_axes.py::test_rc_major_minor_tick", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_single_point[pdf]", "lib/matplotlib/tests/test_axes.py::test_arc_angles[png]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data0-1]", "lib/matplotlib/tests/test_axes.py::test_shaped_data[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt[format]", "lib/matplotlib/tests/test_axes.py::test_funcformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hexbin_pickable", "lib/matplotlib/tests/test_axes.py::test_patch_bounds", "lib/matplotlib/tests/test_axes.py::test_scatter_empty_data", "lib/matplotlib/tests/test_axes.py::test_zero_linewidth", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs7]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs14]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y2_input]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs4-r]", "lib/matplotlib/tests/test_axes.py::test_adjust_numtick_aspect", "lib/matplotlib/tests/test_axes.py::test_inset", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data0]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args2-kwargs2-the first argument to axis*]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-symlog]", "lib/matplotlib/tests/test_axes.py::test_unicode_hist_label", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[pdf]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-x]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x1_input]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args4-kwargs4-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_fillbetween_cycle", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_1", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case22-shape]", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym[png]", "lib/matplotlib/tests/test_axes.py::test_structured_data", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d[png]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs13]", "lib/matplotlib/tests/test_axes.py::test_pcolor_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs44]", "lib/matplotlib/tests/test_axes.py::test_pandas_bar_align_center", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-plot]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xinverted", "lib/matplotlib/tests/test_axes.py::test_axline_args", "lib/matplotlib/tests/test_axes.py::test_spines_properbbox_after_zoom", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_center", "lib/matplotlib/tests/test_axes.py::test_secondary_minorloc", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[x]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args0-kwargs0-axis\\\\(\\\\) takes from 0 to 1 positional arguments but 2 were given]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[larger]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs21]", "lib/matplotlib/tests/test_axes.py::test_normal_axes", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[None-None]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[png]", "lib/matplotlib/tests/test_axes.py::test_fill_units[png]", "lib/matplotlib/tests/test_axes.py::test_small_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case10-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs17]", "lib/matplotlib/tests/test_axes.py::test_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_timedelta", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_line_specific_kwargs", "lib/matplotlib/tests/test_axes.py::test_axisbelow[png]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[svg]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[smaller]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_x_input]", "lib/matplotlib/tests/test_axes.py::test_boxplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs27]", "lib/matplotlib/tests/test_axes.py::test_axis_method_errors", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_capwidths", "lib/matplotlib/tests/test_axes.py::test_canonical[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data1]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[png]", "lib/matplotlib/tests/test_axes.py::test_2dcolor_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_shape", "lib/matplotlib/tests/test_axes.py::test_twin_spines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_violin_point_mass", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-y]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-False]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidth[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_widths", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs31]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_errorbars", "lib/matplotlib/tests/test_axes.py::test_inset_polar[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_medians", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_datalim", "lib/matplotlib/tests/test_axes.py::test_boxplot_marker_behavior", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_color_c[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvspan-axhspan-args1]", "lib/matplotlib/tests/test_axes.py::test_markevery[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs26]", "lib/matplotlib/tests/test_axes.py::test_bezier_autoscale", "lib/matplotlib/tests/test_axes.py::test_pie_textprops", "lib/matplotlib/tests/test_axes.py::test_zorder_and_explicit_rasterization", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[left]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[pdf]", "lib/matplotlib/tests/test_axes.py::test_psd_csd_edge_cases", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_annotate_across_transforms[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x2_input]", "lib/matplotlib/tests/test_axes.py::test_log_scales", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-y]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data2]", "lib/matplotlib/tests/test_axes.py::test_empty_ticks_fixed_loc", "lib/matplotlib/tests/test_axes.py::test_bad_plot_args", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs42]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs46]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[svg]", "lib/matplotlib/tests/test_axes.py::test_gettightbbox_ignore_nan", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_plot_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_repr", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_xlabels[png]", "lib/matplotlib/tests/test_axes.py::test_twin_remove[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params3-expected_result3]", "lib/matplotlib/tests/test_axes.py::test_tick_padding_tightbbox", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[svg]", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_hist_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_log_shared", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[pdf]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[pdf]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_with_labels[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-symlog]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case7-conversion]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[center title kept]", "lib/matplotlib/tests/test_axes.py::test_pie_get_negative_values", "lib/matplotlib/tests/test_axes.py::test_aitoff_proj[png]", "lib/matplotlib/tests/test_axes.py::test_polar_interpolation_steps_variable_r[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_height[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args6-kwargs6-Must pass a single positional argument]", "lib/matplotlib/tests/test_axes.py::test_inverted_limits", "lib/matplotlib/tests/test_axes.py::test_boxplot_capwidths", "lib/matplotlib/tests/test_axes.py::test_auto_numticks_log", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_ylabelside", "lib/matplotlib/tests/test_axes.py::test_hist_barstacked_bottom_unchanged", "lib/matplotlib/tests/test_axes.py::test_eventplot_defaults[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nocaps[png]", "lib/matplotlib/tests/test_axes.py::test_set_aspect_negative", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[jaune-conversion]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nonefmt", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_with_CIarray[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_autorange_whiskers[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[svg]", "lib/matplotlib/tests/test_axes.py::test_redraw_in_frame", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[pdf]", "lib/matplotlib/tests/test_axes.py::test_shared_bool", "lib/matplotlib/tests/test_axes.py::test_title_no_move_off_page", "lib/matplotlib/tests/test_axes.py::test_titletwiny", "lib/matplotlib/tests/test_axes.py::test_stairs_edge_handling[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs30]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-y]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[png]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_small[eps]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-x]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case27-conversion]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y1_input]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwhisker[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_subclass_clear_cla", "lib/matplotlib/tests/test_axes.py::test_normalize_kwarg_pie", "lib/matplotlib/tests/test_axes.py::test_vlines_default", "lib/matplotlib/tests/test_axes.py::test_stairs_baseline_0[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case29-conversion]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[right]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case1-conversion]" ]
[ "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[pdf]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[pdf]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[svg]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_multi[png]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[svg]", "lib/matplotlib/tests/test_axes.py::test_pie_hatch_single[png]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/pie_hatch.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/pie_hatch.rst", "metadata": "diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst\nnew file mode 100644\nindex 000000000000..f54def10e954\n--- /dev/null\n+++ b/doc/users/next_whats_new/pie_hatch.rst\n@@ -0,0 +1,18 @@\n+``hatch`` parameter for pie\n+-------------------------------------------\n+\n+`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input\n+a hatch or list of hatches:\n+\n+.. plot::\n+ :include-source: true\n+ :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice.\n+\n+ fig, (ax1, ax2) = plt.subplots(ncols=2)\n+ x = [10, 30, 60]\n+\n+ ax1.pie(x, hatch=['.', 'o', 'O'])\n+ ax2.pie(x, hatch='.O')\n+\n+ ax1.set_title(\"hatch=['.', 'o', 'O']\")\n+ ax2.set_title(\"hatch='.O'\")\n" } ]
diff --git a/doc/users/next_whats_new/pie_hatch.rst b/doc/users/next_whats_new/pie_hatch.rst new file mode 100644 index 000000000000..f54def10e954 --- /dev/null +++ b/doc/users/next_whats_new/pie_hatch.rst @@ -0,0 +1,18 @@ +``hatch`` parameter for pie +------------------------------------------- + +`~matplotlib.axes.Axes.pie` now accepts a *hatch* keyword that takes as input +a hatch or list of hatches: + +.. plot:: + :include-source: true + :alt: Two pie charts, identified as ax1 and ax2, both have a small blue slice, a medium orange slice, and a large green slice. ax1 has a dot hatching on the small slice, a small open circle hatching on the medium slice, and a large open circle hatching on the large slice. ax2 has the same large open circle with a dot hatch on every slice. + + fig, (ax1, ax2) = plt.subplots(ncols=2) + x = [10, 30, 60] + + ax1.pie(x, hatch=['.', 'o', 'O']) + ax2.pie(x, hatch='.O') + + ax1.set_title("hatch=['.', 'o', 'O']") + ax2.set_title("hatch='.O'")
matplotlib/matplotlib
matplotlib__matplotlib-23525
https://github.com/matplotlib/matplotlib/pull/23525
diff --git a/doc/users/next_whats_new/bar_plot_labels.rst b/doc/users/next_whats_new/bar_plot_labels.rst new file mode 100644 index 000000000000..6da57a317f59 --- /dev/null +++ b/doc/users/next_whats_new/bar_plot_labels.rst @@ -0,0 +1,16 @@ +Easier labelling of bars in bar plot +------------------------------------ + +The ``label`` argument of `~matplotlib.axes.Axes.bar` can now +be passed a list of labels for the bars. + +.. code-block:: python + + import matplotlib.pyplot as plt + + x = ["a", "b", "c"] + y = [10, 20, 15] + + fig, ax = plt.subplots() + bar_container = ax.barh(x, y, label=x) + [bar.get_label() for bar in bar_container] diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 25b3cf36651f..3159a55b7e83 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2256,6 +2256,14 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", The tick labels of the bars. Default: None (Use default numeric labels.) + label : str or list of str, optional + A single label is attached to the resulting `.BarContainer` as a + label for the whole dataset. + If a list is provided, it must be the same length as *x* and + labels the individual bars. Repeated labels are not de-duplicated + and will cause repeated label entries, so this is best used when + bars also differ in style (e.g., by passing a list to *color*.) + xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional If not *None*, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data: @@ -2381,6 +2389,16 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", tick_label_axis = self.yaxis tick_label_position = y + if not isinstance(label, str) and np.iterable(label): + bar_container_label = '_nolegend_' + patch_labels = label + else: + bar_container_label = label + patch_labels = ['_nolegend_'] * len(x) + if len(patch_labels) != len(x): + raise ValueError(f'number of labels ({len(patch_labels)}) ' + f'does not match number of bars ({len(x)}).') + linewidth = itertools.cycle(np.atleast_1d(linewidth)) hatch = itertools.cycle(np.atleast_1d(hatch)) color = itertools.chain(itertools.cycle(mcolors.to_rgba_array(color)), @@ -2420,14 +2438,14 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", patches = [] args = zip(left, bottom, width, height, color, edgecolor, linewidth, - hatch) - for l, b, w, h, c, e, lw, htch in args: + hatch, patch_labels) + for l, b, w, h, c, e, lw, htch, lbl in args: r = mpatches.Rectangle( xy=(l, b), width=w, height=h, facecolor=c, edgecolor=e, linewidth=lw, - label='_nolegend_', + label=lbl, hatch=htch, ) r._internal_update(kwargs) @@ -2466,7 +2484,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", datavalues = width bar_container = BarContainer(patches, errorbar, datavalues=datavalues, - orientation=orientation, label=label) + orientation=orientation, + label=bar_container_label) self.add_container(bar_container) if tick_labels is not None:
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 51fbea3cfaaa..3a1ba341b2e0 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1886,6 +1886,35 @@ def test_bar_hatches(fig_test, fig_ref): ax_test.bar(x, y, hatch=hatches) +@pytest.mark.parametrize( + ("x", "width", "label", "expected_labels", "container_label"), + [ + ("x", 1, "x", ["_nolegend_"], "x"), + (["a", "b", "c"], [10, 20, 15], ["A", "B", "C"], + ["A", "B", "C"], "_nolegend_"), + (["a", "b", "c"], [10, 20, 15], ["R", "Y", "_nolegend_"], + ["R", "Y", "_nolegend_"], "_nolegend_"), + (["a", "b", "c"], [10, 20, 15], "bars", + ["_nolegend_", "_nolegend_", "_nolegend_"], "bars"), + ] +) +def test_bar_labels(x, width, label, expected_labels, container_label): + _, ax = plt.subplots() + bar_container = ax.bar(x, width, label=label) + bar_labels = [bar.get_label() for bar in bar_container] + assert expected_labels == bar_labels + assert bar_container.get_label() == container_label + + +def test_bar_labels_length(): + _, ax = plt.subplots() + with pytest.raises(ValueError): + ax.bar(["x", "y"], [1, 2], label=["X", "Y", "Z"]) + _, ax = plt.subplots() + with pytest.raises(ValueError): + ax.bar(["x", "y"], [1, 2], label=["X"]) + + def test_pandas_minimal_plot(pd): # smoke test that series and index objects do not warn for x in [pd.Series([1, 2], dtype="float64"),
[ { "path": "doc/users/next_whats_new/bar_plot_labels.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/bar_plot_labels.rst", "metadata": "diff --git a/doc/users/next_whats_new/bar_plot_labels.rst b/doc/users/next_whats_new/bar_plot_labels.rst\nnew file mode 100644\nindex 000000000000..6da57a317f59\n--- /dev/null\n+++ b/doc/users/next_whats_new/bar_plot_labels.rst\n@@ -0,0 +1,16 @@\n+Easier labelling of bars in bar plot\n+------------------------------------\n+\n+The ``label`` argument of `~matplotlib.axes.Axes.bar` can now\n+be passed a list of labels for the bars.\n+\n+.. code-block:: python\n+\n+ import matplotlib.pyplot as plt\n+\n+ x = [\"a\", \"b\", \"c\"]\n+ y = [10, 20, 15]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.barh(x, y, label=x)\n+ [bar.get_label() for bar in bar_container]\n" } ]
3.5
23100c42b274898f983011c12d5399a96982fe71
[ "lib/matplotlib/tests/test_axes.py::test_stem_dates", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs12]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[stepfilled-1]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_signature", "lib/matplotlib/tests/test_axes.py::test_boxplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_custommedian[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_empty_eventplot", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case11-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-y]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_inverse_forward_closure", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[svg]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[png]", "lib/matplotlib/tests/test_axes.py::test_color_alias", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_edgecolor_none_alpha", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data1]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_retick", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_quantiles", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_hist", "lib/matplotlib/tests/test_axes.py::test_lines_with_colors[png-data0]", "lib/matplotlib/tests/test_axes.py::test_bar_color_none_alpha", "lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs5]", "lib/matplotlib/tests/test_axes.py::test_bxp_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_empty", "lib/matplotlib/tests/test_axes.py::test_hist2d[svg]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-x]", "lib/matplotlib/tests/test_axes.py::test_hist_log[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[svg]", "lib/matplotlib/tests/test_axes.py::test_hlines[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_no_invalid_color[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[png]", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[small]", "lib/matplotlib/tests/test_axes.py::test_color_None", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[pdf]", "lib/matplotlib/tests/test_axes.py::test_stairs_datetime[png]", "lib/matplotlib/tests/test_axes.py::test_margins", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs3-expected_edgecolors3]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[svg]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_customoutlier[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom[png]", "lib/matplotlib/tests/test_axes.py::test_imshow[svg]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-x]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes_relim", "lib/matplotlib/tests/test_axes.py::test_symlog[pdf]", "lib/matplotlib/tests/test_axes.py::test_strmethodformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hist_density[png]", "lib/matplotlib/tests/test_axes.py::test_stem_markerfmt", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors2]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs22]", "lib/matplotlib/tests/test_axes.py::test_multiplot_autoscale", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[none-None]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs2-r]", "lib/matplotlib/tests/test_axes.py::test_errorbar_colorcycle", "lib/matplotlib/tests/test_axes.py::test_secondary_xy[png]", "lib/matplotlib/tests/test_axes.py::test_auto_numticks", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs36]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[True]", "lib/matplotlib/tests/test_axes.py::test_hist_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_artist_sublists", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs38]", "lib/matplotlib/tests/test_axes.py::test_eventplot[svg]", "lib/matplotlib/tests/test_axes.py::test_single_date[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_ylabels[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors1]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[ValueError-args1-kwargs1-Unrecognized string 'foo' to axis; try 'on' or 'off']", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs10]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x_and_y[png]", "lib/matplotlib/tests/test_axes.py::test_axline[svg]", "lib/matplotlib/tests/test_axes.py::test_set_get_ticklabels[png]", "lib/matplotlib/tests/test_axes.py::test_box_aspect_custom_position", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case5-None]", "lib/matplotlib/tests/test_axes.py::test_markers_fillstyle_rcparams[png]", "lib/matplotlib/tests/test_axes.py::test_rc_grid[png]", "lib/matplotlib/tests/test_axes.py::test_inset_subclass", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs6]", "lib/matplotlib/tests/test_axes.py::test_spectrum[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[pdf]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[red-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple_old_alignment[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-large]", "lib/matplotlib/tests/test_axes.py::test_eventplot[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs29]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs43]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case25-None]", "lib/matplotlib/tests/test_axes.py::test_eventplot_legend", "lib/matplotlib/tests/test_axes.py::test_invisible_axes_events", "lib/matplotlib/tests/test_axes.py::test_bxp_custombox[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_rangewhis[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-x]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[datetime.datetime]", "lib/matplotlib/tests/test_axes.py::test_hist_labels", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs40]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_widths", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_update2", "lib/matplotlib/tests/test_axes.py::test_tick_space_size_0", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_specgram_magnitude[png]", "lib/matplotlib/tests/test_axes.py::test_bar_uint8", "lib/matplotlib/tests/test_axes.py::test_barb_units", "lib/matplotlib/tests/test_axes.py::test_hist_auto_bins", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[12]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_gridlines", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs48]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[both titles aligned]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data1-1]", "lib/matplotlib/tests/test_axes.py::test_stackplot[svg]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_autoscale", "lib/matplotlib/tests/test_axes.py::test_stairs_empty", "lib/matplotlib/tests/test_axes.py::test_pie_nolabel_but_legend[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_in_view", "lib/matplotlib/tests/test_axes.py::test_imshow_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_linewidths", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params2-expected_result2]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmeanasline[png]", "lib/matplotlib/tests/test_axes.py::test_offset_text_visible", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_positions", "lib/matplotlib/tests/test_axes.py::test_canonical[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[png]", "lib/matplotlib/tests/test_axes.py::test_annotate_default_arrow", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs47]", "lib/matplotlib/tests/test_axes.py::test_inverted_cla", "lib/matplotlib/tests/test_axes.py::test_errorbar_with_prop_cycle[png]", "lib/matplotlib/tests/test_axes.py::test_relim_visible_only", "lib/matplotlib/tests/test_axes.py::test_numerical_hist_label", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[svg]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_pcolormesh", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs20]", "lib/matplotlib/tests/test_axes.py::test_axline[pdf]", "lib/matplotlib/tests/test_axes.py::test_length_one_hist", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_cycle_ecolor[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[svg]", "lib/matplotlib/tests/test_axes.py::test_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs39]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[svg]", "lib/matplotlib/tests/test_axes.py::test_violinplot_outofrange_quantiles", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case9-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_get_xticklabel", "lib/matplotlib/tests/test_axes.py::test_reset_grid", "lib/matplotlib/tests/test_axes.py::test_errorbar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs9]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data2]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[png]", "lib/matplotlib/tests/test_axes.py::test_set_xy_bound", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args1-kwargs1-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-y]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[pdf]", "lib/matplotlib/tests/test_axes.py::test_scatter_series_non_zero_index", "lib/matplotlib/tests/test_axes.py::test_label_shift", "lib/matplotlib/tests/test_axes.py::test_pcolor_regression", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs49]", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_box", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_kwarg", "lib/matplotlib/tests/test_axes.py::test_hist2d[pdf]", "lib/matplotlib/tests/test_axes.py::test_plot_format_kwarg_redundant", "lib/matplotlib/tests/test_axes.py::test_pie_center_radius[png]", "lib/matplotlib/tests/test_axes.py::test_set_margin_updates_limits", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_every[pdf]", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[png]", "lib/matplotlib/tests/test_axes.py::test_retain_tick_visibility[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_empty[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_single[png]", "lib/matplotlib/tests/test_axes.py::test_stairs_options[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case20-shape]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs24]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs10-g]", "lib/matplotlib/tests/test_axes.py::test_boxplot_not_single", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[x-small]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[large]", "lib/matplotlib/tests/test_axes.py::test_hexbin_log_clim", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_step[png]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args3-kwargs3-axis\\\\(\\\\) got an unexpected keyword argument 'foo']", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case18-shape]", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[y]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_margins", "lib/matplotlib/tests/test_axes.py::test_hist_log[svg]", "lib/matplotlib/tests/test_axes.py::test_pandas_indexing_dates", "lib/matplotlib/tests/test_axes.py::test_tick_param_label_rotation", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args2-kwargs2-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case15-None]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x-1-x-expected_labels0-x]", "lib/matplotlib/tests/test_axes.py::test_shared_aspect_error", "lib/matplotlib/tests/test_axes.py::test_pie_rotatelabels_true[png]", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[svg]", "lib/matplotlib/tests/test_axes.py::test_o_marker_path_snap[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_timedelta", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_width[png]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-y]", "lib/matplotlib/tests/test_axes.py::test_single_point[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_format", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-large]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_step_geometry", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_specgram_origin_rcparam[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[minor-False-True]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_colors[colors0]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-log]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[center]", "lib/matplotlib/tests/test_axes.py::test_pcolornearestunits[png]", "lib/matplotlib/tests/test_axes.py::test_bar_color_cycle", "lib/matplotlib/tests/test_axes.py::test_marker_edges[png]", "lib/matplotlib/tests/test_axes.py::test_offset_label_color", "lib/matplotlib/tests/test_axes.py::test_empty_shared_subplots", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs23]", "lib/matplotlib/tests/test_axes.py::test_empty_errorbar_legend", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs11]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfilled", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_forward_inverse_closure", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_marker[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_pie_ccw_true[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case26-shape]", "lib/matplotlib/tests/test_axes.py::test_bxp_showcustommean[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args5-kwargs5-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[pdf]", "lib/matplotlib/tests/test_axes.py::test_as_mpl_axes_api", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-True]", "lib/matplotlib/tests/test_axes.py::test_pie_default[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym2[png]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tight", "lib/matplotlib/tests/test_axes.py::test_bar_pandas", "lib/matplotlib/tests/test_axes.py::test_hist_unequal_bins_density", "lib/matplotlib/tests/test_axes.py::test_bxp_customcap[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case28-conversion]", "lib/matplotlib/tests/test_axes.py::test_twinx_knows_limits", "lib/matplotlib/tests/test_axes.py::test_secondary_formatter", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_vertical_yinverted", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data2-2]", "lib/matplotlib/tests/test_axes.py::test_violinplot_single_list_quantiles[png]", "lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]", "lib/matplotlib/tests/test_axes.py::test_pcolornearest[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[png]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_bar_tick_label_multiple[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on_rcParams_both[png]", "lib/matplotlib/tests/test_axes.py::test_axis_bool_arguments[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[date2num]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_mod_artist_after_plotting[png]", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs8-r]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[png]", "lib/matplotlib/tests/test_axes.py::test_hist_nan_data", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_2[png]", "lib/matplotlib/tests/test_axes.py::test_nan_barlabels", "lib/matplotlib/tests/test_axes.py::test_marker_as_markerstyle", "lib/matplotlib/tests/test_axes.py::test_hist_log[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_percentilewhis[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[png]", "lib/matplotlib/tests/test_axes.py::test_hexbin_linear[png]", "lib/matplotlib/tests/test_axes.py::test_arrow_simple[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_ci", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_fail", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata_inverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs32]", "lib/matplotlib/tests/test_axes.py::test_markerfacecolor_none_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-True]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[png]", "lib/matplotlib/tests/test_axes.py::test_zoom_inset", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-x]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy3-PcolorImage]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_xticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_set_position", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs15]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs6-none]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs5-face]", "lib/matplotlib/tests/test_axes.py::test_bxp_patchartist[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy0-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[medium]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params0-expected_result0]", "lib/matplotlib/tests/test_axes.py::test_mixed_collection[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_log_scales[png]", "lib/matplotlib/tests/test_axes.py::test_hist_bar_empty[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data1]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[svg]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_zorder", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs37]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_filled[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case23-None]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_box_aspect", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_hist_step_horiz[png]", "lib/matplotlib/tests/test_axes.py::test_twin_spines_on_top[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-log]", "lib/matplotlib/tests/test_axes.py::test_bxp_custompatchartist[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params1-expected_result1]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_nan[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs9-r]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-y]", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_error", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-True]", "lib/matplotlib/tests/test_axes.py::test_vline_limit", "lib/matplotlib/tests/test_axes.py::test_invalid_axis_limits", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_scalarwidth[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_custom_capwidths[png]", "lib/matplotlib/tests/test_axes.py::test_pie_frame_grid[png]", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[pdf]", "lib/matplotlib/tests/test_axes.py::test_xtickcolor_is_not_markercolor", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case13-None]", "lib/matplotlib/tests/test_axes.py::test_rc_tick", "lib/matplotlib/tests/test_axes.py::test_boxplot[svg]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_sticky", "lib/matplotlib/tests/test_axes.py::test_ytickcolor_is_not_yticklabelcolor", "lib/matplotlib/tests/test_axes.py::test_bar_label_labels", "lib/matplotlib/tests/test_axes.py::test_rgba_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data1]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs51]", "lib/matplotlib/tests/test_axes.py::test_secondary_resize", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_log_scales_no_data", "lib/matplotlib/tests/test_axes.py::test_bar_decimal_center[png]", "lib/matplotlib/tests/test_axes.py::test_markevery[png]", "lib/matplotlib/tests/test_axes.py::test_matshow[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_quiver_units", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy4-QuadMesh]", "lib/matplotlib/tests/test_axes.py::test_warn_ignored_scatter_kwargs", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[svg]", "lib/matplotlib/tests/test_axes.py::test_date_timezone_y[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs19]", "lib/matplotlib/tests/test_axes.py::test_boxplot_dates_pandas", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[png]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[png]", "lib/matplotlib/tests/test_axes.py::test_psd_csd[png]", "lib/matplotlib/tests/test_axes.py::test_violinplot_pandas_series[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step[png]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets_bins[np.datetime64]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[svg]", "lib/matplotlib/tests/test_axes.py::test_barh_tick_label[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d_density", "lib/matplotlib/tests/test_axes.py::test_hexbin_extent[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs16]", "lib/matplotlib/tests/test_axes.py::test_pie_linewidth_0[png]", "lib/matplotlib/tests/test_axes.py::test_minor_accountedfor", "lib/matplotlib/tests/test_axes.py::test_loglog_nonpos[png]", "lib/matplotlib/tests/test_axes.py::test_bar_pandas_indexed", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[png]", "lib/matplotlib/tests/test_axes.py::test_inset_projection", "lib/matplotlib/tests/test_axes.py::test_arc_ellipse[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwidths[png]", "lib/matplotlib/tests/test_axes.py::test_clim", "lib/matplotlib/tests/test_axes.py::test_label_loc_rc[svg]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[pdf]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs4]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_norm_vminvmax", "lib/matplotlib/tests/test_axes.py::test_acorr[png]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[both-True-True]", "lib/matplotlib/tests/test_axes.py::test_displaced_spine", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[step-2]", "lib/matplotlib/tests/test_axes.py::test_hist_datetime_datasets", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params4-expected_result4]", "lib/matplotlib/tests/test_axes.py::test_mismatched_ticklabels", "lib/matplotlib/tests/test_axes.py::test_dash_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data0-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[10]", "lib/matplotlib/tests/test_axes.py::test_hexbin_empty[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case14-conversion]", "lib/matplotlib/tests/test_axes.py::test_use_sticky_edges", "lib/matplotlib/tests/test_axes.py::test_square_plot", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args0-kwargs0-axis\\\\(\\\\) takes 0 or 1 positional arguments but 2 were given]", "lib/matplotlib/tests/test_axes.py::test_pandas_index_shape", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_2", "lib/matplotlib/tests/test_axes.py::test_move_offsetlabel", "lib/matplotlib/tests/test_axes.py::test_errorbar_every_invalid", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_shownotches[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nobox[png]", "lib/matplotlib/tests/test_axes.py::test_vertex_markers[png]", "lib/matplotlib/tests/test_axes.py::test_log_margins", "lib/matplotlib/tests/test_axes.py::test_imshow[pdf]", "lib/matplotlib/tests/test_axes.py::test_titlesetpos", "lib/matplotlib/tests/test_axes.py::test_stairs_update[png]", "lib/matplotlib/tests/test_axes.py::test_hist_emptydata", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[png]", "lib/matplotlib/tests/test_axes.py::test_dash_offset[png]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots-y]", "lib/matplotlib/tests/test_axes.py::test_bxp_no_flier_stats[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvline-axhline-args0]", "lib/matplotlib/tests/test_axes.py::test_axis_set_tick_params_labelsize_labelcolor", "lib/matplotlib/tests/test_axes.py::test_vlines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs25]", "lib/matplotlib/tests/test_axes.py::test_broken_barh_empty", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs35]", "lib/matplotlib/tests/test_axes.py::test_subplot_key_hash", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs7-r]", "lib/matplotlib/tests/test_axes.py::test_log_scales_invalid", "lib/matplotlib/tests/test_axes.py::test_pcolorargs_5205", "lib/matplotlib/tests/test_axes.py::test_bar_hatches[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[8]", "lib/matplotlib/tests/test_axes.py::test_xerr_yerr_not_negative", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args3-kwargs3-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy2-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_float16", "lib/matplotlib/tests/test_axes.py::test_manage_xticks", "lib/matplotlib/tests/test_axes.py::test_axline_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_empty_line_plots", "lib/matplotlib/tests/test_axes.py::test_loglog[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showextrema[png]", "lib/matplotlib/tests/test_axes.py::test_pandas_errorbar_indexing", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-fill_between]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data0]", "lib/matplotlib/tests/test_axes.py::test_pathological_hexbin", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_geometry", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth0]", "lib/matplotlib/tests/test_axes.py::test_stairs_fill[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case19-None]", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_mismatch", "lib/matplotlib/tests/test_axes.py::test_bxp_custompositions[png]", "lib/matplotlib/tests/test_axes.py::test_color_length_mismatch", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-rk-'rk' is not a valid format string \\\\(two color symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_canonical[pdf]", "lib/matplotlib/tests/test_axes.py::test_boxplot_no_weird_whisker[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::test_polycollection_joinstyle[pdf]", "lib/matplotlib/tests/test_axes.py::test_imshow[png]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[xx-small]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs1-None]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmedians[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs45]", "lib/matplotlib/tests/test_axes.py::test_pandas_minimal_plot", "lib/matplotlib/tests/test_axes.py::test_stairs[png]", "lib/matplotlib/tests/test_axes.py::test_none_kwargs", "lib/matplotlib/tests/test_axes.py::test_specgram[png]", "lib/matplotlib/tests/test_axes.py::test_hlines_default", "lib/matplotlib/tests/test_axes.py::test_eb_line_zorder[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case12-None]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-scatter]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[svg]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_density[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar[svg]", "lib/matplotlib/tests/test_axes.py::test_plot_errors", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case21-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs1]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_3", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case17-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs34]", "lib/matplotlib/tests/test_axes.py::test_violinplot_bad_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[horizontal-data2]", "lib/matplotlib/tests/test_axes.py::test_subsampled_ticklabels", "lib/matplotlib/tests/test_axes.py::test_title_pad", "lib/matplotlib/tests/test_axes.py::test_bar_label_nan_ydata", "lib/matplotlib/tests/test_axes.py::test_shared_scale", "lib/matplotlib/tests/test_axes.py::test_twin_axis_locators_formatters[png]", "lib/matplotlib/tests/test_axes.py::test_formatter_ticker[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[svg]", "lib/matplotlib/tests/test_axes.py::test_rcparam_grid_minor[major-True-False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs18]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[pdf]", "lib/matplotlib/tests/test_axes.py::test_text_labelsize", "lib/matplotlib/tests/test_axes.py::test_marker_styles[png]", "lib/matplotlib/tests/test_axes.py::test_bar_broadcast_args", "lib/matplotlib/tests/test_axes.py::test_set_ticks_inverted", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_axvspan_epoch[svg]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[svg]", "lib/matplotlib/tests/test_axes.py::test_title_location_roundtrip", "lib/matplotlib/tests/test_axes.py::test_nodecorator", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs0-None]", "lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]", "lib/matplotlib/tests/test_axes.py::test_tick_label_update", "lib/matplotlib/tests/test_axes.py::test_sharing_does_not_link_positions", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs50]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data0]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-f-'f' is not a valid format string \\\\(unrecognized character 'f'\\\\)]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case8-conversion]", "lib/matplotlib/tests/test_axes.py::test_stem_args", "lib/matplotlib/tests/test_axes.py::test_axline[png]", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[pdf]", "lib/matplotlib/tests/test_axes.py::test_bxp_showmean[png]", "lib/matplotlib/tests/test_axes.py::test_axis_extent_arg2", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case16-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_offset[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::test_rc_spines[png]", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x3-width3-bars-expected_labels3-bars]", "lib/matplotlib/tests/test_axes.py::test_hist_log_barstacked", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_y_input]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case24-shape]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_step_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_specgram_fs_none", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[left title moved]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nan[png]", "lib/matplotlib/tests/test_axes.py::test_symlog2[pdf]", "lib/matplotlib/tests/test_axes.py::test_mollweide_grid[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_2D[png]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xyinverted", "lib/matplotlib/tests/test_axes.py::test_automatic_legend", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_zoomed[pdf]", "lib/matplotlib/tests/test_axes.py::test_twin_logscale[png-x]", "lib/matplotlib/tests/test_axes.py::test_pyplot_axes", "lib/matplotlib/tests/test_axes.py::test_transparent_markers[svg]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_yinverted", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs8]", "lib/matplotlib/tests/test_axes.py::test_tickdirs", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_ticklabel_fail", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs28]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[svg]", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_xlabelside", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[True-False]", "lib/matplotlib/tests/test_axes.py::test_sticky_shared_axes[png]", "lib/matplotlib/tests/test_axes.py::test_hist_range_and_density", "lib/matplotlib/tests/test_axes.py::test_stairs_invalid_nan", "lib/matplotlib/tests/test_axes.py::test_specgram_angle[png]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes[svg]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_zorder[bar-1]", "lib/matplotlib/tests/test_axes.py::test_unautoscale[None-x]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs33]", "lib/matplotlib/tests/test_axes.py::test_large_offset", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top_both", "lib/matplotlib/tests/test_axes.py::test_hist_log_2[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showall[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorflaterror", "lib/matplotlib/tests/test_axes.py::test_hexbin_log[png]", "lib/matplotlib/tests/test_axes.py::test_eventplot_problem_kwargs[png]", "lib/matplotlib/tests/test_axes.py::test_title_xticks_top", "lib/matplotlib/tests/test_axes.py::test_nan_bar_values", "lib/matplotlib/tests/test_axes.py::test_errorbar_dashes[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs41]", "lib/matplotlib/tests/test_axes.py::test_bbox_aspect_axes_init", "lib/matplotlib/tests/test_axes.py::test_stackplot_baseline[pdf]", "lib/matplotlib/tests/test_axes.py::test_grid", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_unfillable", "lib/matplotlib/tests/test_axes.py::test_hist2d_transpose[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_edgecolor_RGB", "lib/matplotlib/tests/test_axes.py::test_spy[png]", "lib/matplotlib/tests/test_axes.py::test_rc_major_minor_tick", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_cla_not_redefined", "lib/matplotlib/tests/test_axes.py::test_single_point[pdf]", "lib/matplotlib/tests/test_axes.py::test_arc_angles[png]", "lib/matplotlib/tests/test_axes.py::test_hist_with_empty_input[data0-1]", "lib/matplotlib/tests/test_axes.py::test_shaped_data[png]", "lib/matplotlib/tests/test_axes.py::test_funcformatter_auto_formatter", "lib/matplotlib/tests/test_axes.py::test_hexbin_pickable", "lib/matplotlib/tests/test_axes.py::test_patch_bounds", "lib/matplotlib/tests/test_axes.py::test_scatter_empty_data", "lib/matplotlib/tests/test_axes.py::test_zero_linewidth", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs7]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs14]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y2_input]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args_edgecolors[kwargs4-r]", "lib/matplotlib/tests/test_axes.py::test_adjust_numtick_aspect", "lib/matplotlib/tests/test_axes.py::test_inset", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[vertical-data0]", "lib/matplotlib/tests/test_axes.py::test_axis_errors[TypeError-args2-kwargs2-the first argument to axis*]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[log-symlog]", "lib/matplotlib/tests/test_axes.py::test_unicode_hist_label", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_axline_transaxes_panzoom[pdf]", "lib/matplotlib/tests/test_axes.py::test_bar_label_fmt", "lib/matplotlib/tests/test_axes.py::test_unautoscale[True-x]", "lib/matplotlib/tests/test_axes.py::test_autoscale_tiny_range[pdf]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x1_input]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args4-kwargs4-Cannot pass both positional and keyword arguments for x and/or y]", "lib/matplotlib/tests/test_axes.py::test_contour_colorbar[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh[png]", "lib/matplotlib/tests/test_axes.py::test_hist_stepfilled_bottom_geometry", "lib/matplotlib/tests/test_axes.py::test_fillbetween_cycle", "lib/matplotlib/tests/test_axes.py::test_stem[png-w/o line collection]", "lib/matplotlib/tests/test_axes.py::test_shared_with_aspect_1", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_alpha[pdf]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case22-shape]", "lib/matplotlib/tests/test_axes.py::test_boxplot_sym[png]", "lib/matplotlib/tests/test_axes.py::test_structured_data", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[svg]", "lib/matplotlib/tests/test_axes.py::test_hist2d[png]", "lib/matplotlib/tests/test_axes.py::test_stem_orientation[png-w/ line collection]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs13]", "lib/matplotlib/tests/test_axes.py::test_pcolor_datetime_axis[png]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_baseline[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs44]", "lib/matplotlib/tests/test_axes.py::test_pandas_bar_align_center", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_200[png]", "lib/matplotlib/tests/test_axes.py::test_limits_empty_data[png-plot]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_horizontal_xinverted", "lib/matplotlib/tests/test_axes.py::test_axline_args", "lib/matplotlib/tests/test_axes.py::test_spines_properbbox_after_zoom", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_center", "lib/matplotlib/tests/test_axes.py::test_secondary_minorloc", "lib/matplotlib/tests/test_axes.py::test_twin_with_aspect[x]", "lib/matplotlib/tests/test_axes.py::test_set_noniterable_ticklabels", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[larger]", "lib/matplotlib/tests/test_axes.py::test_title_location_shared[False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs21]", "lib/matplotlib/tests/test_axes.py::test_normal_axes", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[None-None]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[png]", "lib/matplotlib/tests/test_axes.py::test_fill_units[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case10-None]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs17]", "lib/matplotlib/tests/test_axes.py::test_single_point[png]", "lib/matplotlib/tests/test_axes.py::test_bar_timedelta", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_bar[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_line_specific_kwargs", "lib/matplotlib/tests/test_axes.py::test_axisbelow[png]", "lib/matplotlib/tests/test_axes.py::test_marker_edges[svg]", "lib/matplotlib/tests/test_axes.py::test_imshow_clip[pdf]", "lib/matplotlib/tests/test_axes.py::test_relative_ticklabel_sizes[smaller]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_x_input]", "lib/matplotlib/tests/test_axes.py::test_boxplot[pdf]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs27]", "lib/matplotlib/tests/test_axes.py::test_axis_method_errors", "lib/matplotlib/tests/test_axes.py::test_date_timezone_x[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_capwidths", "lib/matplotlib/tests/test_axes.py::test_canonical[svg]", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data1]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[png]", "lib/matplotlib/tests/test_axes.py::test_2dcolor_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_stepfilled[png]", "lib/matplotlib/tests/test_axes.py::test_pcolorauto[png-False]", "lib/matplotlib/tests/test_axes.py::test_errorbar_shape", "lib/matplotlib/tests/test_axes.py::test_twin_spines[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_limits[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[ValueError-args0-kwargs0-margin must be greater than -0\\\\.5]", "lib/matplotlib/tests/test_axes.py::test_violin_point_mass", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[subplots_shared-y]", "lib/matplotlib/tests/test_axes.py::test_indicate_inset_inverted[False-False]", "lib/matplotlib/tests/test_axes.py::test_bxp_custom_capwidth[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_bad_widths", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs31]", "lib/matplotlib/tests/test_axes.py::test_bar_label_location_errorbars", "lib/matplotlib/tests/test_axes.py::test_inset_polar[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_bad_medians", "lib/matplotlib/tests/test_axes.py::test_aspect_nonlinear_adjustable_datalim", "lib/matplotlib/tests/test_axes.py::test_boxplot_marker_behavior", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_color_c[png]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales[svg]", "lib/matplotlib/tests/test_axes.py::test_axline_minmax[axvspan-axhspan-args1]", "lib/matplotlib/tests/test_axes.py::test_markevery[svg]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs26]", "lib/matplotlib/tests/test_axes.py::test_bezier_autoscale", "lib/matplotlib/tests/test_axes.py::test_pie_textprops", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs2]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[pdf]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[left]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[pdf]", "lib/matplotlib/tests/test_axes.py::test_psd_csd_edge_cases", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs3]", "lib/matplotlib/tests/test_axes.py::test_annotate_across_transforms[png]", "lib/matplotlib/tests/test_axes.py::test_fill_betweenx_input[2d_x2_input]", "lib/matplotlib/tests/test_axes.py::test_log_scales", "lib/matplotlib/tests/test_axes.py::test_unautoscale[False-y]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[data1-:--':-' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_step_linestyle[png]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-o+-'o\\\\+' is not a valid format string \\\\(two marker symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_markevery_linear_scales_nans[pdf]", "lib/matplotlib/tests/test_axes.py::test_pcolorargs", "lib/matplotlib/tests/test_axes.py::test_eventplot_orientation[None-data2]", "lib/matplotlib/tests/test_axes.py::test_empty_ticks_fixed_loc", "lib/matplotlib/tests/test_axes.py::test_bad_plot_args", "lib/matplotlib/tests/test_axes.py::test_tick_apply_tickdir_deprecation", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs42]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs46]", "lib/matplotlib/tests/test_axes.py::test_basic_annotate[svg]", "lib/matplotlib/tests/test_axes.py::test_gettightbbox_ignore_nan", "lib/matplotlib/tests/test_axes.py::test_axhspan_epoch[png]", "lib/matplotlib/tests/test_axes.py::test_plot_decimal[png]", "lib/matplotlib/tests/test_axes.py::test_secondary_repr", "lib/matplotlib/tests/test_axes.py::test_pcolorfast[data1-xy1-AxesImage]", "lib/matplotlib/tests/test_axes.py::test_hist_stacked_weighted[svg]", "lib/matplotlib/tests/test_axes.py::test_bxp_with_xlabels[png]", "lib/matplotlib/tests/test_axes.py::test_twin_remove[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_plot[pdf]", "lib/matplotlib/tests/test_axes.py::test_parse_scatter_color_args[params3-expected_result3]", "lib/matplotlib/tests/test_axes.py::test_tick_padding_tightbbox", "lib/matplotlib/tests/test_axes.py::test_markevery_polar[svg]", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_hist_offset[svg]", "lib/matplotlib/tests/test_axes.py::test_autoscale_log_shared", "lib/matplotlib/tests/test_axes.py::test_errorbar_linewidth_type[elinewidth1]", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate[pdf]", "lib/matplotlib/tests/test_axes.py::test_contour_hatching[pdf]", "lib/matplotlib/tests/test_axes.py::test_set_ticks_with_labels[png]", "lib/matplotlib/tests/test_axes.py::test_minorticks_on[symlog-symlog]", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case7-conversion]", "lib/matplotlib/tests/test_axes.py::test_title_above_offset[center title kept]", "lib/matplotlib/tests/test_axes.py::test_pie_get_negative_values", "lib/matplotlib/tests/test_axes.py::test_aitoff_proj[png]", "lib/matplotlib/tests/test_axes.py::test_polar_interpolation_steps_variable_r[png]", "lib/matplotlib/tests/test_axes.py::test_barh_decimal_height[png]", "lib/matplotlib/tests/test_axes.py::test_margins_errors[TypeError-args6-kwargs6-Must pass a single positional argument]", "lib/matplotlib/tests/test_axes.py::test_inverted_limits", "lib/matplotlib/tests/test_axes.py::test_boxplot_capwidths", "lib/matplotlib/tests/test_axes.py::test_auto_numticks_log", "lib/matplotlib/tests/test_axes.py::test_axes_tick_params_ylabelside", "lib/matplotlib/tests/test_axes.py::test_hist_barstacked_bottom_unchanged", "lib/matplotlib/tests/test_axes.py::test_eventplot_defaults[png]", "lib/matplotlib/tests/test_axes.py::test_bxp_nocaps[png]", "lib/matplotlib/tests/test_axes.py::test_vert_violinplot_showmeans[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[jaune-conversion]", "lib/matplotlib/tests/test_axes.py::test_errorbar_nonefmt", "lib/matplotlib/tests/test_axes.py::test_horiz_violinplot_custompoints_10[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_with_CIarray[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_autorange_whiskers[png]", "lib/matplotlib/tests/test_axes.py::test_boxplot_rc_parameters[svg]", "lib/matplotlib/tests/test_axes.py::test_redraw_in_frame", "lib/matplotlib/tests/test_axes.py::test_fill_between_interpolate_decreasing[pdf]", "lib/matplotlib/tests/test_axes.py::test_shared_bool", "lib/matplotlib/tests/test_axes.py::test_title_no_move_off_page", "lib/matplotlib/tests/test_axes.py::test_titletwiny", "lib/matplotlib/tests/test_axes.py::test_stairs_edge_handling[png]", "lib/matplotlib/tests/test_axes.py::test_errorbar_inputs_shotgun[kwargs30]", "lib/matplotlib/tests/test_axes.py::test_plot_format_errors[None-:o-r-':o-r' is not a valid format string \\\\(two linestyle symbols\\\\)]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[gca-y]", "lib/matplotlib/tests/test_axes.py::test_markevery_line[png]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_small[eps]", "lib/matplotlib/tests/test_axes.py::test_remove_shared_axes[add_axes-x]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case27-conversion]", "lib/matplotlib/tests/test_axes.py::test_nonfinite_limits[png]", "lib/matplotlib/tests/test_axes.py::test_fill_between_input[2d_y1_input]", "lib/matplotlib/tests/test_axes.py::test_bxp_customwhisker[png]", "lib/matplotlib/tests/test_axes.py::test_alpha[png]", "lib/matplotlib/tests/test_axes.py::test_normalize_kwarg_pie", "lib/matplotlib/tests/test_axes.py::test_vlines_default", "lib/matplotlib/tests/test_axes.py::test_stairs_baseline_0[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case29-conversion]", "lib/matplotlib/tests/test_axes.py::test_ylabel_ha_with_position[right]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[c_case1-conversion]" ]
[ "lib/matplotlib/tests/test_axes.py::test_bar_labels[x1-width1-label1-expected_labels1-_nolegend_]", "lib/matplotlib/tests/test_axes.py::test_bar_labels_length", "lib/matplotlib/tests/test_axes.py::test_bar_labels[x2-width2-label2-expected_labels2-_nolegend_]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/bar_plot_labels.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/bar_plot_labels.rst", "metadata": "diff --git a/doc/users/next_whats_new/bar_plot_labels.rst b/doc/users/next_whats_new/bar_plot_labels.rst\nnew file mode 100644\nindex 000000000000..6da57a317f59\n--- /dev/null\n+++ b/doc/users/next_whats_new/bar_plot_labels.rst\n@@ -0,0 +1,16 @@\n+Easier labelling of bars in bar plot\n+------------------------------------\n+\n+The ``label`` argument of `~matplotlib.axes.Axes.bar` can now\n+be passed a list of labels for the bars.\n+\n+.. code-block:: python\n+\n+ import matplotlib.pyplot as plt\n+\n+ x = [\"a\", \"b\", \"c\"]\n+ y = [10, 20, 15]\n+\n+ fig, ax = plt.subplots()\n+ bar_container = ax.barh(x, y, label=x)\n+ [bar.get_label() for bar in bar_container]\n" } ]
diff --git a/doc/users/next_whats_new/bar_plot_labels.rst b/doc/users/next_whats_new/bar_plot_labels.rst new file mode 100644 index 000000000000..6da57a317f59 --- /dev/null +++ b/doc/users/next_whats_new/bar_plot_labels.rst @@ -0,0 +1,16 @@ +Easier labelling of bars in bar plot +------------------------------------ + +The ``label`` argument of `~matplotlib.axes.Axes.bar` can now +be passed a list of labels for the bars. + +.. code-block:: python + + import matplotlib.pyplot as plt + + x = ["a", "b", "c"] + y = [10, 20, 15] + + fig, ax = plt.subplots() + bar_container = ax.barh(x, y, label=x) + [bar.get_label() for bar in bar_container]
matplotlib/matplotlib
matplotlib__matplotlib-18869
https://github.com/matplotlib/matplotlib/pull/18869
diff --git a/doc/users/next_whats_new/version_info.rst b/doc/users/next_whats_new/version_info.rst new file mode 100644 index 000000000000..5c51f9fe7332 --- /dev/null +++ b/doc/users/next_whats_new/version_info.rst @@ -0,0 +1,15 @@ +Version information +------------------- +We switched to the `release-branch-semver`_ version scheme. This only affects, +the version information for development builds. Their version number now +describes the targeted release, i.e. 3.5.0.dev820+g6768ef8c4c.d20210520 +is 820 commits after the previous release and is scheduled to be officially +released as 3.5.0 later. + +In addition to the string ``__version__``, there is now a namedtuple +``__version_info__`` as well, which is modelled after `sys.version_info`_. +Its primary use is safely comparing version information, e.g. +``if __version_info__ >= (3, 4, 2)``. + +.. _release-branch-semver: https://github.com/pypa/setuptools_scm#version-number-construction +.. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info \ No newline at end of file diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index b657a35cf7ed..92ef93e0079c 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -129,25 +129,60 @@ year = 2007 }""" +# modelled after sys.version_info +_VersionInfo = namedtuple('_VersionInfo', + 'major, minor, micro, releaselevel, serial') -def __getattr__(name): - if name == "__version__": + +def _parse_to_version_info(version_str): + """ + Parse a version string to a namedtuple analogous to sys.version_info. + + See: + https://packaging.pypa.io/en/latest/version.html#packaging.version.parse + https://docs.python.org/3/library/sys.html#sys.version_info + """ + v = parse_version(version_str) + if v.pre is None and v.post is None and v.dev is None: + return _VersionInfo(v.major, v.minor, v.micro, 'final', 0) + elif v.dev is not None: + return _VersionInfo(v.major, v.minor, v.micro, 'alpha', v.dev) + elif v.pre is not None: + releaselevel = { + 'a': 'alpha', + 'b': 'beta', + 'rc': 'candidate'}.get(v.pre[0], 'alpha') + return _VersionInfo(v.major, v.minor, v.micro, releaselevel, v.pre[1]) + else: + # fallback for v.post: guess-next-dev scheme from setuptools_scm + return _VersionInfo(v.major, v.minor, v.micro + 1, 'alpha', v.post) + + +def _get_version(): + """Return the version string used for __version__.""" + # Only shell out to a git subprocess if really needed, and not on a + # shallow clone, such as those used by CI, as the latter would trigger + # a warning from setuptools_scm. + root = Path(__file__).resolve().parents[2] + if (root / ".git").exists() and not (root / ".git/shallow").exists(): import setuptools_scm + return setuptools_scm.get_version( + root=root, + version_scheme="post-release", + local_scheme="node-and-date", + fallback_version=_version.version, + ) + else: # Get the version from the _version.py setuptools_scm file. + return _version.version + + +def __getattr__(name): + if name in ("__version__", "__version_info__"): global __version__ # cache it. - # Only shell out to a git subprocess if really needed, and not on a - # shallow clone, such as those used by CI, as the latter would trigger - # a warning from setuptools_scm. - root = Path(__file__).resolve().parents[2] - if (root / ".git").exists() and not (root / ".git/shallow").exists(): - __version__ = setuptools_scm.get_version( - root=root, - version_scheme="post-release", - local_scheme="node-and-date", - fallback_version=_version.version, - ) - else: # Get the version from the _version.py setuptools_scm file. - __version__ = _version.version - return __version__ + __version__ = _get_version() + global __version__info__ # cache it. + __version_info__ = _parse_to_version_info(__version__) + return __version__ if name == "__version__" else __version_info__ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
diff --git a/lib/matplotlib/tests/test_matplotlib.py b/lib/matplotlib/tests/test_matplotlib.py index cad9433a562e..6f92b4ca0abd 100644 --- a/lib/matplotlib/tests/test_matplotlib.py +++ b/lib/matplotlib/tests/test_matplotlib.py @@ -7,6 +7,16 @@ import matplotlib +@pytest.mark.parametrize('version_str, version_tuple', [ + ('3.5.0', (3, 5, 0, 'final', 0)), + ('3.5.0rc2', (3, 5, 0, 'candidate', 2)), + ('3.5.0.dev820+g6768ef8c4c', (3, 5, 0, 'alpha', 820)), + ('3.5.0.post820+g6768ef8c4c', (3, 5, 1, 'alpha', 820)), +]) +def test_parse_to_version_info(version_str, version_tuple): + assert matplotlib._parse_to_version_info(version_str) == version_tuple + + @pytest.mark.skipif( os.name == "nt", reason="chmod() doesn't work as is on Windows") @pytest.mark.skipif(os.name != "nt" and os.geteuid() == 0,
[ { "path": "doc/users/next_whats_new/version_info.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/version_info.rst", "metadata": "diff --git a/doc/users/next_whats_new/version_info.rst b/doc/users/next_whats_new/version_info.rst\nnew file mode 100644\nindex 000000000000..5c51f9fe7332\n--- /dev/null\n+++ b/doc/users/next_whats_new/version_info.rst\n@@ -0,0 +1,15 @@\n+Version information\n+-------------------\n+We switched to the `release-branch-semver`_ version scheme. This only affects,\n+the version information for development builds. Their version number now\n+describes the targeted release, i.e. 3.5.0.dev820+g6768ef8c4c.d20210520\n+is 820 commits after the previous release and is scheduled to be officially\n+released as 3.5.0 later.\n+\n+In addition to the string ``__version__``, there is now a namedtuple\n+``__version_info__`` as well, which is modelled after `sys.version_info`_.\n+Its primary use is safely comparing version information, e.g.\n+``if __version_info__ >= (3, 4, 2)``.\n+\n+.. _release-branch-semver: https://github.com/pypa/setuptools_scm#version-number-construction\n+.. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info\n\\ No newline at end of file\n" } ]
3.4
b7d05919865fc0c37a0164cf467d5d5513bd0ede
[ "lib/matplotlib/tests/test_matplotlib.py::test_importable_with__OO", "lib/matplotlib/tests/test_matplotlib.py::test_importable_with_no_home", "lib/matplotlib/tests/test_matplotlib.py::test_use_doc_standard_backends" ]
[ "lib/matplotlib/tests/test_matplotlib.py::test_parse_to_version_info[3.5.0.post820+g6768ef8c4c-version_tuple3]", "lib/matplotlib/tests/test_matplotlib.py::test_parse_to_version_info[3.5.0-version_tuple0]", "lib/matplotlib/tests/test_matplotlib.py::test_parse_to_version_info[3.5.0.dev820+g6768ef8c4c-version_tuple2]", "lib/matplotlib/tests/test_matplotlib.py::test_parse_to_version_info[3.5.0rc2-version_tuple1]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [ { "type": "function", "name": "_parse_to_version_info" }, { "type": "field", "name": "_parse_to_version_info" }, { "type": "field", "name": "version_str" } ] }
[ { "path": "doc/users/next_whats_new/version_info.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/version_info.rst", "metadata": "diff --git a/doc/users/next_whats_new/version_info.rst b/doc/users/next_whats_new/version_info.rst\nnew file mode 100644\nindex 000000000000..5c51f9fe7332\n--- /dev/null\n+++ b/doc/users/next_whats_new/version_info.rst\n@@ -0,0 +1,15 @@\n+Version information\n+-------------------\n+We switched to the `release-branch-semver`_ version scheme. This only affects,\n+the version information for development builds. Their version number now\n+describes the targeted release, i.e. 3.5.0.dev820+g6768ef8c4c.d20210520\n+is 820 commits after the previous release and is scheduled to be officially\n+released as 3.5.0 later.\n+\n+In addition to the string ``__version__``, there is now a namedtuple\n+``__version_info__`` as well, which is modelled after `sys.version_info`_.\n+Its primary use is safely comparing version information, e.g.\n+``if __version_info__ >= (3, 4, 2)``.\n+\n+.. _release-branch-semver: https://github.com/pypa/setuptools_scm#version-number-construction\n+.. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info\n\\ No newline at end of file\n" } ]
diff --git a/doc/users/next_whats_new/version_info.rst b/doc/users/next_whats_new/version_info.rst new file mode 100644 index 000000000000..5c51f9fe7332 --- /dev/null +++ b/doc/users/next_whats_new/version_info.rst @@ -0,0 +1,15 @@ +Version information +------------------- +We switched to the `release-branch-semver`_ version scheme. This only affects, +the version information for development builds. Their version number now +describes the targeted release, i.e. 3.5.0.dev820+g6768ef8c4c.d20210520 +is 820 commits after the previous release and is scheduled to be officially +released as 3.5.0 later. + +In addition to the string ``__version__``, there is now a namedtuple +``__version_info__`` as well, which is modelled after `sys.version_info`_. +Its primary use is safely comparing version information, e.g. +``if __version_info__ >= (3, 4, 2)``. + +.. _release-branch-semver: https://github.com/pypa/setuptools_scm#version-number-construction +.. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info \ No newline at end of file If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names: [{'type': 'function', 'name': '_parse_to_version_info'}, {'type': 'field', 'name': '_parse_to_version_info'}, {'type': 'field', 'name': 'version_str'}]
matplotlib/matplotlib
matplotlib__matplotlib-19553
https://github.com/matplotlib/matplotlib/pull/19553
diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst new file mode 100644 index 000000000000..1904a92d2fba --- /dev/null +++ b/doc/users/next_whats_new/callbacks_on_norms.rst @@ -0,0 +1,8 @@ +A callback registry has been added to Normalize objects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`.colors.Normalize` objects now have a callback registry, ``callbacks``, +that can be connected to by other objects to be notified when the norm is +updated. The callback emits the key ``changed`` when the norm is modified. +`.cm.ScalarMappable` is now a listener and will register a change +when the norm's vmin, vmax or other attributes are changed. diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index 0af2f0f327d9..76c1c5d4f7f2 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -337,7 +337,7 @@ def __init__(self, norm=None, cmap=None): The colormap used to map normalized data values to RGBA colors. """ self._A = None - self.norm = None # So that the setter knows we're initializing. + self._norm = None # So that the setter knows we're initializing. self.set_norm(norm) # The Normalize instance of this ScalarMappable. self.cmap = None # So that the setter knows we're initializing. self.set_cmap(cmap) # The Colormap instance of this ScalarMappable. @@ -496,6 +496,8 @@ def set_clim(self, vmin=None, vmax=None): .. ACCEPTS: (vmin: float, vmax: float) """ + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm if vmax is None: try: vmin, vmax = vmin @@ -505,7 +507,6 @@ def set_clim(self, vmin=None, vmax=None): self.norm.vmin = colors._sanitize_extrema(vmin) if vmax is not None: self.norm.vmax = colors._sanitize_extrema(vmax) - self.changed() def get_alpha(self): """ @@ -531,6 +532,30 @@ def set_cmap(self, cmap): if not in_init: self.changed() # Things are not set up properly yet. + @property + def norm(self): + return self._norm + + @norm.setter + def norm(self, norm): + _api.check_isinstance((colors.Normalize, None), norm=norm) + if norm is None: + norm = colors.Normalize() + + if norm is self.norm: + # We aren't updating anything + return + + in_init = self.norm is None + # Remove the current callback and connect to the new one + if not in_init: + self.norm.callbacks.disconnect(self._id_norm) + self._norm = norm + self._id_norm = self.norm.callbacks.connect('changed', + self.changed) + if not in_init: + self.changed() + def set_norm(self, norm): """ Set the normalization instance. @@ -545,13 +570,7 @@ def set_norm(self, norm): the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default. """ - _api.check_isinstance((colors.Normalize, None), norm=norm) - in_init = self.norm is None - if norm is None: - norm = colors.Normalize() self.norm = norm - if not in_init: - self.changed() # Things are not set up properly yet. def autoscale(self): """ @@ -560,8 +579,9 @@ def autoscale(self): """ if self._A is None: raise TypeError('You must first set_array for mappable') + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm self.norm.autoscale(self._A) - self.changed() def autoscale_None(self): """ @@ -570,8 +590,9 @@ def autoscale_None(self): """ if self._A is None: raise TypeError('You must first set_array for mappable') + # If the norm's limits are updated self.changed() will be called + # through the callbacks attached to the norm self.norm.autoscale_None(self._A) - self.changed() def changed(self): """ diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 459b14f6c5a7..9d40ac8e5e9c 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -471,6 +471,7 @@ def __init__(self, ax, mappable=None, *, cmap=None, self.ax.add_collection(self.dividers) self.locator = None + self.minorlocator = None self.formatter = None self.__scale = None # linear, log10 for now. Hopefully more? @@ -1096,7 +1097,7 @@ def _mesh(self): # vmax of the colorbar, not the norm. This allows the situation # where the colormap has a narrower range than the colorbar, to # accommodate extra contours: - norm = copy.copy(self.norm) + norm = copy.deepcopy(self.norm) norm.vmin = self.vmin norm.vmax = self.vmax x = np.array([0.0, 1.0]) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index c5db6117f1bc..58e3fe198498 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1123,10 +1123,50 @@ def __init__(self, vmin=None, vmax=None, clip=False): ----- Returns 0 if ``vmin == vmax``. """ - self.vmin = _sanitize_extrema(vmin) - self.vmax = _sanitize_extrema(vmax) - self.clip = clip - self._scale = None # will default to LinearScale for colorbar + self._vmin = _sanitize_extrema(vmin) + self._vmax = _sanitize_extrema(vmax) + self._clip = clip + self._scale = None + self.callbacks = cbook.CallbackRegistry() + + @property + def vmin(self): + return self._vmin + + @vmin.setter + def vmin(self, value): + value = _sanitize_extrema(value) + if value != self._vmin: + self._vmin = value + self._changed() + + @property + def vmax(self): + return self._vmax + + @vmax.setter + def vmax(self, value): + value = _sanitize_extrema(value) + if value != self._vmax: + self._vmax = value + self._changed() + + @property + def clip(self): + return self._clip + + @clip.setter + def clip(self, value): + if value != self._clip: + self._clip = value + self._changed() + + def _changed(self): + """ + Call this whenever the norm is changed to notify all the + callback listeners to the 'changed' signal. + """ + self.callbacks.process('changed') @staticmethod def process_value(value): @@ -1273,7 +1313,7 @@ def __init__(self, vcenter, vmin=None, vmax=None): """ super().__init__(vmin=vmin, vmax=vmax) - self.vcenter = vcenter + self._vcenter = vcenter if vcenter is not None and vmax is not None and vcenter >= vmax: raise ValueError('vmin, vcenter, and vmax must be in ' 'ascending order') @@ -1281,6 +1321,16 @@ def __init__(self, vcenter, vmin=None, vmax=None): raise ValueError('vmin, vcenter, and vmax must be in ' 'ascending order') + @property + def vcenter(self): + return self._vcenter + + @vcenter.setter + def vcenter(self, value): + if value != self._vcenter: + self._vcenter = value + self._changed() + def autoscale_None(self, A): """ Get vmin and vmax, and then clip at vcenter @@ -1387,7 +1437,9 @@ def vcenter(self): @vcenter.setter def vcenter(self, vcenter): - self._vcenter = vcenter + if vcenter != self._vcenter: + self._vcenter = vcenter + self._changed() if self.vmax is not None: # recompute halfrange assuming vmin and vmax represent # min and max of data diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 7dec80943993..4d124ce8c57c 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1090,6 +1090,15 @@ def _make_paths(self, segs, kinds): in zip(segs, kinds)] def changed(self): + if not hasattr(self, "cvalues"): + # Just return after calling the super() changed function + cm.ScalarMappable.changed(self) + return + # Force an autoscale immediately because self.to_rgba() calls + # autoscale_None() internally with the data passed to it, + # so if vmin/vmax are not set yet, this would override them with + # content from *cvalues* rather than levels like we want + self.norm.autoscale_None(self.levels) tcolors = [(tuple(rgba),) for rgba in self.to_rgba(self.cvalues, alpha=self.alpha)] self.tcolors = tcolors diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index ca5b7da5f808..2036bf7e17c9 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -537,11 +537,14 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0, if isinstance(self.norm, mcolors.LogNorm) and s_vmin <= 0: # Don't give 0 or negative values to LogNorm s_vmin = np.finfo(scaled_dtype).eps - with cbook._setattr_cm(self.norm, - vmin=s_vmin, - vmax=s_vmax, - ): - output = self.norm(resampled_masked) + # Block the norm from sending an update signal during the + # temporary vmin/vmax change + with self.norm.callbacks.blocked(): + with cbook._setattr_cm(self.norm, + vmin=s_vmin, + vmax=s_vmax, + ): + output = self.norm(resampled_masked) else: if A.ndim == 2: # _interpolation_stage == 'rgba' self.norm.autoscale_None(A)
diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py index ae004e957591..bf89a3a82364 100644 --- a/lib/matplotlib/tests/test_colors.py +++ b/lib/matplotlib/tests/test_colors.py @@ -1,5 +1,6 @@ import copy import itertools +import unittest.mock from io import BytesIO import numpy as np @@ -17,7 +18,7 @@ import matplotlib.cbook as cbook import matplotlib.pyplot as plt import matplotlib.scale as mscale -from matplotlib.testing.decorators import image_comparison +from matplotlib.testing.decorators import image_comparison, check_figures_equal @pytest.mark.parametrize('N, result', [ @@ -1408,3 +1409,69 @@ def test_norm_deepcopy(): norm2 = copy.deepcopy(norm) assert norm2._scale is None assert norm2.vmin == norm.vmin + + +def test_norm_callback(): + increment = unittest.mock.Mock(return_value=None) + + norm = mcolors.Normalize() + norm.callbacks.connect('changed', increment) + # Haven't updated anything, so call count should be 0 + assert increment.call_count == 0 + + # Now change vmin and vmax to test callbacks + norm.vmin = 1 + assert increment.call_count == 1 + norm.vmax = 5 + assert increment.call_count == 2 + # callback shouldn't be called if setting to the same value + norm.vmin = 1 + assert increment.call_count == 2 + norm.vmax = 5 + assert increment.call_count == 2 + + +def test_scalarmappable_norm_update(): + norm = mcolors.Normalize() + sm = matplotlib.cm.ScalarMappable(norm=norm, cmap='plasma') + # sm doesn't have a stale attribute at first, set it to False + sm.stale = False + # The mappable should be stale after updating vmin/vmax + norm.vmin = 5 + assert sm.stale + sm.stale = False + norm.vmax = 5 + assert sm.stale + sm.stale = False + norm.clip = True + assert sm.stale + # change to the CenteredNorm and TwoSlopeNorm to test those + # Also make sure that updating the norm directly and with + # set_norm both update the Norm callback + norm = mcolors.CenteredNorm() + sm.norm = norm + sm.stale = False + norm.vcenter = 1 + assert sm.stale + norm = mcolors.TwoSlopeNorm(vcenter=0, vmin=-1, vmax=1) + sm.set_norm(norm) + sm.stale = False + norm.vcenter = 1 + assert sm.stale + + +@check_figures_equal() +def test_norm_update_figs(fig_test, fig_ref): + ax_ref = fig_ref.add_subplot() + ax_test = fig_test.add_subplot() + + z = np.arange(100).reshape((10, 10)) + ax_ref.imshow(z, norm=mcolors.Normalize(10, 90)) + + # Create the norm beforehand with different limits and then update + # after adding to the plot + norm = mcolors.Normalize(0, 1) + ax_test.imshow(z, norm=norm) + # Force initial draw to make sure it isn't already stale + fig_test.canvas.draw() + norm.vmin, norm.vmax = 10, 90 diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index 37dddd4e4706..2e7fae6c58d8 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -1017,8 +1017,8 @@ def test_imshow_bool(): def test_full_invalid(): fig, ax = plt.subplots() ax.imshow(np.full((10, 10), np.nan)) - with pytest.warns(UserWarning): - fig.canvas.draw() + + fig.canvas.draw() @pytest.mark.parametrize("fmt,counted",
[ { "path": "doc/users/next_whats_new/callbacks_on_norms.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callbacks_on_norms.rst", "metadata": "diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst\nnew file mode 100644\nindex 000000000000..1904a92d2fba\n--- /dev/null\n+++ b/doc/users/next_whats_new/callbacks_on_norms.rst\n@@ -0,0 +1,8 @@\n+A callback registry has been added to Normalize objects\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+`.colors.Normalize` objects now have a callback registry, ``callbacks``,\n+that can be connected to by other objects to be notified when the norm is\n+updated. The callback emits the key ``changed`` when the norm is modified.\n+`.cm.ScalarMappable` is now a listener and will register a change\n+when the norm's vmin, vmax or other attributes are changed.\n" } ]
3.4
ca275dca26d746fb1ce59a16e8c0f7db42d6813a
[ "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues]", "lib/matplotlib/tests/test_image.py::test_load_from_url", "lib/matplotlib/tests/test_image.py::test_composite[False-2-ps- colorimage]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminGTVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic]", "lib/matplotlib/tests/test_colors.py::test_conversions", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_alpha_array", "lib/matplotlib/tests/test_colors.py::test_LogNorm", "lib/matplotlib/tests/test_image.py::test_image_alpha[pdf]", "lib/matplotlib/tests/test_image.py::test_image_cursor_formatting", "lib/matplotlib/tests/test_colors.py::test_colormap_equals", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VcenterGTVmax", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[pdf]", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[png]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_empty_mask", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm]", "lib/matplotlib/tests/test_colors.py::test_cn", "lib/matplotlib/tests/test_image.py::test_axesimage_setdata", "lib/matplotlib/tests/test_image.py::test_image_clip[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Even", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges]", "lib/matplotlib/tests/test_colors.py::test_pandas_iterable", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2_r]", "lib/matplotlib/tests/test_image.py::test_imshow_float128", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot_r]", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[pdf]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center", "lib/matplotlib/tests/test_image.py::test_imsave[png]", "lib/matplotlib/tests/test_image.py::test_imshow[png]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[<lambda>1]", "lib/matplotlib/tests/test_colors.py::test_light_source_planar_hillshading", "lib/matplotlib/tests/test_image.py::test_rotate_image[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno_r]", "lib/matplotlib/tests/test_colors.py::test_BoundaryNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-10-nearest]", "lib/matplotlib/tests/test_image.py::test_imshow_pil[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cubehelix_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap_r]", "lib/matplotlib/tests/test_image.py::test_imread_pil_uint16", "lib/matplotlib/tests/test_image.py::test_jpeg_2d", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_shifted]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[coolwarm_r]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[png]", "lib/matplotlib/tests/test_image.py::test_spy_box[pdf]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[1-result2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG]", "lib/matplotlib/tests/test_image.py::test_imsave_pil_kwargs_tiff", "lib/matplotlib/tests/test_colors.py::test_FuncNorm", "lib/matplotlib/tests/test_image.py::test_figimage[png-True]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3]", "lib/matplotlib/tests/test_colors.py::test_Normalize", "lib/matplotlib/tests/test_image.py::test_imshow_bignumbers[png]", "lib/matplotlib/tests/test_image.py::test_spy_box[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c]", "lib/matplotlib/tests/test_image.py::test_imshow_pil[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow_r]", "lib/matplotlib/tests/test_image.py::test_imshow_endianess[png]", "lib/matplotlib/tests/test_image.py::test_imsave[tiff]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VmaxEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[magma_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_copy", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-3-9.1-nearest]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_VminEqualsVcenter", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scale", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[svg]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[2-result1]", "lib/matplotlib/tests/test_colors.py::test_light_source_hillshading", "lib/matplotlib/tests/test_image.py::test_mask_image[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype1]", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_5", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn]", "lib/matplotlib/tests/test_image.py::test_bbox_image_inverted[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG]", "lib/matplotlib/tests/test_colors.py::test_norm_deepcopy", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm", "lib/matplotlib/tests/test_image.py::test_norm_change[png]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[Normalize]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Oranges_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn]", "lib/matplotlib/tests/test_image.py::test_cursor_data", "lib/matplotlib/tests/test_image.py::test_unclipped", "lib/matplotlib/tests/test_image.py::test_nonuniformimage_setnorm", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmax", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain_r]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlGn_r]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[5-result0]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype3]", "lib/matplotlib/tests/test_image.py::test_huge_range_log[png--1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[copper]", "lib/matplotlib/tests/test_image.py::test_format_cursor_data[data1-[0.123]-[0.123]]", "lib/matplotlib/tests/test_image.py::test_imsave_pil_kwargs_png", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia]", "lib/matplotlib/tests/test_colors.py::test_double_register_builtin_cmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PRGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[seismic_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg_r]", "lib/matplotlib/tests/test_image.py::test_zoom_and_clip_upper_origin[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20_r]", "lib/matplotlib/tests/test_colors.py::test_resample", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[winter]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[binary]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_dict_deprecate", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth]", "lib/matplotlib/tests/test_image.py::test_exact_vmin", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGn]", "lib/matplotlib/tests/test_image.py::test_image_interps[pdf]", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_single_str", "lib/matplotlib/tests/test_image.py::test_full_invalid", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_earth_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr_r]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_TwoSlopeNorm_VminGTVmax", "lib/matplotlib/tests/test_image.py::test_imshow_zoom[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cool]", "lib/matplotlib/tests/test_image.py::test_figimage[pdf-True]", "lib/matplotlib/tests/test_image.py::test_imshow_no_warn_invalid", "lib/matplotlib/tests/test_image.py::test_huge_range_log[png-1]", "lib/matplotlib/tests/test_colors.py::test_colormap_endian", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu_r]", "lib/matplotlib/tests/test_image.py::test_setdata_xya[PcolorImage-x1-y1-a1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BrBG_r]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_single_zero", "lib/matplotlib/tests/test_image.py::test_imshow_float16", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Wistia_r]", "lib/matplotlib/tests/test_image.py::test_image_preserve_size2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu_r]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha_validation", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[GnBu]", "lib/matplotlib/tests/test_colors.py::test_tableau_order", "lib/matplotlib/tests/test_image.py::test_spy_box[svg]", "lib/matplotlib/tests/test_colors.py::test_light_source_topo_surface[png]", "lib/matplotlib/tests/test_colors.py::test_rgb_hsv_round_trip", "lib/matplotlib/tests/test_colors.py::test_grey_gray", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[summer_r]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[eps]", "lib/matplotlib/tests/test_colors.py::test_colormap_bad_data_with_alpha", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds]", "lib/matplotlib/tests/test_colors.py::test_set_dict_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples]", "lib/matplotlib/tests/test_colors.py::test_PowerNorm_translation_invariance", "lib/matplotlib/tests/test_colors.py::test_colormap_return_types", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[terrain]", "lib/matplotlib/tests/test_image.py::test_image_shift[pdf]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_scaleout_center_max", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[pink]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel1_r]", "lib/matplotlib/tests/test_colors.py::test_same_color", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Purples_r]", "lib/matplotlib/tests/test_image.py::test_alpha_interp[png]", "lib/matplotlib/tests/test_colors.py::test_autoscale_masked", "lib/matplotlib/tests/test_image.py::test_figimage[pdf-False]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu_r]", "lib/matplotlib/tests/test_image.py::test_imshow[svg]", "lib/matplotlib/tests/test_colors.py::test_CenteredNorm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBuGn]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale_None_vmin", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[png]", "lib/matplotlib/tests/test_colors.py::test_repr_html", "lib/matplotlib/tests/test_image.py::test_imshow_masked_interpolation[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[nipy_spectral_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[jet_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20c_r]", "lib/matplotlib/tests/test_image.py::test_image_composite_background[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv]", "lib/matplotlib/tests/test_colors.py::test_2d_to_rgba", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray]", "lib/matplotlib/tests/test_colors.py::test_LogNorm_inverse", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[png]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[svg]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype4]", "lib/matplotlib/tests/test_image.py::test_image_alpha[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuOr]", "lib/matplotlib/tests/test_image.py::test_format_cursor_data[data0-[1e+04]-[10001]]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_Odd", "lib/matplotlib/tests/test_image.py::test_image_interps[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bwr]", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlGnBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[turbo]", "lib/matplotlib/tests/test_colors.py::test_repr_png", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hsv_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[pdf]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype5]", "lib/matplotlib/tests/test_image.py::test_no_interpolation_origin[pdf]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[ps]", "lib/matplotlib/tests/test_colors.py::test_SymLogNorm_colorbar", "lib/matplotlib/tests/test_colors.py::test_ndarray_subclass_norm", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma_r]", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[3-1]", "lib/matplotlib/tests/test_colors.py::test_colormap_invalid", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[plasma]", "lib/matplotlib/tests/test_image.py::test_image_cliprect[svg]", "lib/matplotlib/tests/test_colors.py::test_color_names", "lib/matplotlib/tests/test_image.py::test_rasterize_dpi[svg]", "lib/matplotlib/tests/test_image.py::test_mask_image[png]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype0]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent_r]", "lib/matplotlib/tests/test_colors.py::test_register_cmap", "lib/matplotlib/tests/test_image.py::test_imshow_pil[png]", "lib/matplotlib/tests/test_image.py::test_imshow_flatfield[png]", "lib/matplotlib/tests/test_image.py::test_imread_fspath", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_rainbow]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuGn]", "lib/matplotlib/tests/test_colors.py::test_failed_conversions", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2_r]", "lib/matplotlib/tests/test_image.py::test_log_scale_image[svg]", "lib/matplotlib/tests/test_image.py::test_composite[True-1-svg-<image]", "lib/matplotlib/tests/test_image.py::test_composite[True-1-ps- colorimage]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean_r]", "lib/matplotlib/tests/test_image.py::test_bbox_image_inverted[svg]", "lib/matplotlib/tests/test_colors.py::test_light_source_shading_default", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[BuPu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greys]", "lib/matplotlib/tests/test_image.py::test_image_clip[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[svg]", "lib/matplotlib/tests/test_image.py::test_minimized_rasterized", "lib/matplotlib/tests/test_colors.py::test_light_source_masked_shading", "lib/matplotlib/tests/test_image.py::test_https_imread_smoketest", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrBr]", "lib/matplotlib/tests/test_image.py::test_clip_path_disables_compositing[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set3_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Paired]", "lib/matplotlib/tests/test_image.py::test_image_composite_background[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[prism]", "lib/matplotlib/tests/test_colors.py::test_colormap_global_set_warn", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Blues_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_stern]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_gray_r]", "lib/matplotlib/tests/test_image.py::test_imsave[jpg]", "lib/matplotlib/tests/test_image.py::test_figimage[png-False]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[twilight_r]", "lib/matplotlib/tests/test_image.py::test_mask_image_all", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Pastel2]", "lib/matplotlib/tests/test_image.py::test_image_array_alpha[png]", "lib/matplotlib/tests/test_image.py::test_get_window_extent_for_AxisImage", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[autumn]", "lib/matplotlib/tests/test_colors.py::test_conversions_masked", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_ncar]", "lib/matplotlib/tests/test_image.py::test_respects_bbox", "lib/matplotlib/tests/test_colors.py::test_boundarynorm_and_colorbarbase[png]", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_premature_scaling", "lib/matplotlib/tests/test_image.py::test_empty_imshow[LogNorm]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdPu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Dark2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab20b]", "lib/matplotlib/tests/test_colors.py::test_get_under_over_bad", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[bad]", "lib/matplotlib/tests/test_image.py::test_image_alpha[png]", "lib/matplotlib/tests/test_colors.py::test_norm_update_figs[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot_r]", "lib/matplotlib/tests/test_image.py::test_image_cliprect[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[viridis_r]", "lib/matplotlib/tests/test_image.py::test_rotate_image[pdf]", "lib/matplotlib/tests/test_image.py::test_imsave_color_alpha", "lib/matplotlib/tests/test_colors.py::test_TwoSlopeNorm_autoscale", "lib/matplotlib/tests/test_image.py::test_relim", "lib/matplotlib/tests/test_image.py::test_rotate_image[png]", "lib/matplotlib/tests/test_colors.py::test_lognorm_invalid[-1-2]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set2]", "lib/matplotlib/tests/test_image.py::test_image_composite_alpha[svg]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-5-nearest]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdYlBu]", "lib/matplotlib/tests/test_colors.py::test_hex_shorthand_notation", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-5-2-hanning]", "lib/matplotlib/tests/test_image.py::test_mask_image_over_under[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuBu]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[afmhot]", "lib/matplotlib/tests/test_image.py::test_image_shift[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[spring_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Greens]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[brg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Set1_r]", "lib/matplotlib/tests/test_image.py::test_image_preserve_size", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Accent]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[inferno]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[OrRd]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype6]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PiYG_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gnuplot2_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gray]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[bone_r]", "lib/matplotlib/tests/test_image.py::test_jpeg_alpha", "lib/matplotlib/tests/test_image.py::test_setdata_xya[NonUniformImage-x0-y0-a0]", "lib/matplotlib/tests/test_image.py::test_imshow_bignumbers_real[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[RdGy]", "lib/matplotlib/tests/test_image.py::test_nonuniform_and_pcolor[png]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[flag]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Reds_r]", "lib/matplotlib/tests/test_colors.py::test_cmap_and_norm_from_levels_and_colors[png]", "lib/matplotlib/tests/test_image.py::test_interp_nearest_vs_none[svg]", "lib/matplotlib/tests/test_colors.py::test_colormap_alpha_array", "lib/matplotlib/tests/test_image.py::test_imshow[pdf]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[Spectral_r]", "lib/matplotlib/tests/test_image.py::test_imshow_clips_rgb_to_valid_range[dtype2]", "lib/matplotlib/tests/test_image.py::test_image_python_io", "lib/matplotlib/tests/test_image.py::test_image_interps[svg]", "lib/matplotlib/tests/test_image.py::test_quantitynd", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_2", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[tab10]", "lib/matplotlib/tests/test_image.py::test_imsave_fspath[pdf]", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[over]", "lib/matplotlib/tests/test_image.py::test_empty_imshow[<lambda>0]", "lib/matplotlib/tests/test_image.py::test_imshow_antialiased[png-3-2.9-hanning]", "lib/matplotlib/tests/test_image.py::test_rgba_antialias[png]", "lib/matplotlib/tests/test_image.py::test_image_edges", "lib/matplotlib/tests/test_colors.py::test_non_mutable_get_values[under]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[rainbow_r]", "lib/matplotlib/tests/test_image.py::test_imshow_10_10_1[png]", "lib/matplotlib/tests/test_colors.py::test_unregister_builtin_cmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_yarg]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[hot_r]", "lib/matplotlib/tests/test_image.py::test_composite[False-2-svg-<image]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[gist_heat]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[PuRd]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[cividis_r]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[CMRmap]", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[ocean]", "lib/matplotlib/tests/test_image.py::test_imsave[jpeg]", "lib/matplotlib/tests/test_image.py::test_imshow_bool", "lib/matplotlib/tests/test_image.py::test_nonuniformimage_setcmap", "lib/matplotlib/tests/test_colors.py::test_colormap_reversing[YlOrRd_r]", "lib/matplotlib/tests/test_image.py::test_figureimage_setdata" ]
[ "lib/matplotlib/tests/test_colors.py::test_norm_callback", "lib/matplotlib/tests/test_colors.py::test_scalarmappable_norm_update" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/callbacks_on_norms.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/callbacks_on_norms.rst", "metadata": "diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst\nnew file mode 100644\nindex 000000000000..1904a92d2fba\n--- /dev/null\n+++ b/doc/users/next_whats_new/callbacks_on_norms.rst\n@@ -0,0 +1,8 @@\n+A callback registry has been added to Normalize objects\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+`.colors.Normalize` objects now have a callback registry, ``callbacks``,\n+that can be connected to by other objects to be notified when the norm is\n+updated. The callback emits the key ``changed`` when the norm is modified.\n+`.cm.ScalarMappable` is now a listener and will register a change\n+when the norm's vmin, vmax or other attributes are changed.\n" } ]
diff --git a/doc/users/next_whats_new/callbacks_on_norms.rst b/doc/users/next_whats_new/callbacks_on_norms.rst new file mode 100644 index 000000000000..1904a92d2fba --- /dev/null +++ b/doc/users/next_whats_new/callbacks_on_norms.rst @@ -0,0 +1,8 @@ +A callback registry has been added to Normalize objects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`.colors.Normalize` objects now have a callback registry, ``callbacks``, +that can be connected to by other objects to be notified when the norm is +updated. The callback emits the key ``changed`` when the norm is modified. +`.cm.ScalarMappable` is now a listener and will register a change +when the norm's vmin, vmax or other attributes are changed.
matplotlib/matplotlib
matplotlib__matplotlib-19743
https://github.com/matplotlib/matplotlib/pull/19743
diff --git a/doc/users/next_whats_new/legend-figure-outside.rst b/doc/users/next_whats_new/legend-figure-outside.rst new file mode 100644 index 000000000000..a78725b4e2b6 --- /dev/null +++ b/doc/users/next_whats_new/legend-figure-outside.rst @@ -0,0 +1,8 @@ +Figure legends can be placed outside figures using constrained_layout +--------------------------------------------------------------------- +Constrained layout will make space for Figure legends if they are specified +by a *loc* keyword argument that starts with the string "outside". The +codes are unique from axes codes, in that "outside upper right" will +make room at the top of the figure for the legend, whereas +"outside right upper" will make room on the right-hand side of the figure. +See :doc:`/tutorials/intermediate/legend_guide` for details. diff --git a/examples/text_labels_and_annotations/figlegend_demo.py b/examples/text_labels_and_annotations/figlegend_demo.py index 6fc31235f634..c749ae795cd5 100644 --- a/examples/text_labels_and_annotations/figlegend_demo.py +++ b/examples/text_labels_and_annotations/figlegend_demo.py @@ -28,3 +28,26 @@ plt.tight_layout() plt.show() + +############################################################################## +# Sometimes we do not want the legend to overlap the axes. If you use +# constrained_layout you can specify "outside right upper", and +# constrained_layout will make room for the legend. + +fig, axs = plt.subplots(1, 2, layout='constrained') + +x = np.arange(0.0, 2.0, 0.02) +y1 = np.sin(2 * np.pi * x) +y2 = np.exp(-x) +l1, = axs[0].plot(x, y1) +l2, = axs[0].plot(x, y2, marker='o') + +y3 = np.sin(4 * np.pi * x) +y4 = np.exp(-2 * x) +l3, = axs[1].plot(x, y3, color='tab:green') +l4, = axs[1].plot(x, y4, color='tab:red', marker='^') + +fig.legend((l1, l2), ('Line 1', 'Line 2'), loc='upper left') +fig.legend((l3, l4), ('Line 3', 'Line 4'), loc='outside right upper') + +plt.show() diff --git a/lib/matplotlib/_constrained_layout.py b/lib/matplotlib/_constrained_layout.py index 996603300620..9554a156f1ec 100644 --- a/lib/matplotlib/_constrained_layout.py +++ b/lib/matplotlib/_constrained_layout.py @@ -418,6 +418,25 @@ def make_layout_margins(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0, # pass the new margins down to the layout grid for the solution... layoutgrids[gs].edit_outer_margin_mins(margin, ss) + # make margins for figure-level legends: + for leg in fig.legends: + inv_trans_fig = None + if leg._outside_loc and leg._bbox_to_anchor is None: + if inv_trans_fig is None: + inv_trans_fig = fig.transFigure.inverted().transform_bbox + bbox = inv_trans_fig(leg.get_tightbbox(renderer)) + w = bbox.width + 2 * w_pad + h = bbox.height + 2 * h_pad + legendloc = leg._outside_loc + if legendloc == 'lower': + layoutgrids[fig].edit_margin_min('bottom', h) + elif legendloc == 'upper': + layoutgrids[fig].edit_margin_min('top', h) + if legendloc == 'right': + layoutgrids[fig].edit_margin_min('right', w) + elif legendloc == 'left': + layoutgrids[fig].edit_margin_min('left', w) + def make_margin_suptitles(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0): # Figure out how large the suptitle is and make the diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 58d95912665b..399a79e05cfe 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -294,7 +294,7 @@ def legend(self, *args, **kwargs): Other Parameters ---------------- - %(_legend_kw_doc)s + %(_legend_kw_axes)s See Also -------- diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index b006ca467be1..30e117183176 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1085,7 +1085,8 @@ def legend(self, *args, **kwargs): Other Parameters ---------------- - %(_legend_kw_doc)s + %(_legend_kw_figure)s + See Also -------- diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 66182c68cb60..e9e0651066b3 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -94,51 +94,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas): self.legend.set_bbox_to_anchor(loc_in_bbox) -_docstring.interpd.update(_legend_kw_doc=""" -loc : str or pair of floats, default: :rc:`legend.loc` ('best' for axes, \ -'upper right' for figures) - The location of the legend. - - The strings - ``'upper left', 'upper right', 'lower left', 'lower right'`` - place the legend at the corresponding corner of the axes/figure. - - The strings - ``'upper center', 'lower center', 'center left', 'center right'`` - place the legend at the center of the corresponding edge of the - axes/figure. - - The string ``'center'`` places the legend at the center of the axes/figure. - - The string ``'best'`` places the legend at the location, among the nine - locations defined so far, with the minimum overlap with other drawn - artists. This option can be quite slow for plots with large amounts of - data; your plotting speed may benefit from providing a specific location. - - The location can also be a 2-tuple giving the coordinates of the lower-left - corner of the legend in axes coordinates (in which case *bbox_to_anchor* - will be ignored). - - For back-compatibility, ``'center right'`` (but no other location) can also - be spelled ``'right'``, and each "string" locations can also be given as a - numeric value: - - =============== ============= - Location String Location Code - =============== ============= - 'best' 0 - 'upper right' 1 - 'upper left' 2 - 'lower left' 3 - 'lower right' 4 - 'right' 5 - 'center left' 6 - 'center right' 7 - 'lower center' 8 - 'upper center' 9 - 'center' 10 - =============== ============= - +_legend_kw_doc_base = """ bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to `.Axes.legend`) or @@ -295,7 +251,79 @@ def _update_bbox_to_anchor(self, loc_in_canvas): draggable : bool, default: False Whether the legend can be dragged with the mouse. -""") +""" + +_loc_doc_base = """ +loc : str or pair of floats, {0} + The location of the legend. + + The strings + ``'upper left', 'upper right', 'lower left', 'lower right'`` + place the legend at the corresponding corner of the axes/figure. + + The strings + ``'upper center', 'lower center', 'center left', 'center right'`` + place the legend at the center of the corresponding edge of the + axes/figure. + + The string ``'center'`` places the legend at the center of the axes/figure. + + The string ``'best'`` places the legend at the location, among the nine + locations defined so far, with the minimum overlap with other drawn + artists. This option can be quite slow for plots with large amounts of + data; your plotting speed may benefit from providing a specific location. + + The location can also be a 2-tuple giving the coordinates of the lower-left + corner of the legend in axes coordinates (in which case *bbox_to_anchor* + will be ignored). + + For back-compatibility, ``'center right'`` (but no other location) can also + be spelled ``'right'``, and each "string" locations can also be given as a + numeric value: + + =============== ============= + Location String Location Code + =============== ============= + 'best' 0 + 'upper right' 1 + 'upper left' 2 + 'lower left' 3 + 'lower right' 4 + 'right' 5 + 'center left' 6 + 'center right' 7 + 'lower center' 8 + 'upper center' 9 + 'center' 10 + =============== ============= + {1}""" + +_legend_kw_axes_st = (_loc_doc_base.format("default: :rc:`legend.loc`", '') + + _legend_kw_doc_base) +_docstring.interpd.update(_legend_kw_axes=_legend_kw_axes_st) + +_outside_doc = """ + If a figure is using the constrained layout manager, the string codes + of the *loc* keyword argument can get better layout behaviour using the + prefix 'outside'. There is ambiguity at the corners, so 'outside + upper right' will make space for the legend above the rest of the + axes in the layout, and 'outside right upper' will make space on the + right side of the layout. In addition to the values of *loc* + listed above, we have 'outside right upper', 'outside right lower', + 'outside left upper', and 'outside left lower'. See + :doc:`/tutorials/intermediate/legend_guide` for more details. +""" + +_legend_kw_figure_st = (_loc_doc_base.format("default: 'upper right'", + _outside_doc) + + _legend_kw_doc_base) +_docstring.interpd.update(_legend_kw_figure=_legend_kw_figure_st) + +_legend_kw_both_st = ( + _loc_doc_base.format("default: 'best' for axes, 'upper right' for figures", + _outside_doc) + + _legend_kw_doc_base) +_docstring.interpd.update(_legend_kw_doc=_legend_kw_both_st) class Legend(Artist): @@ -482,13 +510,37 @@ def val_or_rc(val, rc_name): ) self.parent = parent + loc0 = loc self._loc_used_default = loc is None if loc is None: loc = mpl.rcParams["legend.loc"] if not self.isaxes and loc in [0, 'best']: loc = 'upper right' + + # handle outside legends: + self._outside_loc = None if isinstance(loc, str): + if loc.split()[0] == 'outside': + # strip outside: + loc = loc.split('outside ')[1] + # strip "center" at the beginning + self._outside_loc = loc.replace('center ', '') + # strip first + self._outside_loc = self._outside_loc.split()[0] + locs = loc.split() + if len(locs) > 1 and locs[0] in ('right', 'left'): + # locs doesn't accept "left upper", etc, so swap + if locs[0] != 'center': + locs = locs[::-1] + loc = locs[0] + ' ' + locs[1] + # check that loc is in acceptable strings loc = _api.check_getitem(self.codes, loc=loc) + + if self.isaxes and self._outside_loc: + raise ValueError( + f"'outside' option for loc='{loc0}' keyword argument only " + "works for figure legends") + if not self.isaxes and loc == 0: raise ValueError( "Automatic legend placement (loc='best') not implemented for " diff --git a/tutorials/intermediate/legend_guide.py b/tutorials/intermediate/legend_guide.py index 596d6df93b55..338fca72fbf1 100644 --- a/tutorials/intermediate/legend_guide.py +++ b/tutorials/intermediate/legend_guide.py @@ -135,7 +135,54 @@ ax_dict['bottom'].legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0.) -plt.show() +############################################################################## +# Figure legends +# -------------- +# +# Sometimes it makes more sense to place a legend relative to the (sub)figure +# rather than individual Axes. By using ``constrained_layout`` and +# specifying "outside" at the beginning of the *loc* keyword argument, +# the legend is drawn outside the Axes on the (sub)figure. + +fig, axs = plt.subplot_mosaic([['left', 'right']], layout='constrained') + +axs['left'].plot([1, 2, 3], label="test1") +axs['left'].plot([3, 2, 1], label="test2") + +axs['right'].plot([1, 2, 3], 'C2', label="test3") +axs['right'].plot([3, 2, 1], 'C3', label="test4") +# Place a legend to the right of this smaller subplot. +fig.legend(loc='outside upper right') + +############################################################################## +# This accepts a slightly different grammar than the normal *loc* keyword, +# where "outside right upper" is different from "outside upper right". +# +ucl = ['upper', 'center', 'lower'] +lcr = ['left', 'center', 'right'] +fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.7') + +ax.plot([1, 2], [1, 2], label='TEST') +# Place a legend to the right of this smaller subplot. +for loc in [ + 'outside upper left', + 'outside upper center', + 'outside upper right', + 'outside lower left', + 'outside lower center', + 'outside lower right']: + fig.legend(loc=loc, title=loc) + +fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.7') +ax.plot([1, 2], [1, 2], label='test') + +for loc in [ + 'outside left upper', + 'outside right upper', + 'outside left lower', + 'outside right lower']: + fig.legend(loc=loc, title=loc) + ############################################################################### # Multiple legends on the same Axes
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index 56794a3428b8..a8d7fd107d8b 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -4,6 +4,7 @@ import warnings import numpy as np +from numpy.testing import assert_allclose import pytest from matplotlib.testing.decorators import check_figures_equal, image_comparison @@ -18,7 +19,6 @@ import matplotlib.legend as mlegend from matplotlib import rc_context from matplotlib.font_manager import FontProperties -from numpy.testing import assert_allclose def test_legend_ordereddict(): @@ -486,6 +486,47 @@ def test_warn_args_kwargs(self): "be discarded.") +def test_figure_legend_outside(): + todos = ['upper ' + pos for pos in ['left', 'center', 'right']] + todos += ['lower ' + pos for pos in ['left', 'center', 'right']] + todos += ['left ' + pos for pos in ['lower', 'center', 'upper']] + todos += ['right ' + pos for pos in ['lower', 'center', 'upper']] + + upperext = [20.347556, 27.722556, 790.583, 545.499] + lowerext = [20.347556, 71.056556, 790.583, 588.833] + leftext = [151.681556, 27.722556, 790.583, 588.833] + rightext = [20.347556, 27.722556, 659.249, 588.833] + axbb = [upperext, upperext, upperext, + lowerext, lowerext, lowerext, + leftext, leftext, leftext, + rightext, rightext, rightext] + + legbb = [[10., 555., 133., 590.], # upper left + [338.5, 555., 461.5, 590.], # upper center + [667, 555., 790., 590.], # upper right + [10., 10., 133., 45.], # lower left + [338.5, 10., 461.5, 45.], # lower center + [667., 10., 790., 45.], # lower right + [10., 10., 133., 45.], # left lower + [10., 282.5, 133., 317.5], # left center + [10., 555., 133., 590.], # left upper + [667, 10., 790., 45.], # right lower + [667., 282.5, 790., 317.5], # right center + [667., 555., 790., 590.]] # right upper + + for nn, todo in enumerate(todos): + print(todo) + fig, axs = plt.subplots(constrained_layout=True, dpi=100) + axs.plot(range(10), label='Boo1') + leg = fig.legend(loc='outside ' + todo) + fig.draw_without_rendering() + + assert_allclose(axs.get_window_extent().extents, + axbb[nn]) + assert_allclose(leg.get_window_extent().extents, + legbb[nn]) + + @image_comparison(['legend_stackplot.png']) def test_legend_stackplot(): """Test legend for PolyCollection using stackplot."""
[ { "path": "doc/users/next_whats_new/legend-figure-outside.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/legend-figure-outside.rst", "metadata": "diff --git a/doc/users/next_whats_new/legend-figure-outside.rst b/doc/users/next_whats_new/legend-figure-outside.rst\nnew file mode 100644\nindex 000000000000..a78725b4e2b6\n--- /dev/null\n+++ b/doc/users/next_whats_new/legend-figure-outside.rst\n@@ -0,0 +1,8 @@\n+Figure legends can be placed outside figures using constrained_layout\n+---------------------------------------------------------------------\n+Constrained layout will make space for Figure legends if they are specified\n+by a *loc* keyword argument that starts with the string \"outside\". The\n+codes are unique from axes codes, in that \"outside upper right\" will\n+make room at the top of the figure for the legend, whereas\n+\"outside right upper\" will make room on the right-hand side of the figure.\n+See :doc:`/tutorials/intermediate/legend_guide` for details.\n" } ]
3.5
5793ebb2201bf778f08ac1d4cd0b8dd674c96053
[ "lib/matplotlib/tests/test_legend.py::test_legend_auto1[png]", "lib/matplotlib/tests/test_legend.py::test_framealpha[png]", "lib/matplotlib/tests/test_legend.py::test_alpha_rcparam[png]", "lib/matplotlib/tests/test_legend.py::test_cross_figure_patch_legend", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[False]", "lib/matplotlib/tests/test_legend.py::test_rc[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_title_fontprop_fontsize", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::test_setting_alpha_keeps_polycollection_color", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter_transform[png]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[int]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_three_args", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_only", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor_short", "lib/matplotlib/tests/test_legend.py::test_legend_label_with_leading_underscore", "lib/matplotlib/tests/test_legend.py::test_legend_title_empty", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_framealpha[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_legend_expand[pdf]", "lib/matplotlib/tests/test_legend.py::test_various_labels[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_list", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_handler_map", "lib/matplotlib/tests/test_legend.py::test_alpha_rgba[png]", "lib/matplotlib/tests/test_legend.py::test_fancy[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[none]", "lib/matplotlib/tests/test_legend.py::test_get_set_draggable", "lib/matplotlib/tests/test_legend.py::test_window_extent_cached_renderer", "lib/matplotlib/tests/test_legend.py::test_subfigure_legend", "lib/matplotlib/tests/test_legend.py::test_nanscatter", "lib/matplotlib/tests/test_legend.py::test_empty_bar_chart_with_legend", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[none]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[svg]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_handle_label", "lib/matplotlib/tests/test_legend.py::test_linecollection_scaled_dashes", "lib/matplotlib/tests/test_legend.py::test_reverse_legend_handles_and_labels", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_markers_from_line2d", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_labels_only", "lib/matplotlib/tests/test_legend.py::test_fancy[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_handles_labels", "lib/matplotlib/tests/test_legend.py::test_alpha_handles", "lib/matplotlib/tests/test_legend.py::test_multiple_keys[png]", "lib/matplotlib/tests/test_legend.py::test_legend_ordereddict", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[red]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor", "lib/matplotlib/tests/test_legend.py::test_various_labels[svg]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_kw_args", "lib/matplotlib/tests/test_legend.py::test_legend_expand[png]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_iterable", "lib/matplotlib/tests/test_legend.py::test_fancy[svg]", "lib/matplotlib/tests/test_legend.py::test_text_nohandler_warning", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_linecolor", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[pdf]", "lib/matplotlib/tests/test_legend.py::test_not_covering_scatter[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_arg", "lib/matplotlib/tests/test_legend.py::test_rc[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args_pluskw", "lib/matplotlib/tests/test_legend.py::test_hatching[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_single[color2]", "lib/matplotlib/tests/test_legend.py::test_warn_big_data_best_loc", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_warn_mixed_args_and_kwargs", "lib/matplotlib/tests/test_legend.py::test_legend_proper_window_extent", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_parasite", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_label_incorrect_length_exception", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markeredgecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_legend_face_edgecolor", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_stackplot[png]", "lib/matplotlib/tests/test_legend.py::test_legend_repeatcheckok", "lib/matplotlib/tests/test_legend.py::test_handler_numpoints", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_rc[svg]", "lib/matplotlib/tests/test_legend.py::test_handlerline2d", "lib/matplotlib/tests/test_legend.py::test_plot_single_input_multiple_label[label_array2]", "lib/matplotlib/tests/test_legend.py::test_legend_auto5", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[pdf]", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_no_args", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_single[color2]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_auto4", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_markfacecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array1]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_no_warn_big_data_when_loc_specified", "lib/matplotlib/tests/test_legend.py::test_framealpha[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_expand[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_auto3[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_markeredgecolor", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_only", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_kwargs_handles_labels", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markeredgecolor_short", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_rcparam_markerfacecolor", "lib/matplotlib/tests/test_legend.py::test_legend_draggable[True]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[left]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[right]", "lib/matplotlib/tests/test_legend.py::test_legend_set_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[png]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_legend_label_three_args", "lib/matplotlib/tests/test_legend.py::test_labels_first[png]", "lib/matplotlib/tests/test_legend.py::test_hatching[svg]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[1]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor_cmap", "lib/matplotlib/tests/test_legend.py::test_legend_text_axes", "lib/matplotlib/tests/test_legend.py::test_legend_remove", "lib/matplotlib/tests/test_legend.py::TestLegendFunction::test_legend_positional_labels_only", "lib/matplotlib/tests/test_legend.py::test_legend_pathcollection_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_reverse_legend_display[png]", "lib/matplotlib/tests/test_legend.py::test_hatching[pdf]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_single_label[one]", "lib/matplotlib/tests/test_legend.py::test_various_labels[png]", "lib/matplotlib/tests/test_legend.py::test_legend_labelcolor_linecolor", "lib/matplotlib/tests/test_legend.py::test_shadow_framealpha", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[center]", "lib/matplotlib/tests/test_legend.py::test_plot_multiple_input_multiple_label[label_array0]", "lib/matplotlib/tests/test_legend.py::TestLegendFigureFunction::test_warn_args_kwargs", "lib/matplotlib/tests/test_legend.py::test_ncol_ncols[svg]", "lib/matplotlib/tests/test_legend.py::test_legend_alignment[left]" ]
[ "lib/matplotlib/tests/test_legend.py::test_figure_legend_outside" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/legend-figure-outside.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/legend-figure-outside.rst", "metadata": "diff --git a/doc/users/next_whats_new/legend-figure-outside.rst b/doc/users/next_whats_new/legend-figure-outside.rst\nnew file mode 100644\nindex 000000000000..a78725b4e2b6\n--- /dev/null\n+++ b/doc/users/next_whats_new/legend-figure-outside.rst\n@@ -0,0 +1,8 @@\n+Figure legends can be placed outside figures using constrained_layout\n+---------------------------------------------------------------------\n+Constrained layout will make space for Figure legends if they are specified\n+by a *loc* keyword argument that starts with the string \"outside\". The\n+codes are unique from axes codes, in that \"outside upper right\" will\n+make room at the top of the figure for the legend, whereas\n+\"outside right upper\" will make room on the right-hand side of the figure.\n+See :doc:`/tutorials/intermediate/legend_guide` for details.\n" } ]
diff --git a/doc/users/next_whats_new/legend-figure-outside.rst b/doc/users/next_whats_new/legend-figure-outside.rst new file mode 100644 index 000000000000..a78725b4e2b6 --- /dev/null +++ b/doc/users/next_whats_new/legend-figure-outside.rst @@ -0,0 +1,8 @@ +Figure legends can be placed outside figures using constrained_layout +--------------------------------------------------------------------- +Constrained layout will make space for Figure legends if they are specified +by a *loc* keyword argument that starts with the string "outside". The +codes are unique from axes codes, in that "outside upper right" will +make room at the top of the figure for the legend, whereas +"outside right upper" will make room on the right-hand side of the figure. +See :doc:`/tutorials/intermediate/legend_guide` for details.
matplotlib/matplotlib
matplotlib__matplotlib-18715
https://github.com/matplotlib/matplotlib/pull/18715
diff --git a/doc/users/next_whats_new/auto_minor_tick.rst b/doc/users/next_whats_new/auto_minor_tick.rst new file mode 100644 index 000000000000..02db8f6beb38 --- /dev/null +++ b/doc/users/next_whats_new/auto_minor_tick.rst @@ -0,0 +1,5 @@ +rcParams for ``AutoMinorLocator`` divisions +------------------------------------------- +The rcParams :rc:`xtick.minor.ndivs` and :rc:`ytick.minor.ndivs` have been +added to enable setting the default number of divisions; if set to ``auto``, +the number of divisions will be chosen by the distance between major ticks. diff --git a/lib/matplotlib/mpl-data/matplotlibrc b/lib/matplotlib/mpl-data/matplotlibrc index 578777167d6c..86f70a23dacd 100644 --- a/lib/matplotlib/mpl-data/matplotlibrc +++ b/lib/matplotlib/mpl-data/matplotlibrc @@ -489,6 +489,7 @@ #xtick.major.bottom: True # draw x axis bottom major ticks #xtick.minor.top: True # draw x axis top minor ticks #xtick.minor.bottom: True # draw x axis bottom minor ticks +#xtick.minor.ndivs: auto # number of minor ticks between the major ticks on x-axis #xtick.alignment: center # alignment of xticks #ytick.left: True # draw ticks on the left side @@ -510,6 +511,7 @@ #ytick.major.right: True # draw y axis right major ticks #ytick.minor.left: True # draw y axis left minor ticks #ytick.minor.right: True # draw y axis right minor ticks +#ytick.minor.ndivs: auto # number of minor ticks between the major ticks on y-axis #ytick.alignment: center_baseline # alignment of yticks diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index b27ac35bcb4d..663ff4b70536 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -568,6 +568,14 @@ def _validate_greaterequal0_lessequal1(s): raise RuntimeError(f'Value must be >=0 and <=1; got {s}') +def _validate_int_greaterequal0(s): + s = validate_int(s) + if s >= 0: + return s + else: + raise RuntimeError(f'Value must be >=0; got {s}') + + def validate_hatch(s): r""" Validate a hatch pattern. @@ -587,6 +595,24 @@ def validate_hatch(s): validate_dashlist = _listify_validator(validate_floatlist) +def _validate_minor_tick_ndivs(n): + """ + Validate ndiv parameter related to the minor ticks. + It controls the number of minor ticks to be placed between + two major ticks. + """ + + if isinstance(n, str) and n.lower() == 'auto': + return n + try: + n = _validate_int_greaterequal0(n) + return n + except (RuntimeError, ValueError): + pass + + raise ValueError("'tick.minor.ndivs' must be 'auto' or non-negative int") + + _prop_validators = { 'color': _listify_validator(validate_color_for_prop_cycle, allow_stringlist=True), @@ -1093,6 +1119,8 @@ def _convert_validator_spec(key, conv): "xtick.minor.bottom": validate_bool, # draw bottom minor xticks "xtick.major.top": validate_bool, # draw top major xticks "xtick.major.bottom": validate_bool, # draw bottom major xticks + # number of minor xticks + "xtick.minor.ndivs": _validate_minor_tick_ndivs, "xtick.labelsize": validate_fontsize, # fontsize of xtick labels "xtick.direction": ["out", "in", "inout"], # direction of xticks "xtick.alignment": ["center", "right", "left"], @@ -1114,6 +1142,8 @@ def _convert_validator_spec(key, conv): "ytick.minor.right": validate_bool, # draw right minor yticks "ytick.major.left": validate_bool, # draw left major yticks "ytick.major.right": validate_bool, # draw right major yticks + # number of minor yticks + "ytick.minor.ndivs": _validate_minor_tick_ndivs, "ytick.labelsize": validate_fontsize, # fontsize of ytick labels "ytick.direction": ["out", "in", "inout"], # direction of yticks "ytick.alignment": [ diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index a29343029f60..bf059567f5fe 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -2869,7 +2869,11 @@ def __init__(self, n=None): major ticks; e.g., n=2 will place a single minor tick midway between major ticks. - If *n* is omitted or None, it will be set to 5 or 4. + If *n* is omitted or None, the value stored in rcParams will be used. + In case *n* is set to 'auto', it will be set to 4 or 5. If the distance + between the major ticks equals 1, 2.5, 5 or 10 it can be perfectly + divided in 5 equidistant sub-intervals with a length multiple of + 0.05. Otherwise it is divided in 4 sub-intervals. """ self.ndivs = n @@ -2892,6 +2896,14 @@ def __call__(self): if self.ndivs is None: + if self.axis.axis_name == 'y': + self.ndivs = mpl.rcParams['ytick.minor.ndivs'] + else: + # for x and z axis + self.ndivs = mpl.rcParams['xtick.minor.ndivs'] + + if self.ndivs == 'auto': + majorstep_no_exponent = 10 ** (np.log10(majorstep) % 1) if np.isclose(majorstep_no_exponent, [1.0, 2.5, 5.0, 10.0]).any():
diff --git a/lib/matplotlib/tests/test_ticker.py b/lib/matplotlib/tests/test_ticker.py index 15981c4c9047..3d38df575f09 100644 --- a/lib/matplotlib/tests/test_ticker.py +++ b/lib/matplotlib/tests/test_ticker.py @@ -211,6 +211,60 @@ def test_additional(self, lim, ref): assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref) + @pytest.mark.parametrize('use_rcparam', [False, True]) + @pytest.mark.parametrize( + 'lim, ref', [ + ((0, 1.39), + [0.05, 0.1, 0.15, 0.25, 0.3, 0.35, 0.45, 0.5, 0.55, 0.65, 0.7, + 0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35]), + ((0, 0.139), + [0.005, 0.01, 0.015, 0.025, 0.03, 0.035, 0.045, 0.05, 0.055, + 0.065, 0.07, 0.075, 0.085, 0.09, 0.095, 0.105, 0.11, 0.115, + 0.125, 0.13, 0.135]), + ]) + def test_number_of_minor_ticks_auto(self, lim, ref, use_rcparam): + if use_rcparam: + context = {'xtick.minor.ndivs': 'auto', 'ytick.minor.ndivs': 'auto'} + kwargs = {} + else: + context = {} + kwargs = {'n': 'auto'} + + with mpl.rc_context(context): + fig, ax = plt.subplots() + ax.set_xlim(*lim) + ax.set_ylim(*lim) + ax.xaxis.set_minor_locator(mticker.AutoMinorLocator(**kwargs)) + ax.yaxis.set_minor_locator(mticker.AutoMinorLocator(**kwargs)) + assert_almost_equal(ax.xaxis.get_ticklocs(minor=True), ref) + assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref) + + @pytest.mark.parametrize('use_rcparam', [False, True]) + @pytest.mark.parametrize( + 'n, lim, ref', [ + (2, (0, 4), [0.5, 1.5, 2.5, 3.5]), + (4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75]), + (10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]), + ]) + def test_number_of_minor_ticks_int(self, n, lim, ref, use_rcparam): + if use_rcparam: + context = {'xtick.minor.ndivs': n, 'ytick.minor.ndivs': n} + kwargs = {} + else: + context = {} + kwargs = {'n': n} + + with mpl.rc_context(context): + fig, ax = plt.subplots() + ax.set_xlim(*lim) + ax.set_ylim(*lim) + ax.xaxis.set_major_locator(mticker.MultipleLocator(1)) + ax.xaxis.set_minor_locator(mticker.AutoMinorLocator(**kwargs)) + ax.yaxis.set_major_locator(mticker.MultipleLocator(1)) + ax.yaxis.set_minor_locator(mticker.AutoMinorLocator(**kwargs)) + assert_almost_equal(ax.xaxis.get_ticklocs(minor=True), ref) + assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref) + class TestLogLocator: def test_basic(self):
[ { "path": "doc/users/next_whats_new/auto_minor_tick.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/auto_minor_tick.rst", "metadata": "diff --git a/doc/users/next_whats_new/auto_minor_tick.rst b/doc/users/next_whats_new/auto_minor_tick.rst\nnew file mode 100644\nindex 000000000000..02db8f6beb38\n--- /dev/null\n+++ b/doc/users/next_whats_new/auto_minor_tick.rst\n@@ -0,0 +1,5 @@\n+rcParams for ``AutoMinorLocator`` divisions\n+-------------------------------------------\n+The rcParams :rc:`xtick.minor.ndivs` and :rc:`ytick.minor.ndivs` have been\n+added to enable setting the default number of divisions; if set to ``auto``,\n+the number of divisions will be chosen by the distance between major ticks.\n" } ]
3.7
b61bb0b6392c23d38cd45c658bfcd44df145830d
[ "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-100-1000]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-0.492-0.492-0]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=8.4 (autodecimal test 2)]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_view_limits_round_numbers", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.015-0.001]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.0123-0.012]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-0.1]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1001-expected21]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_linear_values", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims6-expected_low_ticks6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[0.1-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestFormatStrFormatter::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[253]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims0]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_tick_values_not_empty", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-1000.0-$\\\\mathdefault{10^{3}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.02005753653785041]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.001-3.142e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.001-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.015-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.001-1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims8]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-1-$\\\\mathdefault{10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--1234.56789-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--999.9999-expected19]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.015-0.314]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9956983447069072]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[False-lims3-cases3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[True-True-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[0.001-0.0001-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.001-1000]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x>100%]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-100-0.3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<-100%, display_range=1e-6 (tiny display range)]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-100.0-$\\\\mathdefault{100}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.015-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-500000-$\\\\mathdefault{5\\\\times10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[0.11-1.1e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.1]", "lib/matplotlib/tests/test_ticker.py::TestFixedLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x>100%, display_range=6 (custom xmax test)]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_symmetrizing", "lib/matplotlib/tests/test_ticker.py::TestSymmetricalLogLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.0-0.000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims11]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims26]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-100-100]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_unicode_minus[False--1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_switch_to_autolocator", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims1-expected_low_ticks1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF0.41OTHERSTUFF-0.41]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-07]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.00123456789-expected7]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.015-0.1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[3789.12-3783.1-3780]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.5-0.031]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999999999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-100.0-$\\\\mathdefault{10^{2}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-1000000.0-3.1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-1000000.0-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_sublabel", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-5-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-1000000.0-1e-4]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits8-lim8-6-False]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_tick_values_correct", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits2-lim2-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[1000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-100000-$\\\\mathdefault{10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.0009110511944006454]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_empty_locs", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims5-expected_low_ticks5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.5-314159.265]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits4-lim4-2-False]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.99-1.01-1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[10-lim2-ref2-False]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[Custom percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF-None]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.001-3.142e1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.5-31.416]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1-0.41OTHERSTUFF-0.5900000000000001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.5-0.314]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-0.452-0.492-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_locale", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims18]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims20]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.08839967720705845]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-5-314159.27]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.5-0.003]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims2-expected_low_ticks2]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x=100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.6852009766653157]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[True-False-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9999]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23456789-expected15]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_base_rounding", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_first_and_last_minorticks", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims3]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0.123456789-expected12]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::test_set_offset_string[formatter0]", "lib/matplotlib/tests/test_ticker.py::test_minorticks_rc", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_offset[True]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-1000000.0-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[123-189-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-5-0.03]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims2-cases2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.3147990233346844]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.001-3.142e-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1e-323]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_near_zero", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.015-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-False-10-locs1-positions1-expected1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[False-False-50\\\\{t}%]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.0043016552930929]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.001-1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.001-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims29]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-1e-05-$\\\\mathdefault{10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-5-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_blank", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-1000000.0-1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-100-31.4]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--1.23456789-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-09]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_low_number_of_majorticks[0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.015-314.159]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims4-expected_low_ticks4]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims1-cases1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[autodecimal, x<100%, display_range=8.5 (autodecimal test 1)]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim6-ref6]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims4-expected_low_ticks4]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[1-55-steps2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-1000000.0-1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-5e-05-$\\\\mathdefault{5\\\\times10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-5-100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23e+33-expected24]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[110000000.0-1.1e8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-0.0375-$\\\\mathdefault{1.2\\\\times2^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9116003227929417]", "lib/matplotlib/tests/test_ticker.py::test_majformatter_type", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--1234.56789-expected1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[False-scilimits0-lim0-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-100-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9990889488055994]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-2e-05-$\\\\mathdefault{2\\\\times10^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[5.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.84]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims16]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x=100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims21]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-100-0.1]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1000-expected20]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.001-3.142e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims15]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.5]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1.23456789e-06-expected11]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_using_all_default_major_steps", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x<100%]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[3.141592653589793-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims27]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.015-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12341-12349-12340]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-5-$\\\\mathdefault{5\\\\times10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-05]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-1000000.0-3.1e1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1900.0-1200.0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims23]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10--1-$\\\\mathdefault{-10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-100-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_useMathText[False]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_vs_major[True-lims0-cases0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.4538-0.4578-0.45]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[10-5]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-100001-expected22]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-1000000.0-3.1e5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.001-3.142e5]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_fallback", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims12]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-1-$\\\\mathdefault{1}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0-expected10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99999999]", "lib/matplotlib/tests/test_ticker.py::test_minformatter_type", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[20-100-expected0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_use_offset[False]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--0.00123456789-expected6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.0-0.000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims0-expected_low_ticks0]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0-expected9]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[123-123-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-0.01-$\\\\mathdefault{0.01}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-189--123-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim0-ref0]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x<0%]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.5-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.0123-0.012]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_useMathText[True]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-08]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.5-31415.927]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[1.5]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[754]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-1000000.0-1e-1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[12.3-12.300]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-100-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.9359999999999999]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_wide_values", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits1-lim1-0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims3-expected_low_ticks3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-200000-$\\\\mathdefault{2\\\\times10^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims17]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-1000000.0-3.1e2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99990.5-100000.5-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-5-1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_unicode_minus[True-\\u22121]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-5-314.16]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.001-100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-1-expected14]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-1000000.0-3.1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.001-1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims7-expected_low_ticks7]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-100010.5--99999.5--100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims3-expected_low_ticks3]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF12.4e-3OTHERSTUFF-None]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims10]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-1000000.0-1e-2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-5-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims13]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[False-9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[0-0.01-$\\\\mathdefault{10^{-2}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims25]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cmr10_substitutions", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.5-10000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.015-3141.593]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.015-3.142]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[100]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-12335.3-12335.3-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-100-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterMathtext::test_min_exponent[3-0.001-$\\\\mathdefault{10^{-3}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-5-31.42]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[-8.5e-51-0-expected4]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims28]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-1000000.0-3.1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100-0.5-100]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-5-0]", "lib/matplotlib/tests/test_ticker.py::TestMultipleLocator::test_view_limits", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[None-6]", "lib/matplotlib/tests/test_ticker.py::TestStrMethodFormatter::test_basic[{x:05d}-input0-00002]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.01]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[0.123-0.123]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims19]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-1000000.0-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-0.03125-$\\\\mathdefault{2^{-5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.001-3.142e-5]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims4]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_init", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-100-314159.3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314159.2654-0.015-314159.265]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10000-0.015-10000]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[1-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-5-10]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_format_data[100000000.0-1e8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[10-0.015-10]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[-0.5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-32-$\\\\mathdefault{2^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-100-3141.6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-1.2-$\\\\mathdefault{1.2\\\\times2^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_set_use_offset_float", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.718281828459045-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-1-$\\\\mathdefault{10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::test_bad_locator_subs[sub1]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_use_overline", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-100-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1-1.41\\\\cdot10^{-2}OTHERSTUFF-0.9859]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-1000000.0-3.1e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.001-1e5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-5-31415.93]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[2-lim0-ref0-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims0]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[4-lim1-ref1-False]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[10]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim4-ref4]", "lib/matplotlib/tests/test_ticker.py::TestAsinhLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x<100%]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims5-expected_low_ticks5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31.41592654-0.015-31.416]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[900.0-1200.0-0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.001-1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.5-3141.593]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[2.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.5-100000]", "lib/matplotlib/tests/test_ticker.py::test_locale_comma", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.123456789-expected5]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[-0.1-1.1-None-expected0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1233999-1234001-1234000]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-0.015-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[15.99-16.01-16]", "lib/matplotlib/tests/test_ticker.py::test_set_offset_string[formatter1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-1000000.0-1]", "lib/matplotlib/tests/test_ticker.py::test_NullFormatter", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.064]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims8]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.99]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-1000000.0-3.1e3]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits6-lim6-9-True]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[10-2-$\\\\mathdefault{2\\\\times10^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-999.9999-expected17]", "lib/matplotlib/tests/test_ticker.py::test_engformatter_usetex_useMathText", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[2]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits5-lim5--3-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_minor_number", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1-0.5-1]", "lib/matplotlib/tests/test_ticker.py::TestNullLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-5-0.31]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=0, x<0%]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_format_data_short[100]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--999.9999-expected18]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-1000000.0-3.1e-4]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[0-8.5e-51-expected3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-0.001-3.142e3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-0.001-3.142e-1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_one_half", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-False-50-locs2-positions2-expected2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.001-3.142]", "lib/matplotlib/tests/test_ticker.py::test_small_range_loglocator[3]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims7-expected_low_ticks7]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_logit_deformater[STUFF1.41\\\\cdot10^{-2}OTHERSTUFF-0.0141]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[9.99-10.01-10]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.5-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12331.4-12350.5-12300]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[False--0.123456789-expected4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3141.592654-5-3141.59]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim3-ref3]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[Empty percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0003141592654-0.5-0]", "lib/matplotlib/tests/test_ticker.py::test_majlocator_type", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-0.5-0.1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims2-expected_low_ticks2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims5]", "lib/matplotlib/tests/test_ticker.py::test_bad_locator_subs[sub0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims9]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.1-5-0.1]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.0001-0.001-1e-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.3141592654-1000000.0-3.1e-1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[None as percent symbol]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1000-0.5-1000]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims1-expected_low_ticks1]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_basic[decimals=1, x>100%]", "lib/matplotlib/tests/test_ticker.py::test_minlocator_type", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[45124.3-45831.75-45000]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_multiple_shared_axes", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim7-ref7]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.001-3.142e2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-5-3.14]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-0.1-expected13]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-100000.5--99990.5--100000]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[12.3-12.300]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[2.5-5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_maxn_major[lims1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-0.001-1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.6000000000000001]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[1.23-1.230]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99.99-100.01-100]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.999999]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-0.015-0.031]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims7]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits7-lim7-5-False]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims14]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims1]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim2-ref2]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.39999999999999997]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_precision[1.23-1.230]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-100-3.1]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[-1000000000000000.0-1000000000000000.0-expected2]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim5-ref5]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_nok[0.16]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[12592.82-12591.43-12590]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.9999999]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[True-6]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[9.0-12.0-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[1-1-1]", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_polar_axes", "lib/matplotlib/tests/test_ticker.py::TestLogLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.001-3.142e4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-1000000.0-1e-5]", "lib/matplotlib/tests/test_ticker.py::TestLinearLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[2-4]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-38.4-$\\\\mathdefault{1.2\\\\times2^{5}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654e-05-100-0]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_scilimits[True-scilimits3-lim3-2-False]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-12349--12341--12340]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims24]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[99999.5-100010.5-100000]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--0.0-expected8]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[3.141592654-0.5-3.142]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.001-0.5-0.001]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterExponent::test_basic[10.0-True-4-locs0-positions0-expected0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call[1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.03141592654-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_basic_major[lims6-expected_low_ticks6]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims22]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_integer[-0.1-0.95-None-expected1]", "lib/matplotlib/tests/test_ticker.py::TestIndexLocator::test_set_params", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nbins_major[lims7]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_low_number_of_majorticks[1-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor_attr", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-1000000.0-1e5]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks[5-5]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[1e-05-100-0]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_variablelength[0.9799424634621495]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-0.015-0.003]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-100-31415.9]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-999.9-expected16]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[2e-323]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True--1.23456789-expected3]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_nonsingular_ok[lims9]", "lib/matplotlib/tests/test_ticker.py::TestLogitLocator::test_minor[lims0-expected_low_ticks0]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-0.5-314.159]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1.1e-322]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_additional[lim1-ref1]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[0.000721-0.0007243-0.00072]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_cursor_dummy_axis[0.123-0.123]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[1e-06]", "lib/matplotlib/tests/test_ticker.py::TestPercentFormatter::test_latex[False-True-50\\\\\\\\\\\\{t\\\\}\\\\%]", "lib/matplotlib/tests/test_ticker.py::TestStrMethodFormatter::test_basic[{x:03d}-{pos:02d}-input1-002-01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.003141592654-1000000.0-3.1e-3]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_LogFormatter_call_tiny[1e-322]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[31415.92654-0.015-31415.927]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_invalid[1.1]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[314.1592654-100-314.2]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatterSciNotation::test_basic[2-1-$\\\\mathdefault{2^{0}}$]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[0.01-0.5-0.01]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-5-100000]", "lib/matplotlib/tests/test_ticker.py::TestLogitFormatter::test_basic[0.0001]", "lib/matplotlib/tests/test_ticker.py::TestLinearLocator::test_basic", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[-1234001--1233999--1234000]", "lib/matplotlib/tests/test_ticker.py::TestEngFormatter::test_params[True-987654.321-expected23]", "lib/matplotlib/tests/test_ticker.py::TestScalarFormatter::test_offset_value[5.99-6.01-6]", "lib/matplotlib/tests/test_ticker.py::TestLogFormatter::test_pprint[100000-0.015-100000]" ]
[ "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[2-lim0-ref0-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim1-ref1-False]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim1-ref1-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[4-lim1-ref1-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim0-ref0-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_int[10-lim2-ref2-True]", "lib/matplotlib/tests/test_ticker.py::TestAutoMinorLocator::test_number_of_minor_ticks_auto[lim0-ref0-False]" ]
{ "header": "If completing this task requires creating new files, classes, fields, or error messages, you may consider using the following suggested entity names:", "data": [] }
[ { "path": "doc/users/next_whats_new/auto_minor_tick.rst", "old_path": "/dev/null", "new_path": "b/doc/users/next_whats_new/auto_minor_tick.rst", "metadata": "diff --git a/doc/users/next_whats_new/auto_minor_tick.rst b/doc/users/next_whats_new/auto_minor_tick.rst\nnew file mode 100644\nindex 000000000000..02db8f6beb38\n--- /dev/null\n+++ b/doc/users/next_whats_new/auto_minor_tick.rst\n@@ -0,0 +1,5 @@\n+rcParams for ``AutoMinorLocator`` divisions\n+-------------------------------------------\n+The rcParams :rc:`xtick.minor.ndivs` and :rc:`ytick.minor.ndivs` have been\n+added to enable setting the default number of divisions; if set to ``auto``,\n+the number of divisions will be chosen by the distance between major ticks.\n" } ]
diff --git a/doc/users/next_whats_new/auto_minor_tick.rst b/doc/users/next_whats_new/auto_minor_tick.rst new file mode 100644 index 000000000000..02db8f6beb38 --- /dev/null +++ b/doc/users/next_whats_new/auto_minor_tick.rst @@ -0,0 +1,5 @@ +rcParams for ``AutoMinorLocator`` divisions +------------------------------------------- +The rcParams :rc:`xtick.minor.ndivs` and :rc:`ytick.minor.ndivs` have been +added to enable setting the default number of divisions; if set to ``auto``, +the number of divisions will be chosen by the distance between major ticks.