home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

204 rows where user = 14371165 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: comments, draft, created_at (date), updated_at (date), closed_at (date)

type 2

  • pull 176
  • issue 28

state 2

  • closed 176
  • open 28

repo 1

  • xarray 204
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
2034500760 PR_kwDOAMm_X85hnplA 8536 Speed up localize Illviljan 14371165 open 0     2 2023-12-10T19:24:40Z 2024-05-04T20:20:01Z   MEMBER   1 pydata/xarray/pulls/8536
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8536/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2240600694 PR_kwDOAMm_X85shCWz 8933 Use array_api compliant dtype Illviljan 14371165 open 0     0 2024-04-12T17:30:51Z 2024-04-30T03:57:57Z   MEMBER   1 pydata/xarray/pulls/8933
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

Notes: * For duckarrays, use _dtype[_generic] * For actual np.ndarrays, use np.dtype[np.generic] * np.dtype is too specific in general and it's probably not needed in most of their array_api functions. * _DTypeBase-class in np? * Mixing dtypes from np and xp is discouraged: https://github.com/data-apis/array-api/issues/582 * Using asarray seems to be the recommended way.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8933/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1680031454 I_kwDOAMm_X85kIz7e 7780 mypy does not understand output of binary operations Illviljan 14371165 open 0     8 2023-04-23T13:38:55Z 2024-04-28T20:07:04Z   MEMBER      

What happened?

When doing operations on numpy arrays and xarray variables mypy does not understand that the output is always a xarray variable regardless of the order. See example.

What did you expect to happen?

mypy to pass for the example code.

Minimal Complete Verifiable Example

```Python import numpy as np import xarray as xr

x = np.array([1, 2, 4]) v = xr.Variable(["x"], x)

numpy first:

xv = x * v xv.values # error: "ndarray[Any, dtype[bool_]]" has no attribute "values" [attr-defined] if isinstance(xv, xr.Variable): xv.values

variable first:

vx = v * x vx.values if isinstance(vx, xr.Variable): vx.values ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

Seen in #7741

Environment

xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.9.16 (main, Mar 8 2023, 10:39:24) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: en libhdf5: 1.10.6 libnetcdf: None xarray: 2023.4.2 pandas: 2.0.0 numpy: 1.23.5 scipy: 1.10.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None iris: None bottleneck: None dask: 2023.4.0 distributed: 2023.4.0 matplotlib: 3.5.3 cartopy: None seaborn: 0.12.2 numbagg: None fsspec: 2023.4.0 cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 67.7.1 pip: 23.1.1 conda: 23.3.1 pytest: 7.3.1 mypy: 1.2.0 IPython: 8.12.0 sphinx: 6.1.3
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7780/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
2236408438 PR_kwDOAMm_X85sSjdN 8926 no untyped tests Illviljan 14371165 closed 0     2 2024-04-10T20:52:29Z 2024-04-14T16:15:45Z 2024-04-14T16:15:45Z MEMBER   1 pydata/xarray/pulls/8926
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8926/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2241095068 PR_kwDOAMm_X85sixE5 8935 Use Variable.stack instead of np.ravel Illviljan 14371165 open 0     1 2024-04-12T23:04:35Z 2024-04-13T08:27:13Z   MEMBER   1 pydata/xarray/pulls/8935
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8935/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2232134629 PR_kwDOAMm_X85sD5gg 8922 Add typing to some functions in indexing.py Illviljan 14371165 closed 0     0 2024-04-08T21:45:30Z 2024-04-10T18:05:52Z 2024-04-10T18:05:52Z MEMBER   0 pydata/xarray/pulls/8922

A drive-by PR as I was trying to figure out how these functions works.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8922/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1410608825 PR_kwDOAMm_X85A4RjC 7173 Add LineCollection plot Illviljan 14371165 open 0     1 2022-10-16T20:16:28Z 2024-04-07T20:26:44Z   MEMBER   1 pydata/xarray/pulls/7173

This adds a line plotter based on LineCollections, called .lines at the moment.

I wanted to replace darray.plot() with using LineCollection instead. But unfortunately due to how many cases are supported (and tested in xarray) darray.plot() will continue using plt.plot.

xref:

4820

5622

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7173/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2215113392 PR_kwDOAMm_X85rJ3wR 8889 Add typing to test_plot.py Illviljan 14371165 closed 0     0 2024-03-29T10:49:39Z 2024-04-05T16:42:27Z 2024-04-05T16:42:27Z MEMBER   0 pydata/xarray/pulls/8889

Enforce typing on all tests in test_plot.py and add the remaining type hints.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8889/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2215603817 I_kwDOAMm_X86ED25p 8892 ffill's tolerance argument can be strings Illviljan 14371165 open 0     1 2024-03-29T15:49:40Z 2024-04-02T01:50:34Z   MEMBER      

What happened?

ffill, bfill reindex etc. have tolerance arguments that also supports strings. And we test for it here:

https://github.com/pydata/xarray/blob/2120808bbe45f3d4f0b6a01cd43bac4df4039092/xarray/tests/test_groupby.py#L2016-L2025

But our typing assumes it's floats only: https://github.com/pydata/xarray/blob/2120808bbe45f3d4f0b6a01cd43bac4df4039092/xarray/core/resample.py#L69-L94

What did you expect to happen?

Since our pytests pass, mypy should pass as well.

Minimal Complete Verifiable Example

```python import numpy as np import pandas as pd

import xarray as xr

https://github.com/pydata/xarray/blob/2120808bbe45f3d4f0b6a01cd43bac4df4039092/xarray/tests/test_groupby.py#L2016

Test tolerance keyword for upsample methods bfill, pad, nearest

times = pd.date_range("2000-01-01", freq="1D", periods=2) times_upsampled = pd.date_range("2000-01-01", freq="6h", periods=5) array = xr.DataArray(np.arange(2), [("time", times)])

Forward fill

actual = array.resample(time="6h").ffill(tolerance="12h") expected = xr.DataArray([0.0, 0.0, 0.0, np.nan, 1.0], [("time", times_upsampled)]) xr.testing.assert_identical(expected, actual)

```

Environment

master

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8892/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
2215324218 PR_kwDOAMm_X85rKmW7 8890 Add typing to test_groupby.py Illviljan 14371165 closed 0     1 2024-03-29T13:13:59Z 2024-03-29T16:38:17Z 2024-03-29T16:38:16Z MEMBER   0 pydata/xarray/pulls/8890

Enforce typing on all tests in test_groupby.py and add the remaining type hints.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8890/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2203250238 PR_kwDOAMm_X85qh2s8 8867 Avoid in-place multiplication of a large value to an array with small integer dtype Illviljan 14371165 closed 0     3 2024-03-22T20:22:22Z 2024-03-29T15:26:38Z 2024-03-29T15:26:38Z MEMBER   0 pydata/xarray/pulls/8867

Upstream numpy has become a bit more particular with which types you can use for inplace operations. This PR fixes ``` __ TestImshow.test_imshow_rgb_values_in_valid_range __

self = <xarray.tests.test_plot.TestImshow object at 0x7f88320c2780>

def test_imshow_rgb_values_in_valid_range(self) -> None:
    da = DataArray(np.arange(75, dtype="uint8").reshape((5, 5, 3)))
    _, ax = plt.subplots()
  out = da.plot.imshow(ax=ax).get_array()

/home/runner/work/xarray/xarray/xarray/tests/test_plot.py:2034:


/home/runner/work/xarray/xarray/xarray/plot/accessor.py:421: in imshow return dataarray_plot.imshow(self._da, args, kwargs) /home/runner/work/xarray/xarray/xarray/plot/dataarray_plot.py:1601: in newplotfunc primitive = plotfunc( /home/runner/work/xarray/xarray/xarray/plot/dataarray_plot.py:1853: in imshow alpha = 255


self = masked_array( data=[[[1], [1], [1], [1], [1]],

    [[1],
     [1],
...,
     [1],
     [1],
     [1],
     [1]]],

mask=False, fill_value=np.int64(999999), dtype=uint8) other = 255

def __imul__(self, other):
    """
    Multiply self by other in-place.

    """
    m = getmask(other)
    if self._mask is nomask:
        if m is not nomask and m.any():
            self._mask = make_mask_none(self.shape, self.dtype)
            self._mask += m
    elif m is not nomask:
        self._mask += m
    other_data = getdata(other)
    other_data = np.where(self._mask, other_data.dtype.type(1), other_data)
  self._data.__imul__(other_data)

E numpy._core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'multiply' output from dtype('int64') to dtype('uint8') with casting rule 'same_kind'

/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/numpy/ma/core.py:4415: UFuncTypeError ```

Some curious behaviors seen while debugging: ```python alpha = np.array([1], dtype=np.int8) alpha *= 255 repr(alpha) # 'array([-1], dtype=int8)'

alpha = np.array([1], dtype=np.int16) alpha *= 255 repr(alpha) # 'array([255], dtype=int16)' ```

xref: #8844

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8867/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1718410975 I_kwDOAMm_X85mbN7f 7856 Unrecognized chunk manager dask - must be one of: [] Illviljan 14371165 closed 0     11 2023-05-21T08:07:57Z 2024-03-27T19:09:18Z 2023-05-24T16:26:20Z MEMBER      

What happened?

I have just updated my development branch of xarray to latest main. No other changes. When using .chunk() on a Variable xarray crashes.

What did you expect to happen?

No crash

Minimal Complete Verifiable Example

```Python import numpy as np import pandas as pd import xarray as xr

t_size = 8000 t = np.arange(t_size) var = xr.Variable(dims=("T",), data=np.random.randn(t_size)).chunk() ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

```Python Traceback (most recent call last):

File "C:\Users\J.W\AppData\Local\Temp\ipykernel_6480\4053253683.py", line 8, in <cell line: 8> var = xr.Variable(dims=("T",), data=np.random.randn(t_size)).chunk()

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\core\variable.py", line 1249, in chunk chunkmanager = guess_chunkmanager(chunked_array_type)

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\core\parallelcompat.py", line 87, in guess_chunkmanager raise ValueError(

ValueError: unrecognized chunk manager dask - must be one of: [] ```

Anything else we need to know?

Likely from #7019.

Environment

xr.show_versions() C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\_distutils_hack\__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") INSTALLED VERSIONS ------------------ commit: None python: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:30:19) [MSC v.1929 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: en LOCALE: ('Swedish_Sweden', '1252') libhdf5: 1.12.2 libnetcdf: 4.8.1 xarray: 2022.9.1.dev266+gbd01f9cc.d20221006 pandas: 1.5.2 numpy: 1.23.5 scipy: 1.9.3 netCDF4: 1.6.0 pydap: installed h5netcdf: 1.0.2 h5py: 3.7.0 Nio: None zarr: 2.13.2 cftime: 1.6.2 nc_time_axis: 1.4.1 PseudoNetCDF: 3.2.2 iris: 3.3.0 bottleneck: 1.3.5 dask: 2022.9.2 distributed: 2022.9.2 matplotlib: 3.6.2 cartopy: 0.21.0 seaborn: 0.13.0.dev0 numbagg: 0.2.1 fsspec: 2022.10.0 cupy: None pint: 0.19.2 sparse: 0.13.0 flox: 999 numpy_groupies: 0.9.14+22.g19c7601 setuptools: 65.5.1 pip: 22.3.1 conda: None pytest: 7.2.0 mypy: 1.2.0 IPython: 7.33.0 sphinx: 5.3.0
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7856/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
2184947713 PR_kwDOAMm_X85pjnvS 8831 Fix datetime in colorbar Illviljan 14371165 open 0     0 2024-03-13T21:48:44Z 2024-03-27T06:39:13Z   MEMBER   1 pydata/xarray/pulls/8831
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

python import xarray as xr airtemps = xr.tutorial.open_dataset("air_temperature") airtemps.air[:200].isel(lat=10, lon=10).plot.scatter(x="time", hue="time")

Before:

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8831/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2203493958 PR_kwDOAMm_X85qiskT 8868 Try ruff lint for numpy 2.0 Illviljan 14371165 closed 0     1 2024-03-22T23:31:04Z 2024-03-22T23:34:11Z 2024-03-22T23:33:03Z MEMBER   1 pydata/xarray/pulls/8868

From https://numpy.org/devdocs/numpy_2_0_migration_guide.html#numpy-2-migration-guide

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8868/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
962647570 MDExOlB1bGxSZXF1ZXN0NzA1NDA2NDY0 5678 Add typing to the OPTIONS dict Illviljan 14371165 closed 0     11 2021-08-06T11:21:02Z 2024-03-13T21:45:54Z 2021-08-19T22:15:23Z MEMBER   0 pydata/xarray/pulls/5678

This adds typing to the dict values. Using variables as keys is apparently not permitted by mypy so that part has been removed.

Attempts to fix issues found in #5662.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5678/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1684281101 PR_kwDOAMm_X85PKWFR 7787 Allow the label run-upstream to run upstream CI Illviljan 14371165 closed 0     6 2023-04-26T05:07:44Z 2024-03-13T21:44:50Z 2023-05-01T19:12:26Z MEMBER   0 pydata/xarray/pulls/7787

This PR makes it easier to trigger the upstream CI and creates a mypy test for upstream as well, but only when adding this label so that it doesn't mess with the scheduled runs and those results.

Noticed the need in #7786.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7787/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1418830429 PR_kwDOAMm_X85BT_a6 7194 Align naming convention with plt.subplots Illviljan 14371165 closed 0     1 2022-10-21T20:31:34Z 2024-03-13T21:44:17Z 2022-10-23T11:58:12Z MEMBER   0 pydata/xarray/pulls/7194

I noticed that the normal notation for fig, axs = plt.subplots(2, 1) wasn't used in facetgrid so did a quick find replace to change that. This feels better for my pedantic brain at least but I'm not sure it's worth the effort?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7194/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
807939559 MDExOlB1bGxSZXF1ZXN0NTczMDc1Mzkw 4909 Add dataarray scatter with 3d support Illviljan 14371165 closed 0     12 2021-02-14T11:15:50Z 2024-03-13T21:43:14Z 2021-07-17T21:07:31Z MEMBER   0 pydata/xarray/pulls/4909
  • [x] Closes #xxxx
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

Add scatter plots for dataarrays. Then later remove the dataset version and replace it with a thin wrapper in a similar fashion to #4820.

New stuff: - [x] Legend now displays colors and sizes in a similar fashion to Seaborn. - [x] New parameter z which allows 3d scatter plots.

Example: Using ds = xr.tutorial.scatter_example_dataset():

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4909/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1474717029 PR_kwDOAMm_X85EPeqM 7353 Add python 3.11 to CI Illviljan 14371165 closed 0     9 2022-12-04T11:12:01Z 2024-03-13T21:43:10Z 2023-05-28T09:58:40Z MEMBER   1 pydata/xarray/pulls/7353

Waiting on: - https://github.com/numba/numba/issues/8304 - https://github.com/numba/numba/issues/8841 - https://github.com/zarr-developers/numcodecs/issues/377 - https://github.com/Unidata/netcdf4-python/issues/1204 - https://github.com/h5py/h5py/issues/2146

  • [ ] Closes #7316
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

Feel free to push to this PR if you want.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7353/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1803788143 PR_kwDOAMm_X85VdjgR 7986 Add new what's new section Illviljan 14371165 closed 0     0 2023-07-13T21:29:01Z 2024-03-13T21:43:09Z 2023-07-13T21:30:07Z MEMBER   0 pydata/xarray/pulls/7986

Add a new what's new section

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7986/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1991435225 PR_kwDOAMm_X85fV3DW 8449 Use concise date format when plotting Illviljan 14371165 closed 0     2 2023-11-13T20:32:22Z 2024-03-13T21:41:34Z 2023-11-21T19:26:24Z MEMBER   0 pydata/xarray/pulls/8449
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

```python import matplotlib.pyplot as plt import xarray as xr

airtemps = xr.tutorial.open_dataset("air_temperature") air = airtemps.air - 273.15 air1d = air.isel(lat=10, lon=10)

plt.figure() air1d.plot() ``` Before:

After:

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8449/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1761952309 PR_kwDOAMm_X85TQlL1 7925 Remove hue_style from plot1d docstring Illviljan 14371165 closed 0     9 2023-06-17T18:33:11Z 2024-03-13T21:40:43Z 2023-07-13T23:17:48Z MEMBER   0 pydata/xarray/pulls/7925
  • [x] Closes #7907
  • [x] Closes #7908
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7925/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1797233538 I_kwDOAMm_X85rH5uC 7971 Pint errors on python 3.11 and windows Illviljan 14371165 closed 0     2 2023-07-10T17:44:51Z 2024-02-26T17:52:50Z 2024-02-26T17:52:50Z MEMBER      

What happened?

The CI seems to consistently crash on test_units.py now: =========================== short test summary info =========================== FAILED xarray/tests/test_units.py::TestVariable::test_aggregation[int32-method_max] - TypeError: no implementation found for 'numpy.max' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestVariable::test_aggregation[int32-method_min] - TypeError: no implementation found for 'numpy.min' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[float64-function_max] - TypeError: no implementation found for 'numpy.max' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[float64-function_min] - TypeError: no implementation found for 'numpy.min' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[int32-function_max] - TypeError: no implementation found for 'numpy.max' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[int32-function_min] - TypeError: no implementation found for 'numpy.min' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[int32-method_max] - TypeError: no implementation found for 'numpy.max' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_aggregation[int32-method_min] - TypeError: no implementation found for 'numpy.min' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_unary_operations[float64-round] - TypeError: no implementation found for 'numpy.round' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataArray::test_unary_operations[int32-round] - TypeError: no implementation found for 'numpy.round' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataset::test_aggregation[int32-method_max] - TypeError: no implementation found for 'numpy.max' on types that implement __array_function__: [<class 'pint.util.Quantity'>] FAILED xarray/tests/test_units.py::TestDataset::test_aggregation[int32-method_min] - TypeError: no implementation found for 'numpy.min' on types that implement __array_function__: [<class 'pint.util.Quantity'>] = 12 failed, 14880 passed, 1649 skipped, 146 xfailed, 68 xpassed, 574 warnings in 737.19s (0:12:17) = For more details: https://github.com/pydata/xarray/actions/runs/5438369625/jobs/9889561685?pr=7955

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7971/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
1948928294 PR_kwDOAMm_X85dGRAu 8330 Simplify get_axis_num Illviljan 14371165 closed 0     2 2023-10-18T06:15:57Z 2024-02-02T18:37:32Z 2024-02-02T18:37:32Z MEMBER   1 pydata/xarray/pulls/8330
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8330/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1916363233 PR_kwDOAMm_X85bYe7b 8241 Use strict type hinting for namedarray Illviljan 14371165 closed 0     4 2023-09-27T21:32:41Z 2024-02-02T18:12:22Z 2023-10-03T17:18:41Z MEMBER   0 pydata/xarray/pulls/8241

Towards the strict goal in #8239.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8241/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2038570344 PR_kwDOAMm_X85h1i2S 8547 Add overloads to get_axis_num Illviljan 14371165 closed 0     14 2023-12-12T21:23:41Z 2024-01-30T00:08:54Z 2024-01-30T00:08:54Z MEMBER   0 pydata/xarray/pulls/8547

Add overloads to .get_axis_num because you will get the same type out as you put in.

Seen in #8344.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8547/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1746734270 PR_kwDOAMm_X85SdWic 7902 Test array api protocol Illviljan 14371165 open 0     2 2023-06-07T21:50:55Z 2024-01-28T10:36:37Z   MEMBER   1 pydata/xarray/pulls/7902
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7902/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
    xarray 13221727 pull
1953053810 PR_kwDOAMm_X85dURGi 8344 Add mean to NamedArray._array_api Illviljan 14371165 open 0     8 2023-10-19T21:05:06Z 2023-12-19T17:49:22Z   MEMBER   1 pydata/xarray/pulls/8344
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8344/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2034462507 PR_kwDOAMm_X85hniLB 8535 Filter null values before plotting Illviljan 14371165 closed 0     3 2023-12-10T17:31:27Z 2023-12-13T15:44:55Z 2023-12-13T15:44:55Z MEMBER   0 pydata/xarray/pulls/8535

I noticed that seaborn's plot was responding much faster than xarray's version with the same data. Turn's out seaborn drops any nulls: https://github.com/mwaskom/seaborn/blob/056413d7393e3daec597d430c076e45938d53376/seaborn/relational.py#L399

  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8535/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2034545604 PR_kwDOAMm_X85hnyZ9 8538 Check that compat is equal to identical only once in dataset concat Illviljan 14371165 closed 0     1 2023-12-10T21:42:20Z 2023-12-13T09:27:11Z 2023-12-13T09:27:11Z MEMBER   0 pydata/xarray/pulls/8538

Small change to avoid triggering several if-checks unnecessarily.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8538/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1975221937 PR_kwDOAMm_X85efDP6 8407 Add expand_dims Illviljan 14371165 closed 0     5 2023-11-03T00:01:22Z 2023-12-12T20:54:45Z 2023-12-01T18:52:11Z MEMBER   0 pydata/xarray/pulls/8407

This allows adding a dimension of an array. Which is relevant when for example using keepdims in NamedArray.reduce.

Normally you can do this with None but that's not really allowed in the getitem documentation currently https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.array.getitem.html

Should follow the standard but with an additional dim argument, dim should be preferred over the axis argument. https://data-apis.org/array-api/draft/API_specification/generated/array_api.expand_dims.html

xref #8344, #8406

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8407/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1975173557 PR_kwDOAMm_X85ee4vk 8406 Add getitem to array protocol Illviljan 14371165 closed 0     0 2023-11-02T23:02:48Z 2023-12-12T20:54:00Z 2023-12-12T20:44:11Z MEMBER   0 pydata/xarray/pulls/8406

Currently using getitem is not allowed for either a arrayfunction or arrayapi according to the type hints. Add support for it.

Issues found in #8344 as more and more typing was added. But getitem is used in main as well which should fail, but manages to pass due to lack of type hints: https://github.com/pydata/xarray/blob/9acc411bc7e99e61269eadf77e96b9ddd40aec9e/xarray/namedarray/core.py#L792

Notes * mypy will now complain for _arrayapi[None] or _arrayapi([None,)], use xp.expand_dims(_arrayapi) for now instead.

https://github.com/numpy/numpy/pull/25022 https://github.com/data-apis/array-api/pull/687

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8406/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1936840711 PR_kwDOAMm_X85cdvXs 8294 Use shape and dtype as typevars in NamedArray Illviljan 14371165 closed 0     9 2023-10-11T05:08:32Z 2023-12-12T20:41:29Z 2023-10-18T06:22:52Z MEMBER   0 pydata/xarray/pulls/8294

Using a different TypeVar strategy compared to #8281. The idea here is to typevar shape and dtype instead, just like numpy does.

Previously I tried to use the _data array as the TypeVar but that causes all kinds of issues since TypeVar is usually invariant and can't be updated to a new type. Since the dtype changes very frequently when doing array operations it quickly gets difficult to pass along the correct typing.

  • This PR adds a from_array function. The intention is to use that function to create NamedArrays when you are passing around ArrayLikes. The init for NamedArray will now just assume the input data is correct. At runtime at least, mypy will catch any non-supported array types. There's some precedent to this:
  • numpy.array_api.Array forces to use xp.asarray.
  • Cubed assumes the inputs are correct. Has a xp.asarray and a from_array function.
  • The ugly fastpath argument is therefore not needed.
  • Adds a bunch of type hint classes, duckarray[ShapeType, DType] (corresponding to np.ndarray) or DuckArray[ScalarType] (corresponding to np.typing.NDArray) are the recommended ones.
  • It's better to use these kinds of classes over creating is_duck_array functions with typeguards because isinstance also works on the else clause.
  • This PR adds some array_api functions, the idea here is that NamedArray could also be array_api compliant.

  • [x] Tests added

  • [x] Closes #8291

References: https://github.com/tomwhite/cubed/blob/ea885193dd37d27917a24878b51bb086aaef5fb1/cubed/core/ops.py#L34 https://stackoverflow.com/questions/74633074/how-to-type-hint-a-generic-numpy-array https://numpy.org/doc/stable/reference/arrays.scalars.html#scalars https://github.com/numpy/numpy/blob/040ed2dc9847265c581a342301dd87d2b518a3c2/numpy/init.pyi#L1423 https://github.com/numpy/numpy/blob/040ed2dc9847265c581a342301dd87d2b518a3c2/numpy/_typing/_array_like.py#L32 https://stackoverflow.com/questions/69186176/determine-if-subclass-has-a-base-classs-method-implemented-in-python

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8294/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1966953477 PR_kwDOAMm_X85eC9NL 8391 Add duckarray test for np.array_api Illviljan 14371165 closed 0     0 2023-10-29T11:37:29Z 2023-12-06T22:30:04Z 2023-10-31T03:05:23Z MEMBER   0 pydata/xarray/pulls/8391

Check if the Array object from numpy.array_api is a valid duckarray. If it isn't we're likely doing something wrong.

Comments: * array_api standard does not specify a __array__-method. * Move __array__ to _arrayfunction only * We therefore have to use np.asarray(namedarray.data) when comparing ndarrays in the tests

Seen in #8344

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8391/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1971126897 PR_kwDOAMm_X85eRLVH 8396 Test masked array Illviljan 14371165 closed 0     0 2023-10-31T19:00:35Z 2023-11-03T15:07:35Z 2023-11-03T15:07:34Z MEMBER   0 pydata/xarray/pulls/8396

Add a test for masked array in order to make sure it works. Be consistent and use the shapetype dtype generics style instead.

Starting to think it's easier to just stick to one style of typing, even though the other option might be a little shorter.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8396/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1971001432 PR_kwDOAMm_X85eQvnS 8395 Correct typing for _sparsearray Illviljan 14371165 closed 0     0 2023-10-31T17:50:47Z 2023-10-31T19:28:49Z 2023-10-31T19:28:49Z MEMBER   0 pydata/xarray/pulls/8395

Use _DType_co instead, otherwise the dtype wont be correctly passed along. Quick follow up to #8387.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8395/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1966603230 PR_kwDOAMm_X85eB5WY 8387 Fix sparse typing Illviljan 14371165 closed 0     0 2023-10-28T13:50:08Z 2023-10-31T17:43:58Z 2023-10-31T17:43:57Z MEMBER   0 pydata/xarray/pulls/8387

Fixes the following pyright error on main:

C:\Users\J.W\Documents\GitHub\xarray\xarray\namedarray\core.py:846:39 - error: Argument of type "NDArray[Any]" cannot be assigned to parameter "data" of type "duckarray[_ShapeType_co@NamedArray, _DType_co@NamedArray] | Default" in function "_replace"   Type "NDArray[Any]" cannot be assigned to type "duckarray[_ShapeType_co@NamedArray, _DType_co@NamedArray] | Default"     "NDArray[Any]" is incompatible with protocol "_arrayfunction[_ShapeType_co@NamedArray, _DType_co@NamedArray]"       Type "(dtype: None = ..., /) -> ndarray[Any, _dtype]" cannot be assigned to type "(dtype: _DType@__array__, /) -> ndarray[Any, _DType@__array__]"         Parameter 1: type "_DType@__array__" cannot be assigned to type "None"           Type cannot be assigned to type "None"       Type "(dtype: None = ..., /) -> ndarray[Any, _dtype]" cannot be assigned to type "(dtype: _DType@__array__, /) -> ndarray[Any, _DType@__array__]"         Parameter 1: type "_DType@__array__" cannot be assigned to type "None"           Type cannot be assigned to type "None" ... (reportGeneralTypeIssues)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8387/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1966902041 PR_kwDOAMm_X85eCzIK 8390 Remove duplicated navigation_with_keys in docs config Illviljan 14371165 closed 0     0 2023-10-29T08:52:56Z 2023-10-29T11:08:33Z 2023-10-29T11:08:33Z MEMBER   0 pydata/xarray/pulls/8390

Fixes:

``` Running Sphinx v6.2.1

Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/8387/lib/python3.10/site-packages/sphinx/config.py", line 353, in eval_config_file code = compile(f.read(), filename.encode(fs_encoding), 'exec') File "/home/docs/checkouts/readthedocs.org/user_builds/xray/checkouts/8387/doc/conf.py", line 240 navigation_with_keys=False, ^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: keyword argument repeated: navigation_with_keys

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/8387/lib/python3.10/site-packages/sphinx/cmd/build.py", line 280, in build_main app = Sphinx(args.sourcedir, args.confdir, args.outputdir, File "/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/8387/lib/python3.10/site-packages/sphinx/application.py", line 207, in init self.config = Config.read(self.confdir, confoverrides or {}, self.tags) File "/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/8387/lib/python3.10/site-packages/sphinx/config.py", line 177, in read namespace = eval_config_file(filename, tags) File "/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/8387/lib/python3.10/site-packages/sphinx/config.py", line 357, in eval_config_file raise ConfigError(msg % err) from err sphinx.errors.ConfigError: There is a syntax error in your configuration file: keyword argument repeated: navigation_with_keys (conf.py, line 240)

Configuration error: There is a syntax error in your configuration file: keyword argument repeated: navigation_with_keys (conf.py, line 240) Command time: 0s Return: 2

```

Seen in #8387

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8390/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1966567753 PR_kwDOAMm_X85eBydo 8386 Use get_args for duckarray checks Illviljan 14371165 closed 0     1 2023-10-28T11:58:57Z 2023-10-28T12:46:10Z 2023-10-28T12:45:32Z MEMBER   1 pydata/xarray/pulls/8386

xref: #8376

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8386/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1962432308 PR_kwDOAMm_X85dzwDL 8376 Add chunkedduckarray to _typing Illviljan 14371165 closed 0     0 2023-10-25T23:09:46Z 2023-10-26T19:10:41Z 2023-10-26T01:13:54Z MEMBER   0 pydata/xarray/pulls/8376

Add more chunkedarray typing options. Also clean up some ideas that didn't work out. Using TypeVar for arrays for example has turned out to not work that great because of the very common dtype changes.

If you want to check if an ArrayLike is a chunked array: python if isinstance(data, _chunkedarrayfunction_or_api): data.chunk() However try to rely on mypy in private functions over isinstance checks for better performance: python def _do_compute(data: chunkedduckarray[Any, _DType]) -> duckarray[Any, _DType]: return data.compute()

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8376/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1957838652 PR_kwDOAMm_X85dkPUb 8362 NamedArray.ndim can only be int Illviljan 14371165 closed 0     0 2023-10-23T19:02:48Z 2023-10-23T19:04:14Z 2023-10-23T19:04:14Z MEMBER   0 pydata/xarray/pulls/8362

ndim is usually defined as len(self.shape), which does not care about the values in the shape-tuple. So there's no risk when getting unknown shape sizes from for example a masked dask array.

Reference: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.ndim.html

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8362/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1955651132 PR_kwDOAMm_X85dc-58 8355 Use namedarray repr in _array_api docstrings Illviljan 14371165 closed 0     0 2023-10-21T20:20:31Z 2023-10-22T04:50:30Z 2023-10-22T00:52:03Z MEMBER   0 pydata/xarray/pulls/8355

Use the normal repr now that NamedArray has one.
Noticed a bug as well, that sometimes the repr attempts to call NamedArray._in_memory which doesn't exist.

Seen in #8344.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8355/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1955654332 PR_kwDOAMm_X85dc_gm 8356 Remove unnecessary for loop when using get_axis_num Illviljan 14371165 closed 0     0 2023-10-21T20:33:37Z 2023-10-22T04:50:16Z 2023-10-22T00:49:39Z MEMBER   0 pydata/xarray/pulls/8356

Noticed an unnecessary for loop when playing around with self.get_axis_num in #8344.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8356/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1954723109 PR_kwDOAMm_X85dZ9lj 8352 Add better ASV test cases for open_dataset Illviljan 14371165 closed 0     0 2023-10-20T17:12:29Z 2023-10-20T18:34:36Z 2023-10-20T18:34:35Z MEMBER   0 pydata/xarray/pulls/8352

With more realistic array sizes maybe the improvements in #8339 should be noticeable.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8352/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1946069214 PR_kwDOAMm_X85c8hTY 8320 Remove redundant check in IndexVariable Illviljan 14371165 closed 0     0 2023-10-16T20:50:19Z 2023-10-17T16:41:32Z 2023-10-17T16:41:32Z MEMBER   0 pydata/xarray/pulls/8320

Reverts a few things from #8313. An IndexVariable can only have PandasIndexAdapter as self._data, which makes the for MemoryCachedArray unnecessary.

Seen in #8294.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8320/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1944068053 PR_kwDOAMm_X85c1sC5 8314 Align MemoryCachedArray and PandasIndexingAdapter more Illviljan 14371165 closed 0     1 2023-10-15T21:42:27Z 2023-10-16T20:01:21Z 2023-10-16T20:01:20Z MEMBER   0 pydata/xarray/pulls/8314

Seen in #8294.

The issue is the IndexVariable, ExplicitlyIndexedNDArrayMixin lacks .array which is required for IndexVariable, and therefore we need a new minimal class that are common between the two.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8314/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1944059054 PR_kwDOAMm_X85c1qR0 8312 Fix typing issues in tests Illviljan 14371165 closed 0     1 2023-10-15T21:11:12Z 2023-10-16T15:09:57Z 2023-10-16T15:09:57Z MEMBER   0 pydata/xarray/pulls/8312

Seen in #8294.

These tests implicitly made sure the type was correct in a way that type checkers wont understand. Make it explicit instead.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8312/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1944067022 PR_kwDOAMm_X85c1r1z 8313 Reverse type checks for better type inheritance Illviljan 14371165 closed 0     0 2023-10-15T21:38:59Z 2023-10-16T06:30:55Z 2023-10-16T06:30:55Z MEMBER   0 pydata/xarray/pulls/8313

Seen in #8294.

It's usually better to switch if-checks so that the wider type is defined first. Especially when relying on the implicit type casting like we do here.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8313/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1944083743 PR_kwDOAMm_X85c1vGB 8315 Handle numpy missing the array api function astype Illviljan 14371165 closed 0     1 2023-10-15T22:32:17Z 2023-10-16T06:25:20Z 2023-10-16T06:25:19Z MEMBER   0 pydata/xarray/pulls/8315

This is how our get_array_namespace works: https://github.com/pydata/xarray/blob/dafd726c36e24ac77427513a4a149a6933353b66/xarray/core/duck_array_ops.py#L44-L48

Which usually works. But not for astype.

Using np.array_api doesn't work because you have to use np.array_api.Array instead of np.ndarray:

```python import numpy.array_api as nxp nxp.astype(np.array([1, 2,]), np.dtype(float))

Traceback (most recent call last):

File "C:\Users\J.W\AppData\Local\Temp\ipykernel_8616\23329947.py", line 1, in <cell line: 1> nxp.astype(np.array([1, 2,]), np.dtype(float))

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\numpy\array_api_data_type_functions.py", line 20, in astype return Array._new(x._array.astype(dtype=dtype, copy=copy))

AttributeError: 'numpy.ndarray' object has no attribute '_array' ```

I found it simpler to just change astype here.

An alternative solution would be to use: https://github.com/data-apis/array-api-compat https://github.com/tomwhite/cubed/pull/317

Seen in #8294.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8315/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1938790253 PR_kwDOAMm_X85ckfW9 8295 Remove real, imag, astype methods from NamedArray Illviljan 14371165 closed 0     1 2023-10-11T21:44:26Z 2023-10-13T15:58:07Z 2023-10-13T15:58:06Z MEMBER   0 pydata/xarray/pulls/8295

These methods are not in the Array API. Instead convert the methods to functions in similar fashion as the array api.

https://data-apis.org/array-api/latest/API_specification/index.html

Not sure how to handle array compliant functions with an axis argument (max for example) but that's for a future PR.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8295/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1931329996 PR_kwDOAMm_X85cK3Or 8281 Add high level from_array function in namedarray Illviljan 14371165 closed 0     1 2023-10-07T12:19:23Z 2023-10-10T17:10:37Z 2023-10-10T17:10:37Z MEMBER   1 pydata/xarray/pulls/8281

The Idea is to avoid as much normalization in the NamedArray class as possible. Different types are handled before initializing instead.

  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

References: https://github.com/tomwhite/cubed/blob/ea885193dd37d27917a24878b51bb086aaef5fb1/cubed/core/ops.py#L34 https://stackoverflow.com/questions/74633074/how-to-type-hint-a-generic-numpy-array https://numpy.org/doc/stable/reference/arrays.scalars.html#scalars https://github.com/numpy/numpy/blob/040ed2dc9847265c581a342301dd87d2b518a3c2/numpy/init.pyi#L1423 https://github.com/numpy/numpy/blob/040ed2dc9847265c581a342301dd87d2b518a3c2/numpy/_typing/_array_like.py#L32

Mypy issues: https://github.com/python/typing/issues/548

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8281/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1931220385 PR_kwDOAMm_X85cKhhk 8279 Add pyright type checker Illviljan 14371165 closed 0     5 2023-10-07T06:38:14Z 2023-10-09T12:32:29Z 2023-10-09T12:32:28Z MEMBER   0 pydata/xarray/pulls/8279

It can be helpful to get a second opinion from another typer checker than mypy.

The CI activates when the run-pyright label is added.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8279/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1931223548 PR_kwDOAMm_X85cKiKo 8280 Remove if condition to trigger mypy Illviljan 14371165 closed 0     0 2023-10-07T06:49:18Z 2023-10-08T00:49:34Z 2023-10-08T00:49:34Z MEMBER   0 pydata/xarray/pulls/8280

This seems to be fixed according to #6551.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8280/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1903465587 PR_kwDOAMm_X85atB8W 8211 Add T_DuckArray to DataArray Illviljan 14371165 open 0     0 2023-09-19T17:48:11Z 2023-10-03T17:45:40Z   MEMBER   1 pydata/xarray/pulls/8211
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8211/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1903622707 PR_kwDOAMm_X85atj9b 8214 Bind T_DuckArray to Variable Illviljan 14371165 open 0     0 2023-09-19T19:42:34Z 2023-10-03T17:40:26Z   MEMBER   1 pydata/xarray/pulls/8214
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8214/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1916447957 PR_kwDOAMm_X85bYxsO 8243 Add type hints to maybe_promote in dtypes.py Illviljan 14371165 closed 0     0 2023-09-27T22:53:34Z 2023-09-28T19:39:56Z 2023-09-28T19:39:55Z MEMBER   0 pydata/xarray/pulls/8243

Reducing type errors in #8241

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8243/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1916331957 PR_kwDOAMm_X85bYX4z 8240 Bind T_DuckArray to NamedArray Illviljan 14371165 closed 0     1 2023-09-27T21:11:58Z 2023-09-28T16:18:26Z 2023-09-28T16:18:26Z MEMBER   0 pydata/xarray/pulls/8240

Binding allows typing the .data property.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8240/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1909448043 PR_kwDOAMm_X85bBQuc 8226 Add typing to functions related to data_vars Illviljan 14371165 closed 0     0 2023-09-22T19:54:22Z 2023-09-24T14:03:55Z 2023-09-24T14:03:55Z MEMBER   0 pydata/xarray/pulls/8226

A smaller PR related to trying to pass T_DuckArray's along xarray's different classes.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8226/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1901520970 PR_kwDOAMm_X85amcNE 8203 Add T_DuckArray type hint to Variable.data Illviljan 14371165 closed 0     3 2023-09-18T18:33:50Z 2023-09-19T17:41:28Z 2023-09-19T15:23:25Z MEMBER   0 pydata/xarray/pulls/8203

The typing of Variable.data has been the very wide Variable.data: Any because of the difficulties defining the typing of a duckarray.

This has led to confusion in downstream functions that uses .data. Sometimes arguments uses Any, np.typing.ArrayLike, np.ndarray or dask array typing which is unnecessarily narrow when xarray also supports for example sparse arrays or cupy arrays.

This PR is a start at cleaning this up by defining a T_DuckArray typevar that symbolizes an array api compliant array.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8203/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1691206894 I_kwDOAMm_X85kzcTu 7802 Mypy errors with matplotlib 3.8 Illviljan 14371165 closed 0     6 2023-05-01T19:03:51Z 2023-09-17T05:03:00Z 2023-09-17T05:02:59Z MEMBER      

Matplotlib has started to support typing in main (https://github.com/matplotlib/matplotlib/issues/20504) and mypy is throwing a few errors:

``` xarray/core/options.py:12: error: Cannot assign to a type [misc] xarray/core/options.py:12: error: Incompatible types in assignment (expression has type "Type[str]", variable has type "Type[Colormap]") [assignment] xarray/plot/utils.py:808: error: Argument 1 to "set_xticks" of "_AxesBase" has incompatible type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]"; expected "Iterable[float]" [arg-type] xarray/plot/utils.py:810: error: Argument 1 to "set_yticks" of "_AxesBase" has incompatible type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]"; expected "Iterable[float]" [arg-type] xarray/plot/utils.py:813: error: Argument 1 to "set_xlim" of "_AxesBase" has incompatible type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]"; expected "Union[float, Tuple[float, float], None]" [arg-type] xarray/plot/utils.py:815: error: Argument 1 to "set_ylim" of "_AxesBase" has incompatible type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]"; expected "Union[float, Tuple[float, float], None]" [arg-type] Generated Cobertura report: /home/runner/work/xarray/xarray/mypy_report/cobertura.xml Installing missing stub packages: /home/runner/micromamba-root/envs/xarray-tests/bin/python -m pip install types-Pillow types-PyYAML types-Pygments types-babel types-colorama types-paramiko types-psutil types-pytz types-pywin32 types-setuptools types-urllib3 Generated Cobertura report: /home/runner/work/xarray/xarray/mypy_report/cobertura.xml Found 154 errors in 10 files (checked 138 source files) xarray/plot/utils.py:1349: error: Unsupported operand types for * ("_SupportsArray[dtype[Any]]" and "float") [operator] xarray/plot/utils.py:1349: error: Unsupported operand types for * ("_NestedSequence[_SupportsArray[dtype[Any]]]" and "float") [operator] xarray/plot/utils.py:1349: error: Unsupported operand types for * ("_NestedSequence[Union[bool, int, float, complex, str, bytes]]" and "float") [operator] xarray/plot/utils.py:1349: note: Left operand is of type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" xarray/plot/utils.py:1349: error: Unsupported operand types for * ("str" and "float") [operator] xarray/plot/utils.py:1349: error: Unsupported operand types for * ("bytes" and "float") [operator] xarray/plot/utils.py:1350: error: Item "_SupportsArray[dtype[Any]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "int" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "float" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "complex" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "str" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "bytes" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1350: error: Item "_NestedSequence[Union[bool, int, float, complex, str, bytes]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "_SupportsArray[dtype[Any]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "int" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "float" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "complex" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "str" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "bytes" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/utils.py:1351: error: Item "_NestedSequence[Union[bool, int, float, complex, str, bytes]]" of "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" has no attribute "mask" [union-attr] xarray/plot/facetgrid.py:684: error: "FigureCanvasBase" has no attribute "get_renderer" [attr-defined] xarray/plot/accessor.py:182: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:182: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:309: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:309: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:428: error: Overloaded function implementation cannot produce return type of signature 2 [misc] xarray/plot/accessor.py:428: error: Overloaded function implementation cannot produce return type of signature 3 [misc] xarray/plot/accessor.py:433: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:433: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:552: error: Overloaded function implementation cannot produce return type of signature 2 [misc] xarray/plot/accessor.py:552: error: Overloaded function implementation cannot produce return type of signature 3 [misc] xarray/plot/accessor.py:557: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:557: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:676: error: Overloaded function implementation cannot produce return type of signature 2 [misc] xarray/plot/accessor.py:676: error: Overloaded function implementation cannot produce return type of signature 3 [misc] xarray/plot/accessor.py:681: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:681: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:800: error: Overloaded function implementation cannot produce return type of signature 2 [misc] xarray/plot/accessor.py:800: error: Overloaded function implementation cannot produce return type of signature 3 [misc] xarray/plot/accessor.py:948: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:948: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:1075: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:1075: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/accessor.py:1190: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/accessor.py:1190: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:324: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:324: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:478: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:478: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "x" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "y" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "u" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "v" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "density" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "linewidth" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "color" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "cmap" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "norm" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "arrowsize" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "arrowstyle" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "minlength" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "transform" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "zorder" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "start_points" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "maxlength" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "integration_direction" [misc] xarray/plot/dataset_plot.py:649: error: Function gets multiple values for keyword argument "broken_streamlines" [misc] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[float, Tuple[float, float]]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[str, Colormap, None]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[str, Normalize, None]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "float" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[str, ArrowStyle]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Optional[Transform]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Optional[float]" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "Literal['forward', 'backward', 'both']" [arg-type] xarray/plot/dataset_plot.py:649: error: Argument 1 has incompatible type "*List[ndarray[Any, Any]]"; expected "bool" [arg-type] xarray/plot/dataset_plot.py:751: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataset_plot.py:751: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:718: error: Incompatible return value type (got "Tuple[Union[ndarray[Any, Any], List[ndarray[Any, Any]]], ndarray[Any, Any], Union[BarContainer, Polygon, List[Union[BarContainer, Polygon]]]]", expected "Tuple[ndarray[Any, Any], ndarray[Any, Any], BarContainer]") [return-value] xarray/plot/dataarray_plot.py:996: error: "Axes" has no attribute "view_init" [attr-defined] xarray/plot/dataarray_plot.py:1106: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:1106: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[Sequence[Union[Union[Tuple[float, float, float], str], Union[str, Tuple[float, float, float, float], Tuple[Union[Tuple[float, float, float], str], float], Tuple[Tuple[float, float, float, float], float]]]], Union[Union[Tuple[float, float, float], str], Union[str, Tuple[float, float, float, float], Tuple[Union[Tuple[float, float, float], str], float], Tuple[Tuple[float, float, float, float], float]]], None]" [arg-type] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Optional[Union[str, Path, MarkerStyle]]" [arg-type] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[str, Colormap, None]" [arg-type] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[str, Normalize, None]" [arg-type] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Optional[float]" [arg-type] xarray/plot/dataarray_plot.py:1261: error: Argument 1 to "scatter" of "Axes" has incompatible type "*List[ndarray[Any, Any]]"; expected "Union[float, Sequence[float], None]" [arg-type] xarray/plot/dataarray_plot.py:1615: error: "Axes" has no attribute "set_zlabel" [attr-defined] xarray/plot/dataarray_plot.py:1655: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:1655: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:1874: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:1874: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:2010: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:2010: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:2146: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:2146: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc] xarray/plot/dataarray_plot.py:2464: error: "Axes" has no attribute "plot_surface" [attr-defined] xarray/tests/test_plot.py:427: error: Value of type "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]" is not indexable [index] xarray/tests/test_plot.py:443: error: Module has no attribute "viridis" [attr-defined] xarray/tests/test_plot.py:457: error: "None" not callable [misc] xarray/tests/test_plot.py:462: error: "None" not callable [misc] xarray/tests/test_plot.py:465: error: "None" not callable [misc] xarray/tests/test_plot.py:471: error: Module has no attribute "viridis" [attr-defined] xarray/tests/test_plot.py:477: error: Module has no attribute "viridis" [attr-defined] xarray/tests/test_plot.py:482: error: Module has no attribute "viridis" [attr-defined] xarray/tests/test_plot.py:486: error: Module has no attribute "viridis" [attr-defined] xarray/tests/test_plot.py:493: error: "None" not callable [misc] xarray/tests/test_plot.py:498: error: "None" not callable [misc] xarray/tests/test_plot.py:501: error: "None" not callable [misc] xarray/tests/test_plot.py:931: error: Module has no attribute "magma" [attr-defined] xarray/tests/test_plot.py:933: error: Module has no attribute "magma" [attr-defined] xarray/tests/test_plot.py:1173: error: Module has no attribute "RdBu" [attr-defined] xarray/tests/test_plot.py:1746: error: Item "Colormap" of "Optional[Colormap]" has no attribute "colors" [union-attr] xarray/tests/test_plot.py:1746: error: Item "None" of "Optional[Colormap]" has no attribute "colors" [union-attr] xarray/tests/test_plot.py:1747: error: Item "Colormap" of "Optional[Colormap]" has no attribute "colors" [union-attr] xarray/tests/test_plot.py:1747: error: Item "None" of "Optional[Colormap]" has no attribute "colors" [union-attr] xarray/tests/test_plot.py:1749: error: Item "Colormap" of "Optional[Colormap]" has no attribute "_rgba_over" [union-attr] xarray/tests/test_plot.py:1749: error: Item "None" of "Optional[Colormap]" has no attribute "_rgba_over" [union-attr] xarray/tests/test_plot.py:1801: error: Item "None" of "Optional[ndarray[Any, Any]]" has no attribute "size" [union-attr] xarray/tests/test_plot.py:1952: error: Item "None" of "Optional[ndarray[Any, Any]]" has no attribute "min" [union-attr] xarray/tests/test_plot.py:1952: error: Item "None" of "Optional[ndarray[Any, Any]]" has no attribute "max" [union-attr] xarray/tests/test_plot.py:1968: error: Item "None" of "Optional[ndarray[Any, Any]]" has no attribute "dtype" [union-attr] xarray/tests/test_plot.py:1969: error: Value of type "Optional[ndarray[Any, Any]]" is not indexable [index] xarray/tests/test_plot.py:2125: error: "Artist" has no attribute "get_clim" [attr-defined] xarray/tests/test_plot.py:2135: error: "Colorbar" has no attribute "vmin" [attr-defined] xarray/tests/test_plot.py:2136: error: "Colorbar" has no attribute "vmax" [attr-defined] xarray/tests/test_plot.py:2202: error: "Artist" has no attribute "get_clim" [attr-defined] xarray/tests/test_plot.py:2218: error: "Artist" has no attribute "norm" [attr-defined] xarray/tests/test_plot.py:2747: error: Item "_AxesBase" of "Optional[_AxesBase]" has no attribute "legend_" [union-attr] xarray/tests/test_plot.py:2747: error: Item "None" of "Optional[_AxesBase]" has no attribute "legend_" [union-attr] xarray/tests/test_plot.py:2754: error: Item "None" of "Optional[_AxesBase]" has no attribute "get_legend" [union-attr] xarray/tests/test_plot.py:2775: error: Item "None" of "Optional[FigureBase]" has no attribute "axes" [union-attr] xarray/tests/test_plot.py:2775: error: Argument 1 to "len" has incompatible type "Union[_AxesBase, None, Any]"; expected "Sized" [arg-type] xarray/tests/test_plot.py:2803: error: Module has no attribute "dates" [attr-defined] xarray/tests/test_plot.py:2812: error: Module has no attribute "dates" [attr-defined] xarray/tests/test_plot.py:2831: error: Item "None" of "Optional[_AxesBase]" has no attribute "xaxis" [union-attr] xarray/tests/test_plot.py:2831: error: Module has no attribute "dates" [attr-defined] xarray/tests/test_groupby.py:715: error: Argument 1 to "groupby" of "Dataset" has incompatible type "ndarray[Any, dtype[signedinteger[Any]]]"; expected "Union[Hashable, DataArray, IndexVariable]" [arg-type] xarray/tests/test_groupby.py:715: note: Following member(s) of "ndarray[Any, dtype[signedinteger[Any]]]" have conflicts: xarray/tests/test_groupby.py:715: note: __hash__: expected "Callable[[], int]", got "None" xarray/tests/test_dataset.py:6964: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataset.py:6965: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataset.py:7007: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataset.py:7008: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataarray.py:6687: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataarray.py:6689: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataarray.py:6735: error: "PlainQuantity[Any]" not callable [operator] xarray/tests/test_dataarray.py:6737: error: "PlainQuantity[Any]" not callable [operator] ```

Some guidance how to solve these:

  • [xy]ticks in mpl is currently overly narrowly type hinted because I was following the docstring, but I agree that ArrayLike is a better type hint for that, plan on updating (including the docstring) upstream
  • [xy]lim originally neglected the case of passing set_xlim((min, max)) as a tuple, but that has been updated. xarray has that type hinted as array like, but mpl has it hinted as a 2-tuple (I think it is currently still of floats, but may be expanded as we more directly address units/categoricals/etc). Willing to debate here, but my starting position is that the "exactly 2 values" is valuable info here, and I think tuple is the only way to do that.
  • get_renderer is not actually available on all of our backends, we should maybe see if there is a more preferred way of doing what you are doing here that will work for all backends, but haven't looked into it too closely.
  • Module has no attribute <colormap> is another instance of dynamically generated behavior which can't be statically type checked (elegantly, at least), can probably be replaced by mpl.colormaps["<colormap>"] in many cases, which is statically typecheckable
  • Anything to do with 3D Axes is not type hinted, perhaps ignore for now (or help us get that type hinted adequately, but it is relatively low priority currently)
  • Module has no attribute "dates" we don't currently type hint dates/units things, but it is on my mind, not sure yet if it will be in first release or not though (may at least put a placeholder that gets rid of this error, but treats everything as "Any").

Originally posted by @ksunden in https://github.com/pydata/xarray/issues/7787#issuecomment-1523743471

The suggestion from mpl (specifically @tacaswell) was to use constrained layout for the purpose that xarray currently uses get_renderer, this will ensure that the facetgrid works with all mpl backends.

Originally posted by @ksunden in https://github.com/pydata/xarray/issues/7787#issuecomment-1528091492

I'm also relatively sure that if you are willing to put a floor on the version of Matplotlib you support get_window_extent will use it's internally cached renderer (and when we make it uniformly optional we also fixed the cache invalidation logic).

Originally posted by @tacaswell in https://github.com/pydata/xarray/issues/7787#issuecomment-1528096647

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7802/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
1890927857 PR_kwDOAMm_X85aC50x 8172 Don't try to sort hashable, map to string Illviljan 14371165 closed 0     0 2023-09-11T17:10:22Z 2023-09-11T18:09:15Z 2023-09-11T18:09:15Z MEMBER   0 pydata/xarray/pulls/8172

Fixes the mypy error we're seeing in the CI at the moment:

xarray/core/dataset.py:5286: error: Value of type variable "SupportsRichComparisonT" of "sorted" cannot be "Hashable" [type-var]

Can't sort Hashables apparently.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8172/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1826978659 I_kwDOAMm_X85s5Xtj 8028 Setting datarrays with non-dimension coordinates errors Illviljan 14371165 open 0     6 2023-07-28T19:20:31Z 2023-08-10T15:25:23Z   MEMBER      

What happened?

I'm not sure if this is a bug or a feature but I was expecting this example to work since the new coord is just a slight rewrite of the original dimension coordinate:

```python import xarray as xr

ds = xr.tutorial.open_dataset("air_temperature")

Change the first time value:

ds["air_new"] = ds.air.copy() air_new_changed = ds.air_new[{"time": 0}] * 3 ds.air_new.loc[air_new_changed.coords] = air_new_changed # Works! :)

Add a another coord along time axis and change

the first time value:

ds["air_new"] = ds.air.copy().assign_coords( {"time_float": ds.time.astype(float)} ) air_new_changed = ds.air_new[{"time": 0}] * 4 ds.air_new.loc[air_new_changed.coords] = air_new_changed # Error! :(

Traceback (most recent call last):

Cell In[25], line 5 ds.air_new.loc[air_new_changed.coords] = air_new_changed

File ~\AppData\Local\mambaforge\envs\jw\lib\site-packages\xarray\core\dataarray.py:222 in setitem dim_indexers = map_index_queries(self.data_array, key).dim_indexers

File ~\AppData\Local\mambaforge\envs\jw\lib\site-packages\xarray\core\indexing.py:182 in map_index_queries grouped_indexers = group_indexers_by_index(obj, indexers, options)

File ~\AppData\Local\mambaforge\envs\jw\lib\site-packages\xarray\core\indexing.py:144 in group_indexers_by_index raise KeyError(f"no index found for coordinate {key!r}")

KeyError: "no index found for coordinate 'time_float'" ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8028/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
1549889322 PR_kwDOAMm_X85IKePm 7460 Add abstractmethods to backend classes Illviljan 14371165 open 0     1 2023-01-19T20:19:36Z 2023-07-29T11:42:33Z   MEMBER   1 pydata/xarray/pulls/7460

It's been unclear to me what methods are necessary to implement or not. I think decorating with @abstractmethod will help with that. It's a breaking change though and it could be disruptive.

  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7460/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1797533374 PR_kwDOAMm_X85VIIy4 7975 Test using asv compare Illviljan 14371165 open 0     0 2023-07-10T20:27:31Z 2023-07-13T21:47:05Z   MEMBER   1 pydata/xarray/pulls/7975
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

References: https://github.com/cvxpy/cvxpy/pull/1810

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7975/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1797246423 PR_kwDOAMm_X85VHLJ1 7972 Skip broken tests on Python 3.11 and Windows Illviljan 14371165 closed 0     0 2023-07-10T17:54:54Z 2023-07-10T18:54:38Z 2023-07-10T18:54:38Z MEMBER   0 pydata/xarray/pulls/7972

Temporally skip tests in order to make CI pass again, the troublesome tests are reported in #7971.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7972/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1795519181 I_kwDOAMm_X85rBXLN 7969 Upstream CI is failing Illviljan 14371165 closed 0     2 2023-07-09T18:51:41Z 2023-07-10T17:34:12Z 2023-07-10T17:33:12Z MEMBER      

What happened?

The upstream CI has been failing for a while. Here's the latest: https://github.com/pydata/xarray/actions/runs/5501368493/jobs/10024902009#step:7:16

python Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/runner/work/xarray/xarray/xarray/__init__.py", line 1, in <module> from xarray import testing, tutorial File "/home/runner/work/xarray/xarray/xarray/testing.py", line 7, in <module> import numpy as np ModuleNotFoundError: No module named 'numpy'

Digging a little in the logs ``` Installing build dependencies: started Installing build dependencies: finished with status 'error' error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [3 lines of output] Looking in indexes: https://pypi.anaconda.org/scipy-wheels-nightly/simple ERROR: Could not find a version that satisfies the requirement meson-python==0.13.1 (from versions: none) ERROR: No matching distribution found for meson-python==0.13.1 [end of output] ```

Might be some numpy problem?

Should the CI be robust enough to handle these kinds of errors? Because I suppose we would like to get the automatic issue created anyway?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7969/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
1797186226 PR_kwDOAMm_X85VG-Nj 7970 Use another repository for upstream testing Illviljan 14371165 closed 0     2 2023-07-10T17:10:55Z 2023-07-10T17:33:11Z 2023-07-10T17:33:11Z MEMBER   0 pydata/xarray/pulls/7970

Use https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ instead.

  • [x] Closes #7969
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7970/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1795424047 PR_kwDOAMm_X85VBAF6 7968 Move absolute path finder from open_mfdataset to own function Illviljan 14371165 closed 0     2 2023-07-09T14:24:38Z 2023-07-10T14:04:06Z 2023-07-10T14:04:05Z MEMBER   0 pydata/xarray/pulls/7968

A simple refactor to make it easier to retrieve the proper paths that open_mfdataset uses and passes on the engine.

I've been thinking how to make use of DataTree and one idea I wanted to try was: * Open file (using_find_absolute_path). * Get all groups in the file. * For each group run xr.open_mfdataset(..., group=group)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7968/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1410618081 PR_kwDOAMm_X85A4TS_ 7174 Move .line to plot1d Illviljan 14371165 open 0     0 2022-10-16T20:51:23Z 2023-06-19T20:37:30Z   MEMBER   1 pydata/xarray/pulls/7174
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7174/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1699099029 PR_kwDOAMm_X85P8IoD 7824 Improve concat performance Illviljan 14371165 closed 0     1 2023-05-07T14:54:06Z 2023-06-02T14:36:11Z 2023-06-02T14:36:11Z MEMBER   0 pydata/xarray/pulls/7824
  • Don't use python for loops for possibly large coords. Rather create a np array once then filter out bad data.
  • DuckArrayModule is slightly slow, so cache the first import in a dict instead to speed up later calls.
  • Add more typing to be more confident that inputs are valid and then remove redundant checks and conversions.

  • [x] Requires #7843

  • [x] Requires #7844.
  • [x] Requires #7858
  • [x] Closes #7833
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7824/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1710752209 PR_kwDOAMm_X85QjIMH 7844 Improve to_dask_dataframe performance Illviljan 14371165 closed 0     1 2023-05-15T20:08:24Z 2023-05-25T20:08:54Z 2023-05-25T20:08:54Z MEMBER   0 pydata/xarray/pulls/7844
  • ds.chunks loops all the variables, do it once.
  • Faster to create a meta dataframe once than letting dask guess 2000 times.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7844/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1718427036 PR_kwDOAMm_X85Q88zP 7857 Avoid explicit loop when updating OrderedSet Illviljan 14371165 closed 0     0 2023-05-21T09:06:58Z 2023-05-25T20:08:35Z 2023-05-25T20:08:34Z MEMBER   0 pydata/xarray/pulls/7857

Following recommendation from: https://github.com/pydata/xarray/pull/7824#discussion_r1196114696

```python

main:

a = tuple(f"dim_{i}" for i in range(500)) %timeit OrderedSet(a) 46 µs ± 2.26 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)

This PR:

a = tuple(f"dim_{i}" for i in range(500)) %timeit OrderedSet(a) 28.9 µs ± 476 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each) ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7857/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1718477599 PR_kwDOAMm_X85Q9G1M 7858 Add type hints to test_dtypes Illviljan 14371165 closed 0     0 2023-05-21T12:00:26Z 2023-05-21T12:30:18Z 2023-05-21T12:30:18Z MEMBER   0 pydata/xarray/pulls/7858

Split out from #7858.

Improve mypy coverage in order to understand better what the functions are actually used for.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7858/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1710742907 PR_kwDOAMm_X85QjGIu 7843 Improve interp performance Illviljan 14371165 closed 0     0 2023-05-15T20:02:25Z 2023-05-18T18:54:15Z 2023-05-18T18:54:15Z MEMBER   0 pydata/xarray/pulls/7843
  • Use fastpaths
  • Only transpose multi-dimensional arrays.
  • Calculating chunks and shapes can be costly, prefer doing it once.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7843/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1697987899 PR_kwDOAMm_X85P4g05 7820 Pin pint to 0.20 Illviljan 14371165 closed 0     1 2023-05-05T17:59:40Z 2023-05-06T07:27:28Z 2023-05-06T07:27:28Z MEMBER   0 pydata/xarray/pulls/7820

Newest pint crashes our tests for some reason, pin it for now.

  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7820/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1691458797 PR_kwDOAMm_X85PiT3U 7804 Test asv ci Illviljan 14371165 closed 0     0 2023-05-01T21:54:07Z 2023-05-01T22:24:14Z 2023-05-01T22:24:14Z MEMBER   1 pydata/xarray/pulls/7804
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7804/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
970245117 MDExOlB1bGxSZXF1ZXN0NzEyMjIzNzc2 5704 Allow in-memory arrays with open_mfdataset Illviljan 14371165 open 0     8 2021-08-13T09:50:26Z 2023-04-29T06:58:26Z   MEMBER   0 pydata/xarray/pulls/5704

The docstring seems to imply that it's possible to get in-memory arrays: https://github.com/pydata/xarray/blob/4bb9d9c6df77137f05e85c7cc6508fe7a93dc0e4/xarray/backends/api.py#L732

But it doesn't seem possible because of: https://github.com/pydata/xarray/blob/4bb9d9c6df77137f05e85c7cc6508fe7a93dc0e4/xarray/backends/api.py#L899

This PR removes that or check, changes the default to chunk={}, and fixes the failing tests.

  • [x] Noticed in #5689
  • [ ] Closes #7792
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5704/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1522810384 PR_kwDOAMm_X85G1P52 7424 array api - Add tests for aggregations Illviljan 14371165 open 0     3 2023-01-06T16:10:05Z 2023-04-20T13:37:13Z   MEMBER   1 pydata/xarray/pulls/7424
  • [ ] Closes #7243
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7424/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1665260014 PR_kwDOAMm_X85OK8Yp 7752 Fix typing errors using mypy 1.2 Illviljan 14371165 closed 0     2 2023-04-12T21:08:31Z 2023-04-15T18:31:58Z 2023-04-15T18:31:57Z MEMBER   0 pydata/xarray/pulls/7752

Fixes typing errors when using newest mypy version.

  • [x] Closes #7270
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7752/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1638243008 PR_kwDOAMm_X85MxepP 7668 Pull Request Labeler - Use a released version Illviljan 14371165 closed 0     1 2023-03-23T20:18:49Z 2023-03-23T20:29:04Z 2023-03-23T20:29:04Z MEMBER   0 pydata/xarray/pulls/7668
  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7668/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1638194068 PR_kwDOAMm_X85MxT6K 7667 Pull Request Labeler - Undo workaround sync-labels bug Illviljan 14371165 closed 0     3 2023-03-23T19:45:31Z 2023-03-23T20:25:47Z 2023-03-23T20:23:03Z MEMBER   0 pydata/xarray/pulls/7667

Seems https://github.com/actions/labeler/issues/112 is fixed. So using false should work.

xref: #7431

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7667/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1125040125 I_kwDOAMm_X85DDr_9 6244 Get pyupgrade to update the typing Illviljan 14371165 closed 0     2 2022-02-05T21:56:56Z 2023-03-12T15:38:37Z 2023-03-12T15:38:37Z MEMBER      

Is your feature request related to a problem?

Use more up-to-date typing styles on all files. Will reduce number of imports and avoids big diffs when doing relatively minor changes because pre-commit/pyupgrade has been triggered somehow.

Related to #6240

Describe the solution you'd like

Add from __future__ import annotations on files with a lot of typing. Let pyupgrade do the rest.

Describe alternatives you've considered

No response

Additional context

No response

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6244/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
1444440024 PR_kwDOAMm_X85CpkQO 7277 Require to explicitly defining optional dimensions such as hue and markersize Illviljan 14371165 closed 0     5 2022-11-10T19:23:28Z 2023-02-11T20:55:16Z 2023-02-11T20:55:16Z MEMBER   0 pydata/xarray/pulls/7277
  • [x] Closes #7314
  • [x] Closes #7268

  • Matplotlib adds default colors with plt.plot(x, y) when y is a 2D array.

  • Matplotlib prioritizes c over default colors with plt.plot(x, y, c="blue") when y is a 2D array.
  • Seaborn prioritizes hue over c, but all plot axes has to be explicit.

The plot1d function now follows closer to seaborns example and require explicitly defining optional dimensions such as hue/markersize. Positives and negatives: +++ Reliable performance, won't accidentally choose large and heavy arrays to plot. - Loss of dimension information for default values, will essentially flatten the n-dimensional arrays. - Other xarray plot functions guesses quite a bit as well, API is not consistent.

Required dimensions like the x-axis will still be guessed since the mpl errors weren't very intuitive.

While at it: * Make it possible to prioritize certain mpl kwargs when hue/markersize isn't defined. * Fix integer coords in plot1d and facetgrid, use .coords instead of getitem.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7277/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1462470712 PR_kwDOAMm_X85DmbNT 7318 Use plt.rc_context for default styles Illviljan 14371165 closed 0     2 2022-11-23T22:11:23Z 2023-02-09T12:56:00Z 2023-02-09T12:56:00Z MEMBER   0 pydata/xarray/pulls/7318
  • [x] Closes #7313
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7318/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1554036799 PR_kwDOAMm_X85IYHUz 7472 Avoid in-memory broadcasting when converting to_dask_dataframe Illviljan 14371165 closed 0     1 2023-01-24T00:15:01Z 2023-01-26T17:00:24Z 2023-01-26T17:00:23Z MEMBER   0 pydata/xarray/pulls/7472

Turns out that there's a call to .set_dims that forces a broadcast on the numpy coordinates.

  • [x] Closes #6811
  • [x] Tests added, see #7474.
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

Debugging script:

```python import dask.array as da import xarray as xr import numpy as np chunks = 5000 # I have to restart the pc if running with this: # dim1_sz = 100_000 # dim2_sz = 100_000 # Does not crash when using the following constants, >5 gig RAM increase though: dim1_sz = 40_000 dim2_sz = 40_000 x = da.random.random((dim1_sz, dim2_sz), chunks=chunks) ds = xr.Dataset( { "x": xr.DataArray( data=x, dims=["dim1", "dim2"], coords={"dim1": np.arange(0, dim1_sz), "dim2": np.arange(0, dim2_sz)}, ) } ) # with dask.config.set(**{"array.slicing.split_large_chunks": True}): df = ds.to_dask_dataframe() print(df) ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7472/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1555497796 PR_kwDOAMm_X85Ic_wm 7474 Add benchmarks for to_dataframe and to_dask_dataframe Illviljan 14371165 closed 0     1 2023-01-24T18:48:26Z 2023-01-24T21:00:39Z 2023-01-24T20:13:30Z MEMBER   0 pydata/xarray/pulls/7474

Related to #7472.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7474/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1490160140 PR_kwDOAMm_X85FGOVk 7374 Improve performance for backend datetime handling Illviljan 14371165 closed 0     3 2022-12-11T16:01:05Z 2023-01-18T22:45:36Z 2023-01-13T14:50:53Z MEMBER   0 pydata/xarray/pulls/7374

Was hunting some low-hanging performance fruits when reading in files.

  • Use Variable(..., fastpath=True) for cases when a Variable has been unpacked and modified slightly.
  • Don't check if variable is variable in decode_cf_variable
  • Don't import DataArray until necessary in as_compatible_data.
  • Add typing to touched files to make sure only Variables are used.

  • [ ] Closes #xxxx

  • [ ] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7374/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1537068105 I_kwDOAMm_X85bncxJ 7450 Backend array documentation typo Illviljan 14371165 open 0     0 2023-01-17T21:37:26Z 2023-01-17T21:56:12Z   MEMBER      

What happened?

https://docs.xarray.dev/en/stable/internals/how-to-add-new-backend.html#indexing-examples

I believe there's a typo in the BASIC indexing support example: ```python

shall support integers

backend_array._raw_indexing_method(1, 1) ```

Should be: ```python

shall support integers

backend_array._raw_indexing_method((1, 1)) ```

Suggestion of possible fixes: * Make sure it is a typo. * Create a valid custom MyBackendArray and initialize it. So it is easier to tell if it's a typo. * Add type hinting so mypy can easier catch these errors.

What did you expect to happen?

No response

Minimal Complete Verifiable Example

No response

MVCE confirmation

  • [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [ ] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [ ] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7450/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
1318800553 I_kwDOAMm_X85Om0yp 6833 Require a pull request before merging to main Illviljan 14371165 closed 0     4 2022-07-26T22:09:55Z 2023-01-13T16:51:03Z 2023-01-13T16:51:03Z MEMBER      

Is your feature request related to a problem?

I was making sure the test in #6832 failed on main, when it did I wrote a few lines in the what's new file but forgot switching back to the other branch and accidentally pushed directly to main. :(

Describe the solution you'd like

I think it's best if we require a pull request for merging. We seem to pretty much do this anyway.

Seems to be this setting if I understand correctly:

Describe alternatives you've considered

No response

Additional context

No response

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6833/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
1523232313 PR_kwDOAMm_X85G2q5I 7426 Add lazy backend ASV test Illviljan 14371165 closed 0     1 2023-01-06T22:01:26Z 2023-01-12T16:00:05Z 2023-01-11T18:56:25Z MEMBER   0 pydata/xarray/pulls/7426

This tests xr.open_dataset without any slow file reading that can quickly become the majority of the performance time.

Related to #7374.

Timings for the new ASV-tests: ```

[ 50.85%] ··· dataset_io.IOReadCustomEngine.time_open_dataset ok [ 50.85%] ··· ======== ============ chunks
-------- ------------ None 265±4ms
{} 1.17±0.02s ======== ============ [ 54.69%] ··· dataset_io.IOReadSingleFile.time_read_dataset ok [ 54.69%] ··· ========= ============= ============= -- chunks
--------- --------------------------- engine None {}
========= ============= ============= scipy 4.81±0.1ms 6.65±0.01ms netcdf4 8.41±0.08ms 10.9±0.2ms ========= ============= ============= ``` From the IOReadCustomEngine test we can see that chunking datasets with many variables (2000+) is considerably slower.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7426/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1528100871 PR_kwDOAMm_X85HG6Hh 7431 Pull Request Labeler - Workaround sync-labels bug Illviljan 14371165 closed 0     2 2023-01-10T22:29:03Z 2023-01-10T23:10:32Z 2023-01-10T23:06:14Z MEMBER   0 pydata/xarray/pulls/7431
  • Workaround for Pull Request Labeler The PR labeler keeps removing manually added labels. xref: https://github.com/actions/labeler/issues/112
  • ASV benchmarks starts also when topic-performance label is added now. Bot is allowed to change this one, but not run-benchmarks.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7431/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1420242462 PR_kwDOAMm_X85BYlCD 7204 absolufy-imports - No relative imports - PEP8 Illviljan 14371165 closed 0     6 2022-10-24T05:27:24Z 2022-12-10T11:42:43Z 2022-12-07T21:24:44Z MEMBER   0 pydata/xarray/pulls/7204

I saw dask has started using absolute imports in https://github.com/dask/dask/pull/8796. I find it much more readable and there's a nice pre-commit for it as well.

Easiest way to deal with the merge conflicts is probably to just accept your changes and let pre-commit fix them afterwards.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7204/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1485474624 PR_kwDOAMm_X85E1fDn 7370 absolufy-imports - Only in xarray folder Illviljan 14371165 closed 0     1 2022-12-08T21:57:58Z 2022-12-10T11:42:32Z 2022-12-09T16:55:12Z MEMBER   0 pydata/xarray/pulls/7370

This reverts some of commit 6e77f5e8942206b3e0ab08c3621ade1499d8235b and #7204.

Apparently using it on all folders is not a good idea, follow pandas example.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7370/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1462833576 PR_kwDOAMm_X85Dnp5w 7319 mypy - Remove some ignored packages and modules Illviljan 14371165 closed 0     4 2022-11-24T06:34:13Z 2022-11-26T15:39:12Z 2022-11-26T15:39:11Z MEMBER   0 pydata/xarray/pulls/7319

dask has added py.typed files so now the ignores shouldn't be needed anymore: https://github.com/dask/dask/pull/8854 https://github.com/dask/distributed/pull/5328 As does numpy and pint

pycompat.py doesn't error anymore, so it's good to type check that one as well. Fixed also a python 3.8 related error in it.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7319/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 2,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1447049720 PR_kwDOAMm_X85CyQio 7285 Switch to T_DataArray in .coords Illviljan 14371165 closed 0     3 2022-11-13T19:22:35Z 2022-11-23T17:48:25Z 2022-11-22T17:02:09Z MEMBER   0 pydata/xarray/pulls/7285

.coords were still using DataArray types switch to T_DataArray instead.

  • [x] Fixes mypy error seen in #7277
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7285/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1457017483 PR_kwDOAMm_X85DTsQq 7303 Add mypy version to xr.show_versions Illviljan 14371165 closed 0     0 2022-11-20T19:27:20Z 2022-11-21T21:33:15Z 2022-11-21T21:33:15Z MEMBER   0 pydata/xarray/pulls/7303

It's a little tricky getting the mypy version, so adding it to the show_versions function as well.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7303/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1452339775 PR_kwDOAMm_X85DEC8r 7296 Fix some typing errors in DuckArrayModule Illviljan 14371165 closed 0     4 2022-11-16T22:07:00Z 2022-11-20T18:52:12Z 2022-11-20T10:18:53Z MEMBER   0 pydata/xarray/pulls/7296

Fixes these errors that I've been seeing locally for a while:

python !mypy C:\Users\J.W\Documents\GitHub\xarray\xarray\core\coordinates.py --ignore-missing-imports C:\Users\J.W\Documents\GitHub\xarray\xarray\core\pycompat.py:48: error: Incompatible types in assignment (expression has type "Tuple[]", variable has type "Tuple[Any]") C:\Users\J.W\Documents\GitHub\xarray\xarray\core\pycompat.py:50: error: Incompatible types in assignment (expression has type "Optional[Module]", variable has type "Optional[Literal['dask', 'pint', 'cupy', 'sparse']]") Found 2 errors in 1 file (checked 1 source file)

Not sure why the CI isn't catching these?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7296/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1445870847 PR_kwDOAMm_X85CuWCd 7281 Use a default value for constant dimensions Illviljan 14371165 closed 0     1 2022-11-11T18:41:16Z 2022-11-20T09:59:38Z 2022-11-20T09:59:38Z MEMBER   0 pydata/xarray/pulls/7281
  • default markersize values of widths are 18 to 72.
  • plt.scatter default markersize is 36.
  • plt.plot default linewidth is 6.

With main we get 18 for constant arrays, but 36 if markersize was undefined. This seems a bit inconsistent to me. This PR adds a default value instead for constant arrays

Follow up to #7272.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7281/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1440711212 PR_kwDOAMm_X85Cc31j 7272 Handle division by zero in _Normalize._calc_widths Illviljan 14371165 closed 0     1 2022-11-08T18:35:55Z 2022-11-11T06:27:50Z 2022-11-11T06:27:50Z MEMBER   0 pydata/xarray/pulls/7272

Found an issue when constant values was used. Now if constant values are found it'll default to the minimum width value instead.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7272/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1420230433 PR_kwDOAMm_X85BYia0 7203 Avoid loading any data for reprs Illviljan 14371165 closed 0     6 2022-10-24T05:12:40Z 2022-10-28T16:23:19Z 2022-10-28T16:23:19Z MEMBER   0 pydata/xarray/pulls/7203
  • [x] Closes #6722
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7203/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 36.039ms · About: xarray-datasette