Question: not preserving attributes <!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: Craft Minimal Bug Reports: Minimal Complete Verifiable Examples: Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --What happened: Using on a DataArray with attributes results in a new DataArray without attributes. What you expected to happen: Attributes should be preserved or at least there should be a choice (e.g. pass kwargs to so can be passed). Minimal Complete Verifiable Example: Anything else we need to know?: Apart from loosing attributes the dtype is not conserved. In the example the resulting DataArray has dtype np.int64 instead of np.int8. As far as I can see this might not be an xarray but a numpy problem. Environment: <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.7.8 (default, Jul 31 2020, 02:25:08) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 4.14.11--generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.1.2 numpy: 1.19.1 scipy: 1.5.2 netCDF4: 1.5.4 pydap: None h5netcdf: 0.8.1 h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.25.0 distributed: 2.25.0 matplotlib: 3.3.1 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20200814 pip: 20.2.3 conda: None pytest: 6.0.1 IPython: 7.18.1 sphinx: 3.2.1 () drops attributes <!-- A short summary of the issue, if appropriate --<!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --I would expect the attributes to remain in the data array. <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-33-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.1 pandas: 1.0.4 numpy: 1.18.4 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.4 cfgrib: None iris: None bottleneck: None dask: 2.16.0 distributed: None matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None setuptools: 46.2.0 pip: 20.1 conda: None pytest: None IPython: 7.14.0 sphinx: 3.0.4 </details

join="exact",         dataset_join="exact",         dask="allowed",<ins>        keep_attrs=keep_attrs,</ins>     )


Question: Naming a dimension "method" throws error when calling ".loc" The name of the dimension should be irrelevant. The error message suggests that at some point the are given to another method in unsanitized form. Edit: Updated to xarray 0.12 from conda-forge channel. The bug is still present. <detailsINSTALLED VERSIONS commit: None python: 3.6.8 (default, Dec 30 2018, 01:22:34) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.18.0-16-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.12.0 pandas: 0.24.2 numpy: 1.16.2 scipy: 1.2.1 netCDF4: 1.4.2 pydap: None h5netcdf: None h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.3.4 nctimeaxis: None PseudonetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: None distributed: None matplotlib: 3.0.3 cartopy: None seaborn: None setuptools: 40.8.0 pip: 19.0.3 conda: 4.6.8 pytest: None IPython: 7.3.0 sphinx: 1.8.5 </detailsNaming a dimension "method" throws error when calling ".loc" The name of the dimension should be irrelevant. The error message suggests that at some point the are given to another method in unsanitized form. Edit: Updated to xarray 0.12 from conda-forge channel. The bug is still present. <detailsINSTALLED VERSIONS commit: None python: 3.6.8 (default, Dec 30 2018, 01:22:34) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.18.0-16-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.12.0 pandas: 0.24.2 numpy: 1.16.2 scipy: 1.2.1 netCDF4: 1.4.2 pydap: None h5netcdf: None h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.3.4 nctimeaxis: None PseudonetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: None distributed: None matplotlib: 3.0.3 cartopy: None seaborn: None setuptools: 40.8.0 pip: 19.0.3 conda: 4.6.8 pytest: None IPython: 7.3.0 sphinx: 1.8.5 </details

# expand the indexer so we can handle Ellipsis             labels = indexing.expanded_indexer(key, self.data_array.ndim)             key = dict(zip(self.data_array.dims, labels))        return self.data_array.sel(**key)        return self.data_array.sel(key)      def __setitem__(self, key, value) -> None:         if not utils.is_dict_like(key):


Question: Limit number of data variables shown in repr <!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: Craft Minimal Bug Reports: Minimal Complete Verifiable Examples: Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --What happened: xarray feels very unresponsive when using datasets with 2000 data variables because it has to print all the 2000 variables everytime you print something to console. What you expected to happen: xarray should limit the number of variables printed to console. Maximum maybe 25? Same idea probably apply to dimensions, coordinates and attributes as well, pandas only shows 2 for reference, the first and last variables. Minimal Complete Verifiable Example: Anything else we need to know?: Out of scope brainstorming: Though printing 2000 variables is probably madness for most people it is kind of nice to show all variables because you sometimes want to know what happened to a few other variables as well. Is there already an easy and fast way to create subgroup of the dataset, so we don' have to rely on the dataset printing everything to the console everytime? Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryxr.showversions() INSTALLED VERSIONS commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nctimeaxis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.0 </details

return col_width  def _mapping_repr(mapping, title, summarizer, col_width=None):def _mapping_repr(mapping, title, summarizer, col_width=None, max_rows=None):     if col_width is None:         col_width = _calculate_col_width(mapping)    if max_rows is None:        max_rows = OPTIONS["display_max_rows"]     summary = [f"{title}:"]     if mapping:        summary += [summarizer(k, v, col_width) for k, v in mapping.items()]        if len(mapping) > max_rows:            first_rows = max_rows // 2 + max_rows % 2            items = list(mapping.items())            summary += [summarizer(k, v, col_width) for k, v in items[:first_rows]]            if max_rows > 1:                last_rows = max_rows // 2                summary += [pretty_print("    ...", col_width) + " ..."]                summary += [summarizer(k, v, col_width) for k, v in items[-last_rows:]]        else:            summary += [summarizer(k, v, col_width) for k, v in mapping.items()]     else:         summary += [EMPTY_REPR]     return "\n".join(summary)diff --git a/xarray/core/options.py b/xarray/core/options.py-- a/xarray/core/options.py++ b/xarray/core/options.py


Question: Limit number of data variables shown in repr <!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: Craft Minimal Bug Reports: Minimal Complete Verifiable Examples: Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --What happened: xarray feels very unresponsive when using datasets with 2000 data variables because it has to print all the 2000 variables everytime you print something to console. What you expected to happen: xarray should limit the number of variables printed to console. Maximum maybe 25? Same idea probably apply to dimensions, coordinates and attributes as well, pandas only shows 2 for reference, the first and last variables. Minimal Complete Verifiable Example: Anything else we need to know?: Out of scope brainstorming: Though printing 2000 variables is probably madness for most people it is kind of nice to show all variables because you sometimes want to know what happened to a few other variables as well. Is there already an easy and fast way to create subgroup of the dataset, so we don' have to rely on the dataset printing everything to the console everytime? Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryxr.showversions() INSTALLED VERSIONS commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nctimeaxis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.0 </details

import warnings DISPLAY_WIDTH = "display_width" ARITHMETIC_JOIN = "arithmetic_join"CMAP_DIVERGENT = "cmap_divergent"CMAP_SEQUENTIAL = "cmap_sequential"DISPLAY_MAX_ROWS = "display_max_rows"DISPLAY_STYLE = "display_style"DISPLAY_WIDTH = "display_width" ENABLE_CFTIMEINDEX = "enable_cftimeindex" FILE_CACHE_MAXSIZE = "file_cache_maxsize"WARN_FOR_UNCLOSED_FILES = "warn_for_unclosed_files"CMAP_SEQUENTIAL = "cmap_sequential"CMAP_DIVERGENT = "cmap_divergent" KEEP_ATTRS = "keep_attrs"DISPLAY_STYLE = "display_style"WARN_FOR_UNCLOSED_FILES = "warn_for_unclosed_files"   OPTIONS = {    DISPLAY_WIDTH: 80,     ARITHMETIC_JOIN: "inner",    CMAP_DIVERGENT: "RdBu_r",    CMAP_SEQUENTIAL: "viridis",    DISPLAY_MAX_ROWS: 12,    DISPLAY_STYLE: "html",    DISPLAY_WIDTH: 80,     ENABLE_CFTIMEINDEX: True,     FILE_CACHE_MAXSIZE: 128,    WARN_FOR_UNCLOSED_FILES: False,    CMAP_SEQUENTIAL: "viridis",    CMAP_DIVERGENT: "RdBu_r",     KEEP_ATTRS: "default",    DISPLAY_STYLE: "html",    WARN_FOR_UNCLOSED_FILES: False, }  _JOIN_OPTIONS = frozenset(["inner", "outer", "left", "right", "exact"])


Question: Limit number of data variables shown in repr <!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: Craft Minimal Bug Reports: Minimal Complete Verifiable Examples: Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --What happened: xarray feels very unresponsive when using datasets with 2000 data variables because it has to print all the 2000 variables everytime you print something to console. What you expected to happen: xarray should limit the number of variables printed to console. Maximum maybe 25? Same idea probably apply to dimensions, coordinates and attributes as well, pandas only shows 2 for reference, the first and last variables. Minimal Complete Verifiable Example: Anything else we need to know?: Out of scope brainstorming: Though printing 2000 variables is probably madness for most people it is kind of nice to show all variables because you sometimes want to know what happened to a few other variables as well. Is there already an easy and fast way to create subgroup of the dataset, so we don' have to rely on the dataset printing everything to the console everytime? Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryxr.showversions() INSTALLED VERSIONS commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nctimeaxis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.0 </details

_VALIDATORS = {    DISPLAY_WIDTH: _positive_integer,     ARITHMETIC_JOIN: _JOIN_OPTIONS.__contains__,    DISPLAY_MAX_ROWS: _positive_integer,    DISPLAY_STYLE: _DISPLAY_OPTIONS.__contains__,    DISPLAY_WIDTH: _positive_integer,     ENABLE_CFTIMEINDEX: lambda value: isinstance(value, bool),     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__,    WARN_FOR_UNCLOSED_FILES: lambda value: isinstance(value, bool), }


Question: Limit number of data variables shown in repr <!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: Craft Minimal Bug Reports: Minimal Complete Verifiable Examples: Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --What happened: xarray feels very unresponsive when using datasets with 2000 data variables because it has to print all the 2000 variables everytime you print something to console. What you expected to happen: xarray should limit the number of variables printed to console. Maximum maybe 25? Same idea probably apply to dimensions, coordinates and attributes as well, pandas only shows 2 for reference, the first and last variables. Minimal Complete Verifiable Example: Anything else we need to know?: Out of scope brainstorming: Though printing 2000 variables is probably madness for most people it is kind of nice to show all variables because you sometimes want to know what happened to a few other variables as well. Is there already an easy and fast way to create subgroup of the dataset, so we don' have to rely on the dataset printing everything to the console everytime? Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryxr.showversions() INSTALLED VERSIONS commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nctimeaxis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.0 </details

_SETTERS = {    FILE_CACHE_MAXSIZE: _set_file_cache_maxsize,     ENABLE_CFTIMEINDEX: _warn_on_setting_enable_cftimeindex,    FILE_CACHE_MAXSIZE: _set_file_cache_maxsize, }


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

return other + self.as_timedelta()  <ins>class Millisecond(BaseCFTimeOffset):    _freq = "L"    def as_timedelta(self):        return timedelta(milliseconds=self.n)    def __apply__(self, other):        return other + self.as_timedelta()class Microsecond(BaseCFTimeOffset):    _freq = "U"    def as_timedelta(self):        return timedelta(microseconds=self.n)    def __apply__(self, other):        return other + self.as_timedelta()</ins> _FREQUENCIES = {     "A": YearEnd,     "AS": YearBegin,


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

"T": Minute,     "min": Minute,     "S": Second,<ins>    "L": Millisecond,    "ms": Millisecond,    "U": Microsecond,    "us": Microsecond,</ins>     "AS-JAN": partial(YearBegin, month=1),     "AS-FEB": partial(YearBegin, month=2),     "AS-MAR": partial(YearBegin, month=3),


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

`ISO-8601 format <https://en.wikipedia.org/wiki/ISO_8601>`_.     - It supports many, but not all, frequencies supported by       ``pandas.date_range``.  For example it does not currently support any of      the business-related, semi-monthly, or sub-second frequencies.      the business-related or semi-monthly frequencies.     - Compound sub-monthly frequencies are not supported, e.g. '1H1min', as       these can easily be written in terms of the finest common resolution,       e.g. '61min'.


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

+--------+--------------------------+     | S      | Second frequency         |     +--------+--------------------------+    | L, ms  | Millisecond frequency    |    +--------+--------------------------+    | U, us  | Microsecond frequency    |    +--------+--------------------------+      Any multiples of the following anchored offsets are also supported. diff --git a/xarray/coding/times.py b/xarray/coding/times.py-- a/xarray/coding/times.py++ b/xarray/coding/times.py


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

import re import warningsfrom datetime import datetimefrom datetime import datetime, timedelta from distutils.version import LooseVersion from functools import partial


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

"D": int(1e9) * 60 * 60 * 24, } <ins>_US_PER_TIME_DELTA = {    "microseconds": 1,    "milliseconds": 1_000,    "seconds": 1_000_000,    "minutes": 60 * 1_000_000,    "hours": 60 * 60 * 1_000_000,    "days": 24 * 60 * 60 * 1_000_000,}_NETCDF_TIME_UNITS_CFTIME = [    "days",    "hours",    "minutes",    "seconds",    "milliseconds",    "microseconds",]_NETCDF_TIME_UNITS_NUMPY = _NETCDF_TIME_UNITS_CFTIME + ["nanoseconds"]</ins> TIME_UNITS = frozenset(     [         "days",


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

if calendar in _STANDARD_CALENDARS:                     dates = cftime_to_nptime(dates)     elif use_cftime:        dates = _decode_datetime_with_cftime(            flat_num_dates.astype(float), units, calendar        )        dates = _decode_datetime_with_cftime(flat_num_dates, units, calendar)     else:         dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar)


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

return result.reshape(num_timedeltas.shape)  def _unit_timedelta_cftime(units):    return timedelta(microseconds=_US_PER_TIME_DELTA[units])def _unit_timedelta_numpy(units):    numpy_units = _netcdf_to_numpy_timeunit(units)    return np.timedelta64(_NS_PER_TIME_DELTA[numpy_units], "ns") def _infer_time_units_from_diff(unique_timedeltas):    # Note that the modulus operator was only implemented for np.timedelta64    # arrays as of NumPy version 1.16.0.  Once our minimum version of NumPy    # supported is greater than or equal to this we will no longer need to cast    # unique_timedeltas to a TimedeltaIndex.  In the meantime, however, the    # modulus operator works for TimedeltaIndex objects.    unique_deltas_as_index = pd.TimedeltaIndex(unique_timedeltas)    for time_unit in [        "days",        "hours",        "minutes",        "seconds",        "milliseconds",        "microseconds",        "nanoseconds",    ]:        delta_ns = _NS_PER_TIME_DELTA[_netcdf_to_numpy_timeunit(time_unit)]        unit_delta = np.timedelta64(delta_ns, "ns")        if np.all(unique_deltas_as_index % unit_delta == np.timedelta64(0, "ns")):    if unique_timedeltas.dtype == np.dtype("O"):        time_units = _NETCDF_TIME_UNITS_CFTIME        unit_timedelta = _unit_timedelta_cftime        zero_timedelta = timedelta(microseconds=0)        timedeltas = unique_timedeltas    else:        time_units = _NETCDF_TIME_UNITS_NUMPY        unit_timedelta = _unit_timedelta_numpy        zero_timedelta = np.timedelta64(0, "ns")        # Note that the modulus operator was only implemented for np.timedelta64        # arrays as of NumPy version 1.16.0.  Once our minimum version of NumPy        # supported is greater than or equal to this we will no longer need to cast        # unique_timedeltas to a TimedeltaIndex.  In the meantime, however, the        # modulus operator works for TimedeltaIndex objects.        timedeltas = pd.TimedeltaIndex(unique_timedeltas)    for time_unit in time_units:        if np.all(timedeltas % unit_timedelta(time_unit) == zero_timedelta):             return time_unit     return "seconds"


Question: CFTime offsets missing for milli- and micro-seconds <!-- A short summary of the issue, if appropriate --The smallest cftime offset defined in is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily . PR adds a that supports the two, but they are currently untested as cannot generate an index. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --<!-- this should explain why the current behavior is a problem and why the expected output is a better solution --An error gets raised : . <details<summaryOutput of <ttxr.showversions()</tt</summary<!-- Paste the output here xr.showversions() here --INSTALLED VERSIONS commit: None python: 3.8.2 (default, Apr 24 2020, 08:20:52) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.6.13-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: frCA.utf8 LOCALE: frCA.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.2.dev9+g6378a711. pandas: 1.0.3 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.1.2 nctime_axis: 1.2.0 PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.16.0 distributed: 2.16.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: 0.11 setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: 5.4.1 IPython: 7.13.0 sphinx: 3.0.2 </details

reference_date = dates[0] if len(dates) > 0 else "1970-01-01"         reference_date = format_cftime_datetime(reference_date)     unique_timedeltas = np.unique(np.diff(dates))<del>    if unique_timedeltas.dtype == np.dtype("O"):        # Convert to np.timedelta64 objects using pandas to work around a        # NumPy casting bug: https://github.com/numpy/numpy/issues/11096        unique_timedeltas = to_timedelta_unboxed(unique_timedeltas)</del>     units = _infer_time_units_from_diff(unique_timedeltas)     return f"{units} since {reference_date}"


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

# unstacked dataset         return Dataset(data_dict)     def transpose(self, *dims: Hashable, transpose_coords: bool = True) -> "DataArray":    def transpose(        self,        *dims: Hashable,        transpose_coords: bool = True,        missing_dims: str = "raise",    ) -> "DataArray":         """Return a new DataArray object with transposed dimensions.          Parameters


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

dimensions to this order.         transpose_coords : bool, default: True             If True, also transpose the coordinates of this DataArray.<ins>        missing_dims : {"raise", "warn", "ignore"}, default: "raise"            What to do if dimensions that should be selected from are not present in the            DataArray:            - "raise": raise an exception            - "warning": raise a warning, and ignore the missing dimensions            - "ignore": ignore the missing dimensions</ins>          Returns         -------


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

Dataset.transpose         """         if dims:            dims = tuple(utils.infix_dims(dims, self.dims))            dims = tuple(utils.infix_dims(dims, self.dims, missing_dims))         variable = self.variable.transpose(*dims)         if transpose_coords:             coords: Dict[Hashable, Variable] = {}diff --git a/xarray/core/utils.py b/xarray/core/utils.py-- a/xarray/core/utils.py++ b/xarray/core/utils.py


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

return len(self._data) - num_hidden  def infix_dims(dims_supplied: Collection, dims_all: Collection) -> Iterator:def infix_dims(    dims_supplied: Collection, dims_all: Collection, missing_dims: str = "raise") -> Iterator:     """    Resolves a supplied list containing an ellispsis representing other items, to    Resolves a supplied list containing an ellipsis 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:        if list(dims_supplied).count(...) > 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 == ...:        existing_dims = drop_missing_dims(dims_supplied, dims_all, missing_dims)        for d in existing_dims:            if d is ...:                 yield from other_dims             else:                 yield d     else:        if set(dims_supplied) ^ set(dims_all):        existing_dims = drop_missing_dims(dims_supplied, dims_all, missing_dims)        if set(existing_dims) ^ set(dims_all):             raise ValueError(                 f"{dims_supplied} must be a permuted list of {dims_all}, unless `...` is included"             )        yield from dims_supplied        yield from existing_dims   def get_temp_dimname(dims: Container[Hashable], new_dim: Hashable) -> Hashable:


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

invalid = indexers.keys() - set(dims)         if invalid:             raise ValueError(                f"dimensions {invalid} do not exist. Expected one or more of {dims}"                f"Dimensions {invalid} do not exist. Expected one or more of {dims}"             )          return indexers


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

invalid = indexers.keys() - set(dims)         if invalid:             warnings.warn(                f"dimensions {invalid} do not exist. Expected one or more of {dims}"                f"Dimensions {invalid} do not exist. Expected one or more of {dims}"             )         for key in invalid:             indexers.pop(key)


Question: DataArray transpose inconsistent with Dataset Ellipsis usage This works: This doesn't (subset air): The error message is a bit inaccurate too since I do have Ellipsis included; might be related to two calls of:

)  <ins>def drop_missing_dims(    supplied_dims: Collection, dims: Collection, missing_dims: str) -> Collection:    """Depending on the setting of missing_dims, drop any dimensions from supplied_dims that    are not present in dims.    Parameters    ----------    supplied_dims : dict    dims : sequence    missing_dims : {"raise", "warn", "ignore"}    """    if missing_dims == "raise":        supplied_dims_set = set(val for val in supplied_dims if val is not ...)        invalid = supplied_dims_set - set(dims)        if invalid:            raise ValueError(                f"Dimensions {invalid} do not exist. Expected one or more of {dims}"            )        return supplied_dims    elif missing_dims == "warn":        invalid = set(supplied_dims) - set(dims)        if invalid:            warnings.warn(                f"Dimensions {invalid} do not exist. Expected one or more of {dims}"            )        return [val for val in supplied_dims if val in dims or val is ...]    elif missing_dims == "ignore":        return [val for val in supplied_dims if val in dims or val is ...]    else:        raise ValueError(            f"Unrecognised option {missing_dims} for missing_dims argument"        )</ins> class UncachedAccessor:     """Acts like a property, but on both classes and class instances


Question: Decodecf fails when scalefactor is a length-1 list Some datasets I work with have and encoded as length-1 lists. The following code worked as of Xarray 0.16.1 In 0.16.2 (just released) and current master, it fails with this error I'm very confused, because this feels quite similar to , and I thought it was resolved . However, the behavior is different with . That works fine--no error. How might I end up with a dataset with as a python list? It happens when I open a netcdf file using the engine (documented by in ) and then write it to zarr. The numpy array gets encoded as a list in the zarr json metadata. This problem would go away if we could resolve the discrepancies between the two engines' treatment of scalar attributes.

add_offset = pop_to(attrs, encoding, "add_offset", name=name)             dtype = _choose_float_dtype(data.dtype, "add_offset" in attrs)             if np.ndim(scale_factor) > 0:                scale_factor = scale_factor.item()                scale_factor = np.asarray(scale_factor).item()             if np.ndim(add_offset) > 0:                add_offset = add_offset.item()                add_offset = np.asarray(add_offset).item()             transform = partial(                 _scale_offset_decoding,                 scale_factor=scale_factor,


Question: dropsel indices in dimension that doesn't have coordinates? <!-- Please do a quick search of existing issues to make sure that this has not been asked before. --Is your feature request related to a problem? Please describe. I am trying to drop particular indices from a dimension that doesn't have coordinates. Following: , but leaving out the coordinate labels: gives me an error. Describe the solution you'd like I would think should exist and work in analogy to as does to . Describe alternatives you've considered As far as I know, I could either create coordinates especially to in order to drop, or rebuild a new dataset. Both are not congenial. (I'd be grateful to know if there is actually a straightforward way to do this I've overlooked.

ds = self._to_temp_dataset().drop_sel(labels, errors=errors)         return self._from_temp_dataset(ds)     def drop_isel(self, indexers=None, **indexers_kwargs):        """Drop index positions from this DataArray.        Parameters        ----------        indexers : mapping of hashable to Any            Index locations to drop        **indexers_kwargs : {dim: position, ...}, optional            The keyword arguments form of ``dim`` and ``positions``        Returns        -------        dropped : DataArray        Raises        ------        IndexError        """        dataset = self._to_temp_dataset()        dataset = dataset.drop_isel(indexers=indexers, **indexers_kwargs)        return self._from_temp_dataset(dataset)     def dropna(         self, dim: Hashable, how: str = "any", thresh: int = None     ) -> "DataArray":diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py-- a/xarray/core/dataset.py++ b/xarray/core/dataset.py


Question: dropsel indices in dimension that doesn't have coordinates? <!-- Please do a quick search of existing issues to make sure that this has not been asked before. --Is your feature request related to a problem? Please describe. I am trying to drop particular indices from a dimension that doesn't have coordinates. Following: , but leaving out the coordinate labels: gives me an error. Describe the solution you'd like I would think should exist and work in analogy to as does to . Describe alternatives you've considered As far as I know, I could either create coordinates especially to in order to drop, or rebuild a new dataset. Both are not congenial. (I'd be grateful to know if there is actually a straightforward way to do this I've overlooked.

labels_for_dim = [labels_for_dim]             labels_for_dim = np.asarray(labels_for_dim)             try:                index = self.indexes[dim]                index = self.get_index(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_isel(self, indexers=None, **indexers_kwargs):        """Drop index positions from this Dataset.        Parameters        ----------        indexers : mapping of hashable to Any            Index locations to drop        **indexers_kwargs : {dim: position, ...}, optional            The keyword arguments form of ``dim`` and ``positions``        Returns        -------        dropped : Dataset        Raises        ------        IndexError        Examples        --------        >>> data = np.arange(6).reshape(2, 3)        >>> labels = ["a", "b", "c"]        >>> ds = xr.Dataset({"A": (["x", "y"], data), "y": labels})        >>> ds        <xarray.Dataset>        Dimensions:  (x: 2, y: 3)        Coordinates:          * y        (y) <U1 'a' 'b' 'c'        Dimensions without coordinates: x        Data variables:            A        (x, y) int64 0 1 2 3 4 5        >>> ds.drop_isel(y=[0, 2])        <xarray.Dataset>        Dimensions:  (x: 2, y: 1)        Coordinates:          * y        (y) <U1 'b'        Dimensions without coordinates: x        Data variables:            A        (x, y) int64 1 4        >>> ds.drop_isel(y=1)        <xarray.Dataset>        Dimensions:  (x: 2, y: 2)        Coordinates:          * y        (y) <U1 'a' 'c'        Dimensions without coordinates: x        Data variables:            A        (x, y) int64 0 2 3 5        """        indexers = either_dict_or_kwargs(indexers, indexers_kwargs, "drop")        ds = self        dimension_index = {}        for dim, pos_for_dim in indexers.items():            # Don't cast to set, as it would harm performance when labels            # is a large numpy array            if utils.is_scalar(pos_for_dim):                pos_for_dim = [pos_for_dim]            pos_for_dim = np.asarray(pos_for_dim)            index = self.get_index(dim)            new_index = index.delete(pos_for_dim)            dimension_index[dim] = new_index        ds = ds.loc[dimension_index]        return ds     def drop_dims(         self, drop_dims: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise"     ) -> "Dataset":


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

- "override": if indexes are of same size, rewrite indexes to be           those of the first object with that dimension. Indexes for the same           dimension must have the same size in all objects.    combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \                    default: "drop"    combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \                     "override"}, default: "drop"         String indicating how to combine attrs of the objects being merged:          - "drop": empty attrs on returned Dataset.         - "identical": all attrs must be the same on every object.         - "no_conflicts": attrs from all objects are combined, any that have           the same name must also have the same value.        - "drop_conflicts": attrs from all objects are combined, any that have          the same name but different values are dropped.         - "override": skip comparing and copy attrs from the first dataset to           the result.


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

- "override": if indexes are of same size, rewrite indexes to be           those of the first object with that dimension. Indexes for the same           dimension must have the same size in all objects.    combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \                    default: "drop"    combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \                     "override"}, default: "drop"         String indicating how to combine attrs of the objects being merged:          - "drop": empty attrs on returned Dataset.         - "identical": all attrs must be the same on every object.         - "no_conflicts": attrs from all objects are combined, any that have           the same name must also have the same value.        - "drop_conflicts": attrs from all objects are combined, any that have          the same name but different values are dropped.         - "override": skip comparing and copy attrs from the first dataset to           the result. diff --git a/xarray/core/concat.py b/xarray/core/concat.py-- a/xarray/core/concat.py++ b/xarray/core/concat.py


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

- "override": if indexes are of same size, rewrite indexes to be           those of the first object with that dimension. Indexes for the same           dimension must have the same size in all objects.    combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \                    default: "override"    combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \                     "override"}, default: "override"         String indicating how to combine attrs of the objects being merged:          - "drop": empty attrs on returned Dataset.         - "identical": all attrs must be the same on every object.         - "no_conflicts": attrs from all objects are combined, any that have           the same name must also have the same value.        - "drop_conflicts": attrs from all objects are combined, any that have          the same name but different values are dropped.         - "override": skip comparing and copy attrs from the first dataset to           the result. diff --git a/xarray/core/merge.py b/xarray/core/merge.py-- a/xarray/core/merge.py++ b/xarray/core/merge.py


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

from . import dtypes, pdcompat from .alignment import deep_align from .duck_array_ops import lazy_array_equivfrom .utils import Frozen, compat_dict_union, dict_equivfrom .utils import Frozen, compat_dict_union, dict_equiv, equivalent from .variable import Variable, as_variable, assert_unique_multiindex_level_names  if TYPE_CHECKING:


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

"the same. Merging %s with %s" % (str(result), str(attrs))                 )         return result<ins>    elif combine_attrs == "drop_conflicts":        result = {}        dropped_keys = set()        for attrs in variable_attrs:            result.update(                {                    key: value                    for key, value in attrs.items()                    if key not in result and key not in dropped_keys                }            )            result = {                key: value                for key, value in result.items()                if key not in attrs or equivalent(attrs[key], value)            }            dropped_keys |= {key for key in attrs if key not in result}        return result</ins>     elif combine_attrs == "identical":         result = dict(variable_attrs[0])         for attrs in variable_attrs[1:]:


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

Compatibility checks to use when merging variables.     join : {"outer", "inner", "left", "right"}, optional         How to combine objects with different indexes.    combine_attrs : {"drop", "identical", "no_conflicts", "override"}, optional    combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \                     "override"}, optional         How to combine attributes of objects     priority_arg : int, optional         Optional argument in `objects` that takes precedence over the others.


Question: Option for combineattrs with conflicting values silently dropped currently supports four options for merging : It would be nice to have an option to combine attrs from all objects like "noconflicts", but that drops attributes with conflicting values rather than raising an error. We might call this or . This is similar to how xarray currently handles conflicting values for and would be more suitable to consider for the default behavior of and other functions/methods that merge coordinates (e.g., applyufunc, concat, where, binary arithmetic). cc

Value to use for newly missing values. If a dict-like, maps         variable names to fill values. Use a data array's name to         refer to its values.    combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \                    default: "drop"    combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \                     "override"}, default: "drop"         String indicating how to combine attrs of the objects being merged:          - "drop": empty attrs on returned Dataset.         - "identical": all attrs must be the same on every object.         - "no_conflicts": attrs from all objects are combined, any that have           the same name must also have the same value.        - "drop_conflicts": attrs from all objects are combined, any that have          the same name but different values are dropped.         - "override": skip comparing and copy attrs from the first dataset to           the result.


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

import contextlib import io import threadingimport uuid import warningsfrom typing import Anyfrom typing import Any, Hashable  from ..core import utils from ..core.options import OPTIONS


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

from .lru_cache import LRUCache  # Global cache for storing open files.FILE_CACHE: LRUCache[str, io.IOBase] = LRUCache(FILE_CACHE: LRUCache[Any, io.IOBase] = LRUCache(     maxsize=OPTIONS["file_cache_maxsize"], on_evict=lambda k, v: v.close() ) assert FILE_CACHE.maxsize, "file cache must be at least size one"  REF_COUNTS: dict[Any, int] = {}  _DEFAULT_MODE = utils.ReprObject("<unused>")


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

kwargs=None,         lock=None,         cache=None,        manager_id: Hashable | None = None,         ref_counts=None,     ):        """Initialize a FileManager.        """Initialize a CachingFileManager.         The cache and ref_counts arguments exist solely to facilitate        dependency injection, and should only be set for tests.        The cache, manager_id and ref_counts arguments exist solely to        facilitate dependency injection, and should only be set for tests.          Parameters         ----------


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

global variable and contains non-picklable file objects, an             unpickled FileManager objects will be restored with the default             cache.<ins>        manager_id : hashable, optional            Identifier for this CachingFileManager.</ins>         ref_counts : dict, optional             Optional dict to use for keeping track the number of references to             the same file.


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

self._mode = mode         self._kwargs = {} if kwargs is None else dict(kwargs)         self._default_lock = lock is None or lock is False        self._lock = threading.Lock() if self._default_lock else lock        self._use_default_lock = lock is None or lock is False        self._lock = threading.Lock() if self._use_default_lock else lock          # cache[self._key] stores the file associated with this object.         if cache is None:             cache = FILE_CACHE         self._cache = cache        if manager_id is None:            # Each call to CachingFileManager should separately open files.            manager_id = str(uuid.uuid4())        self._manager_id = manager_id         self._key = self._make_key()          # ref_counts[self._key] stores the number of CachingFileManager objects


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

self._args,             "a" if self._mode == "w" else self._mode,             tuple(sorted(self._kwargs.items())),<ins>            self._manager_id,</ins>         )         return _HashedSequence(value)


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

if file is not None:                 file.close()     def __del__(self):        # If we're the only CachingFileManger referencing a unclosed file, we        # should remove it from the cache upon garbage collection.    def __del__(self) -> None:        # If we're the only CachingFileManger referencing a unclosed file,        # remove it from the cache upon garbage collection.         #        # Keeping our own count of file references might seem like overkill,        # but it's actually pretty common to reopen files with the same        # variable name in a notebook or command line environment, e.g., to        # fix the parameters used when opening a file:        #    >>> ds = xarray.open_dataset('myfile.nc')        #    >>> ds = xarray.open_dataset('myfile.nc', decode_times=False)        # This second assignment to "ds" drops CPython's ref-count on the first        # "ds" argument to zero, which can trigger garbage collections. So if        # we didn't check whether another object is referencing 'myfile.nc',        # the newly opened file would actually be immediately closed!        # We keep track of our own reference count because we don't want to        # close files if another identical file manager needs it. This can        # happen if a CachingFileManager is pickled and unpickled without        # closing the original file.         ref_count = self._ref_counter.decrement(self._key)          if not ref_count and self._key in self._cache:


Question: jupyter repr caching deleted netcdf file What happened: Testing xarray data storage in a jupyter notebook with varying data sizes and storing to a netcdf, i noticed that opendataset/array (both show this behaviour) continue to return data from the first testing run, ignoring the fact that each run deletes the previously created netcdf file. This only happens once the was used to display the xarray object. But once in error mode, even the previously fine printed objects are then showing the wrong data. This was hard to track down as it depends on the precise sequence in jupyter. What you expected to happen: when i use , the resulting object should reflect reality on disk. Minimal Complete Verifiable Example: When executed in a cell with print for display, all is fine: but as soon as one cell used the jupyter repr: all future file reads, even after executing the test function again and even using and not , show the data from the last repr use. Anything else we need to know?: Here's a notebook showing the issue: Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.7.6 (default, Jun 1 2020, 18:57:50) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-40-generic machine: x8664 processor: x8664 byteorder: little LCALL: None LANG: enUS.UTF-8 LOCALE: enUS.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.0 scipy: 1.5.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.2.1 nctimeaxis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: 0.18.0 seaborn: 0.10.1 numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: installed pytest: 6.0.0rc1 IPython: 7.16.1 sphinx: 3.1.2 </details

if OPTIONS["warn_for_unclosed_files"]:                 warnings.warn(                    "deallocating {}, but file is not already closed. "                    "This may indicate a bug.".format(self),                    f"deallocating {self}, but file is not already closed. "                    "This may indicate a bug.",                     RuntimeWarning,                     stacklevel=2,                 )      def __getstate__(self):         """State for pickling."""        # cache and ref_counts are intentionally omitted: we don't want to try        # to serialize these global objects.        lock = None if self._default_lock else self._lock        return (self._opener, self._args, self._mode, self._kwargs, lock)        # cache is intentionally omitted: we don't want to try to serialize        # these global objects.        lock = None if self._use_default_lock else self._lock        return (            self._opener,            self._args,            self._mode,            self._kwargs,            lock,            self._manager_id,        )     def __setstate__(self, state):    def __setstate__(self, state) -> None:         """Restore from a pickle."""        opener, args, mode, kwargs, lock = state        self.__init__(opener, *args, mode=mode, kwargs=kwargs, lock=lock)        opener, args, mode, kwargs, lock, manager_id = state        self.__init__(  # type: ignore            opener, *args, mode=mode, kwargs=kwargs, lock=lock, manager_id=manager_id        )     def __repr__(self):    def __repr__(self) -> str:         args_string = ", ".join(map(repr, self._args))         if self._mode is not _DEFAULT_MODE:             args_string += f", mode={self._mode!r}"        return "{}({!r}, {}, kwargs={})".format(            type(self).__name__, self._opener, args_string, self._kwargs        return (            f"{type(self).__name__}({self._opener!r}, {args_string}, "            f"kwargs={self._kwargs}, manager_id={self._manager_id!r})"         )


Question: Sum and prod with mincount forces evaluation If I use the method on a lazy array with then evaluation is forced. If there is some limitation of the implementation which means it cannot be to the computation graph for lazy evaluation then this should be mentioned in the docs. Minimal Complete Verifiable Example: What happened: ` What you expected to happen: No output or exceptions, as the result1 and result2 arrays are not printed or saved. Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.10.15-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: enNZ.UTF-8 LOCALE: enNZ.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.2.1 numpy: 1.20.0 scipy: 1.6.0 netCDF4: 1.5.5.1 pydap: None h5netcdf: 0.9.0 h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nctime_axis: None PseudoNetCDF: None rasterio: 1.2.0 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 53.0.0 pip: 20.3.1 conda: None pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.3 </details

return np.dtype(dtype), fill_value  NAT_TYPES = (np.datetime64("NaT"), np.timedelta64("NaT"))NAT_TYPES = {np.datetime64("NaT").dtype, np.timedelta64("NaT").dtype}   def get_fill_value(dtype):diff --git a/xarray/core/nanops.py b/xarray/core/nanops.py-- a/xarray/core/nanops.py++ b/xarray/core/nanops.py


Question: Sum and prod with mincount forces evaluation If I use the method on a lazy array with then evaluation is forced. If there is some limitation of the implementation which means it cannot be to the computation graph for lazy evaluation then this should be mentioned in the docs. Minimal Complete Verifiable Example: What happened: ` What you expected to happen: No output or exceptions, as the result1 and result2 arrays are not printed or saved. Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.10.15-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: enNZ.UTF-8 LOCALE: enNZ.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.2.1 numpy: 1.20.0 scipy: 1.6.0 netCDF4: 1.5.5.1 pydap: None h5netcdf: 0.9.0 h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nctime_axis: None PseudoNetCDF: None rasterio: 1.2.0 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 53.0.0 pip: 20.3.1 conda: None pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.3 </details

import numpy as np  from . import dtypes, nputils, utilsfrom .duck_array_ops import _dask_or_eager_func, count, fillna, isnull, where_methodfrom .duck_array_ops import (    _dask_or_eager_func,    count,    fillna,    isnull,    where,    where_method,) from .pycompat import dask_array_type  try:


Question: Sum and prod with mincount forces evaluation If I use the method on a lazy array with then evaluation is forced. If there is some limitation of the implementation which means it cannot be to the computation graph for lazy evaluation then this should be mentioned in the docs. Minimal Complete Verifiable Example: What happened: ` What you expected to happen: No output or exceptions, as the result1 and result2 arrays are not printed or saved. Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.10.15-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: enNZ.UTF-8 LOCALE: enNZ.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.2.1 numpy: 1.20.0 scipy: 1.6.0 netCDF4: 1.5.5.1 pydap: None h5netcdf: 0.9.0 h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nctime_axis: None PseudoNetCDF: None rasterio: 1.2.0 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 53.0.0 pip: 20.3.1 conda: None pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.3 </details

"""     xarray version of pandas.core.nanops._maybe_null_out     """     if axis is not None and getattr(result, "ndim", False):         null_mask = (np.take(mask.shape, axis).prod() - mask.sum(axis) - min_count) < 0        if null_mask.any():            dtype, fill_value = dtypes.maybe_promote(result.dtype)            result = result.astype(dtype)            result[null_mask] = fill_value        dtype, fill_value = dtypes.maybe_promote(result.dtype)        result = where(null_mask, fill_value, result.astype(dtype))      elif getattr(result, "dtype", None) not in dtypes.NAT_TYPES:         null_mask = mask.size - mask.sum()        if null_mask < min_count:            result = np.nan        result = where(null_mask < min_count, np.nan, result)      return result diff --git a/xarray/core/ops.py b/xarray/core/ops.py-- a/xarray/core/ops.py++ b/xarray/core/ops.py


Question: Sum and prod with mincount forces evaluation If I use the method on a lazy array with then evaluation is forced. If there is some limitation of the implementation which means it cannot be to the computation graph for lazy evaluation then this should be mentioned in the docs. Minimal Complete Verifiable Example: What happened: ` What you expected to happen: No output or exceptions, as the result1 and result2 arrays are not printed or saved. Environment: <details<summaryOutput of <ttxr.showversions()</tt</summaryINSTALLED VERSIONS commit: None python: 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.10.15-arch1-1 machine: x8664 processor: byteorder: little LCALL: None LANG: enNZ.UTF-8 LOCALE: enNZ.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.2.1 numpy: 1.20.0 scipy: 1.6.0 netCDF4: 1.5.5.1 pydap: None h5netcdf: 0.9.0 h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nctime_axis: None PseudoNetCDF: None rasterio: 1.2.0 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 53.0.0 pip: 20.3.1 conda: None pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.3 </details

_MINCOUNT_DOCSTRING = """ min_count : int, default: None    The required number of valid values to perform the operation.    If fewer than min_count non-NA values are present the result will    be NA. New in version 0.10.8: Added with the default being None."""    The required number of valid values to perform the operation. If    fewer than min_count non-NA values are present the result will be    NA. Only used if skipna is set to True or defaults to True for the    array's dtype. New in version 0.10.8: Added with the default being    None. Changed in version 0.17.0: if specified on an integer array    and skipna=True, the result will be a float array."""  _COARSEN_REDUCE_DOCSTRING_TEMPLATE = """\ Coarsen this object by applying `{name}` along its dimensions.


Question: DataArrayCoarsen does not have a map or reduce function I'm trying to count unique samples when resampling to a square kilometre from a 5x5m input grid. I'd like to be able to apply the function with to give me a new dimension with the original integer values and their counts. In order to resample along spatial dimensions I assume I need to use , unfortunately the object does not yet implement either a or function for applying an arbitrary function when coarsening. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --outputs; N.B. has both and while has . Would it make sense for all three to have the same interface? <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (default, Sep 7 2019, 18:27:02) [Clang 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 19.3.0 machine: x8664 processor: i386 byteorder: little LCALL: None LANG: enAU.UTF-8 LOCALE: enAU.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.0 pandas: 1.0.0 numpy: 1.18.1 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nctime_axis: None PseudoNetCDF: None rasterio: 1.1.2 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.10.0 matplotlib: 3.1.2 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.0.3 conda: None pytest: 5.3.5 IPython: 7.11.1 sphinx: None </details

_reduce_extra_args_docstring = """"""      @classmethod    def _reduce_method(cls, func: Callable, include_skipna: bool, numeric_only: bool):    def _reduce_method(        cls, func: Callable, include_skipna: bool = False, numeric_only: bool = False    ):         """         Return a wrapped function for injecting reduction methods.         see ops.inject_reduce_methods


Question: DataArrayCoarsen does not have a map or reduce function I'm trying to count unique samples when resampling to a square kilometre from a 5x5m input grid. I'd like to be able to apply the function with to give me a new dimension with the original integer values and their counts. In order to resample along spatial dimensions I assume I need to use , unfortunately the object does not yet implement either a or function for applying an arbitrary function when coarsening. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --outputs; N.B. has both and while has . Would it make sense for all three to have the same interface? <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (default, Sep 7 2019, 18:27:02) [Clang 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 19.3.0 machine: x8664 processor: i386 byteorder: little LCALL: None LANG: enAU.UTF-8 LOCALE: enAU.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.0 pandas: 1.0.0 numpy: 1.18.1 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nctime_axis: None PseudoNetCDF: None rasterio: 1.1.2 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.10.0 matplotlib: 3.1.2 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.0.3 conda: None pytest: 5.3.5 IPython: 7.11.1 sphinx: None </details

return wrapped_func <ins>    def reduce(self, func: Callable, **kwargs):        """Reduce the items in this group by applying `func` along some        dimension(s).        Parameters        ----------        func : callable            Function which can be called in the form `func(x, axis, **kwargs)`            to return the result of collapsing an np.ndarray over the coarsening            dimensions.  It must be possible to provide the `axis` argument            with a tuple of integers.        **kwargs : dict            Additional keyword arguments passed on to `func`.        Returns        -------        reduced : DataArray            Array with summarized data.        Examples        --------        >>> da = xr.DataArray(np.arange(8).reshape(2, 4), dims=("a", "b"))        >>> coarsen = da.coarsen(b=2)        >>> coarsen.reduce(np.sum)        <xarray.DataArray (a: 2, b: 2)>        array([[ 1,  5],               [ 9, 13]])        Dimensions without coordinates: a, b        """        wrapped_func = self._reduce_method(func)        return wrapped_func(self, **kwargs)</ins>  class DatasetCoarsen(Coarsen):     __slots__ = ()


Question: DataArrayCoarsen does not have a map or reduce function I'm trying to count unique samples when resampling to a square kilometre from a 5x5m input grid. I'd like to be able to apply the function with to give me a new dimension with the original integer values and their counts. In order to resample along spatial dimensions I assume I need to use , unfortunately the object does not yet implement either a or function for applying an arbitrary function when coarsening. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --outputs; N.B. has both and while has . Would it make sense for all three to have the same interface? <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (default, Sep 7 2019, 18:27:02) [Clang 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 19.3.0 machine: x8664 processor: i386 byteorder: little LCALL: None LANG: enAU.UTF-8 LOCALE: enAU.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.0 pandas: 1.0.0 numpy: 1.18.1 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nctime_axis: None PseudoNetCDF: None rasterio: 1.1.2 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.10.0 matplotlib: 3.1.2 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.0.3 conda: None pytest: 5.3.5 IPython: 7.11.1 sphinx: None </details


Question: DataArrayCoarsen does not have a map or reduce function I'm trying to count unique samples when resampling to a square kilometre from a 5x5m input grid. I'd like to be able to apply the function with to give me a new dimension with the original integer values and their counts. In order to resample along spatial dimensions I assume I need to use , unfortunately the object does not yet implement either a or function for applying an arbitrary function when coarsening. <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --outputs; N.B. has both and while has . Would it make sense for all three to have the same interface? <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (default, Sep 7 2019, 18:27:02) [Clang 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 19.3.0 machine: x8664 processor: i386 byteorder: little LCALL: None LANG: enAU.UTF-8 LOCALE: enAU.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.0 pandas: 1.0.0 numpy: 1.18.1 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nctime_axis: None PseudoNetCDF: None rasterio: 1.1.2 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.10.0 matplotlib: 3.1.2 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.0.3 conda: None pytest: 5.3.5 IPython: 7.11.1 sphinx: None </details

return wrapped_func <ins>    def reduce(self, func: Callable, **kwargs):        """Reduce the items in this group by applying `func` along some        dimension(s).        Parameters        ----------        func : callable            Function which can be called in the form `func(x, axis, **kwargs)`            to return the result of collapsing an np.ndarray over the coarsening            dimensions.  It must be possible to provide the `axis` argument with            a tuple of integers.        **kwargs : dict            Additional keyword arguments passed on to `func`.        Returns        -------        reduced : Dataset            Arrays with summarized data.        """        wrapped_func = self._reduce_method(func)        return wrapped_func(self, **kwargs)</ins>  inject_reduce_methods(DataArrayCoarsen) inject_reduce_methods(DatasetCoarsen)


Question: Calling () drops coordinates This is a similar issue to bug . <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --Output (with extra stuff snipped for brevity): It's also worth mentioning that the data arrays contained in the dataset also loose their coordinates during this operation. I.E: <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (tags/v3.7.4:, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 11, GenuineIntel byteorder: little LCALL: None LANG: None LOCALE: None.None libhdf5: 1.10.5 libnetcdf: 4.7.2 xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.0.4.2 nctime_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.7.0 distributed: None matplotlib: 3.1.1 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.3 conda: None pytest: None IPython: 7.8.0 sphinx: None None </details

Dataset with this object's DataArrays replaced with new DataArrays             of summarized data and the indicated dimension(s) removed.         """<ins>        if "axis" in kwargs:            raise ValueError(                "passing 'axis' to Dataset reduce methods is ambiguous."                " Please use 'dim' instead."            )</ins>         if dim is None or dim is ...:             dims = set(self.dims)         elif isinstance(dim, str) or not isinstance(dim, Iterable):


Question: Calling () drops coordinates This is a similar issue to bug . <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --Output (with extra stuff snipped for brevity): It's also worth mentioning that the data arrays contained in the dataset also loose their coordinates during this operation. I.E: <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (tags/v3.7.4:, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 11, GenuineIntel byteorder: little LCALL: None LANG: None LOCALE: None.None libhdf5: 1.10.5 libnetcdf: 4.7.2 xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.0.4.2 nctime_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.7.0 distributed: None matplotlib: 3.1.1 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.3 conda: None pytest: None IPython: 7.8.0 sphinx: None None </details

)         )     def argmin(self, dim=None, axis=None, **kwargs):    def argmin(self, dim=None, **kwargs):         """Indices of the minima of the member variables.          If there are multiple minima, the indices of the first one found will be


Question: Calling () drops coordinates This is a similar issue to bug . <!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): --Output (with extra stuff snipped for brevity): It's also worth mentioning that the data arrays contained in the dataset also loose their coordinates during this operation. I.E: <detailsINSTALLED VERSIONS commit: None python: 3.7.4 (tags/v3.7.4:, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 11, GenuineIntel byteorder: little LCALL: None LANG: None LOCALE: None.None libhdf5: 1.10.5 libnetcdf: 4.7.2 xarray: 0.14.0 pandas: 0.25.2 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.0.4.2 nctime_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.7.0 distributed: None matplotlib: 3.1.1 cartopy: None seaborn: None numbagg: None setuptools: 40.8.0 pip: 19.3 conda: None pytest: None IPython: 7.8.0 sphinx: None None </details

this is deprecated, in future will be an error, since DataArray.argmin will             return a dict with indices for all dimensions, which does not make sense for             a Dataset.<del>        axis : int, optional            Axis over which to apply `argmin`. Only one of the 'dim' and 'axis' arguments            can be supplied.</del>         keep_attrs : bool, optional             If True, the attributes (`attrs`) will be copied from the original             object to the new one.  If False (default), the new object will be