home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

117 rows where repo = 13221727, type = "pull" and user = 35968931 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)

state 2

  • closed 99
  • open 18

type 1

  • pull · 117 ✖

repo 1

  • xarray · 117 ✖
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
2204914380 PR_kwDOAMm_X85qnPSf 8872 Avoid auto creation of indexes in concat TomNicholas 35968931 open 0     15 2024-03-25T05:16:33Z 2024-05-01T19:07:01Z   MEMBER   0 pydata/xarray/pulls/8872

If we create a Coordinates object using the concatenated result_indexes, and pass that to the Dataset constructor, we can explicitly set the correct indexes from the start, instead of auto-creating the wrong ones and then trying to overwrite them with the correct indexes later (which is what the current implementation does).

  • [x] Possible fix for #8871
  • [x] Tests added
  • [x] 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/8872/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2267803218 PR_kwDOAMm_X85t8pSN 8980 Complete deprecation of Dataset.dims returning dict TomNicholas 35968931 open 0     6 2024-04-28T20:32:29Z 2024-05-01T15:40:44Z   MEMBER   0 pydata/xarray/pulls/8980
  • [x] Completes deprecation cycle described in #8496, and started in #8500
  • [ ] ~~Tests added~~
  • [x] 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/8980/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2267780811 PR_kwDOAMm_X85t8kgX 8979 Warn on automatic coercion to coordinate variables in Dataset constructor TomNicholas 35968931 open 0     2 2024-04-28T19:44:20Z 2024-04-29T21:13:00Z   MEMBER   0 pydata/xarray/pulls/8979
  • [x] Starts the deprecation cycle for #8959
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] ~~New functions/methods are listed in api.rst~~
  • [ ] Change existing code + examples so as not to emit this new warning everywhere.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8979/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2021386895 PR_kwDOAMm_X85g7QZD 8500 Deprecate ds.dims returning dict TomNicholas 35968931 closed 0     1 2023-12-01T18:29:28Z 2024-04-28T20:04:00Z 2023-12-06T17:52:24Z MEMBER   0 pydata/xarray/pulls/8500
  • [x] Closes first step of #8496, would require another PR later to actually change the return type. Also really resolves the second half of #921.
  • [x] Tests added
  • [x] 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/8500/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2254350395 PR_kwDOAMm_X85tPTua 8960 Option to not auto-create index during expand_dims TomNicholas 35968931 closed 0     2 2024-04-20T03:27:23Z 2024-04-27T16:48:30Z 2024-04-27T16:48:24Z MEMBER   0 pydata/xarray/pulls/8960
  • [x] Solves part of #8871 by pulling out part of https://github.com/pydata/xarray/pull/8872#issuecomment-2027571714
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] ~~New functions/methods are listed in api.rst~~

TODO: - [x] Add new kwarg to DataArray.expand_dims - [ ] Add examples to docstrings? - [x] Check it actually solves the problem in #8872

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8960/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1692909704 PR_kwDOAMm_X85PnMF6 7811 Generalize delayed TomNicholas 35968931 open 0     0 2023-05-02T18:34:26Z 2024-04-23T17:41:55Z   MEMBER   0 pydata/xarray/pulls/7811

A small follow-on to #7019 to allow using non-dask implementations of delayed.

(Builds off of #7019)

  • [x] Closes #7810
  • [ ] 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/7811/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2100707586 PR_kwDOAMm_X85lFQn3 8669 Fix automatic broadcasting when wrapping array api class TomNicholas 35968931 closed 0     0 2024-01-25T16:05:19Z 2024-04-20T05:58:05Z 2024-01-26T16:41:30Z MEMBER   0 pydata/xarray/pulls/8669
  • [x] Closes #8665
  • [x] Tests added
  • [x] 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/8669/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2240895281 PR_kwDOAMm_X85siDno 8934 Correct save_mfdataset docstring TomNicholas 35968931 closed 0     0 2024-04-12T20:51:35Z 2024-04-14T19:58:46Z 2024-04-14T11:14:42Z MEMBER   0 pydata/xarray/pulls/8934

Noticed the **kwargs part of the docstring was mangled - see here

  • [ ] ~~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/8934/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2057651682 PR_kwDOAMm_X85i2Byx 8573 ddof vs correction kwargs in std/var TomNicholas 35968931 closed 0     0 2023-12-27T18:10:52Z 2024-04-04T16:46:55Z 2024-04-04T16:46:55Z MEMBER   0 pydata/xarray/pulls/8573
  • [x] Attempt to closes issue described in https://github.com/pydata/xarray/issues/8566#issuecomment-1870472827
  • [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/8573/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2218574880 PR_kwDOAMm_X85rVXJC 8899 New empty whatsnew entry TomNicholas 35968931 closed 0     0 2024-04-01T16:04:27Z 2024-04-01T17:49:09Z 2024-04-01T17:49:06Z MEMBER   0 pydata/xarray/pulls/8899

Should have been done as part of the last release https://github.com/pydata/xarray/releases/tag/v2024.03.0

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8899/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1336119080 PR_kwDOAMm_X849CQ7A 6908 Hypothesis strategies in xarray.testing.strategies TomNicholas 35968931 open 0     15 2022-08-11T15:20:56Z 2024-04-01T16:01:21Z   MEMBER   0 pydata/xarray/pulls/6908

Adds a whole suite of hypothesis strategies for generating xarray objects, inspired by and separated out from the new hypothesis strategies in #4972. They are placed into the namespace xarray.testing.strategies, and publicly mentioned in the API docs, but with a big warning message. There is also a new testing page in the user guide documenting how to use these strategies.

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

EDIT: A variables strategy and user-facing documentation were shipped in https://github.com/pydata/xarray/pull/8404

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6908/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 2,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2120340151 PR_kwDOAMm_X85mHqI0 8714 Avoid coercing to numpy in `as_shared_dtypes` TomNicholas 35968931 open 0     3 2024-02-06T09:35:22Z 2024-03-28T18:31:50Z   MEMBER   0 pydata/xarray/pulls/8714
  • [x] Solves the problem in https://github.com/pydata/xarray/pull/8712#issuecomment-1929037299
  • [ ] Tests added
  • [x] 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/8714/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2213406564 PR_kwDOAMm_X85rEF-X 8886 Allow multidimensional variable with same name as dim when constructing dataset via coords TomNicholas 35968931 closed 0     2 2024-03-28T14:37:27Z 2024-03-28T17:07:10Z 2024-03-28T16:28:09Z MEMBER   0 pydata/xarray/pulls/8886

Supercedes #8884 as a way to close #8883, in light of me having learnt that this is now allowed! https://github.com/pydata/xarray/issues/8883#issuecomment-2024645815. So this is really a follow-up to #7989.

  • [x] Closes #8883
  • [x] Tests added
  • [x] 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/8886/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2212211084 PR_kwDOAMm_X85rABMo 8884 Forbid invalid Coordinates object TomNicholas 35968931 closed 0     2 2024-03-28T02:14:01Z 2024-03-28T14:38:43Z 2024-03-28T14:38:03Z MEMBER   0 pydata/xarray/pulls/8884
  • [x] Closes #8883
  • [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/8884/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2119537681 PR_kwDOAMm_X85mE7Im 8711 Opt out of auto creating index variables TomNicholas 35968931 closed 0     11 2024-02-05T22:04:36Z 2024-03-26T13:55:16Z 2024-03-26T13:50:14Z MEMBER   0 pydata/xarray/pulls/8711

Tries fixing #8704 by cherry-picking from #8124 as @benbovy suggested in https://github.com/pydata/xarray/issues/8704#issuecomment-1926868422

  • [x] Closes #8704
  • [x] Tests added
  • [x] 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/8711/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1945654275 PR_kwDOAMm_X85c7HL_ 8319 Move parallelcompat and chunkmanagers to NamedArray TomNicholas 35968931 closed 0     9 2023-10-16T16:34:26Z 2024-02-12T22:09:24Z 2024-02-12T22:09:24Z MEMBER   0 pydata/xarray/pulls/8319

@dcherian I got to this point before realizing that simply moving parallelcompat.py over isn't what it says in the design doc, which instead talks about

  • Could this functionality be left in Xarray proper for now? Alternative array types like JAX also have some notion of "chunks" for parallel arrays, but the details differ in a number of ways from the Dask/Cubed.
  • Perhaps variable.chunk/load methods should become functions defined in xarray that convert Variable objects. This is easy so long as xarray can reach in and replace .data

I personally think that simply moving parallelcompat makes sense so long as you expect people to use chunked NamedArray objects. I see the chunked arrays as special cases of duck arrays, and my understanding is that NamedArray is supposed to have full support for duckarrays.

cc @andersy005

  • [x] As requested in #8238
  • [ ] ~~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/8319/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2120030667 PR_kwDOAMm_X85mGm4g 8712 Only use CopyOnWriteArray wrapper on BackendArrays TomNicholas 35968931 open 0     6 2024-02-06T06:05:53Z 2024-02-07T17:09:56Z   MEMBER   0 pydata/xarray/pulls/8712

This makes sure we only use the CopyOnWriteArray wrapper on arrays that have been explicitly marked to be lazily-loaded (through being subclasses of BackendArray). Without this change we are implicitly assuming that any array type obtained through the BackendEntrypoint system should be treated as if it points to an on-disk array.

Motivated by https://github.com/pydata/xarray/issues/8699, which is a counterexample to that assumption.

  • [ ] 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/8712/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2118876352 PR_kwDOAMm_X85mCobE 8708 Try pydata-sphinx-theme in docs TomNicholas 35968931 open 0     1 2024-02-05T15:50:01Z 2024-02-05T16:57:33Z   MEMBER   0 pydata/xarray/pulls/8708
  • [x] Closes #8701
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

How might we want to move headers/sections around to take advantage of now having a navigation bar at the top? Adding an explicit link to the tutorial.xarray.dev site would be good.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8708/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2099622643 PR_kwDOAMm_X85lBkos 8668 Fix unstack method when wrapping array api class TomNicholas 35968931 closed 0     0 2024-01-25T05:54:38Z 2024-01-26T16:06:04Z 2024-01-26T16:06:01Z MEMBER   0 pydata/xarray/pulls/8668
  • [x] Closes #8666
  • [x] Tests added
  • [x] 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/8668/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2098535717 PR_kwDOAMm_X85k94wv 8655 Small improvement to HOW_TO_RELEASE.md TomNicholas 35968931 closed 0     1 2024-01-24T15:35:16Z 2024-01-24T21:46:02Z 2024-01-24T21:46:01Z MEMBER   0 pydata/xarray/pulls/8655

Clarify step 8. by pointing to where the ReadTheDocs build actually is

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8655/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2092346228 PR_kwDOAMm_X85ko-Y2 8632 Pin sphinx-book-theme to 1.0.1 to try to deal with #8619 TomNicholas 35968931 closed 0     2 2024-01-21T02:18:49Z 2024-01-23T20:16:13Z 2024-01-23T18:28:35Z MEMBER   0 pydata/xarray/pulls/8632
  • [x] Hopefully closes #8619
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8632/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2086704542 PR_kwDOAMm_X85kVyF6 8617 Release summary for release v2024.01.0 TomNicholas 35968931 closed 0     1 2024-01-17T18:02:29Z 2024-01-17T21:23:45Z 2024-01-17T19:21:11Z MEMBER   0 pydata/xarray/pulls/8617

Someone give this a thumbs up if it looks good

  • [x] Closes #8616
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8617/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1333644214 PR_kwDOAMm_X8486DyE 6903 Duckarray tests for constructors and properties TomNicholas 35968931 open 0     5 2022-08-09T18:36:56Z 2024-01-01T13:33:22Z   MEMBER   0 pydata/xarray/pulls/6903

Builds on top of #4972 to add tests for Variable/DataArray/Dataset constructors and properties when wrapping duck arrays.

Adds a file xarray/tests/duckarrays/base/constructors.py which contains new test base classes.

Also uses those new base classes to test Sparse array integration (not yet tried for pint integration).

  • [x] Closes part of #6894
  • [ ] Tests added (tests for tests?? Maybe...)
  • [ ] 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/6903/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1519552711 PR_kwDOAMm_X85GqAro 7418 Import datatree in xarray? TomNicholas 35968931 closed 0     18 2023-01-04T20:48:09Z 2023-12-22T17:38:04Z 2023-12-22T17:38:04Z MEMBER   0 pydata/xarray/pulls/7418

I want datatree to live in xarray main, as right now it's in a separate package but imports many xarray internals.

This presents a few questions: 1) At what stage is datatree "ready" to moved in here? At what stage should it become encouraged public API? 2) What's a good way to slowly roll the feature out? 3) How do I decrease the bus factor on datatree's code? Can I get some code reviews during the merging process? :pray: 4) Should I make a new CI environment just for testing datatree stuff?

Today @jhamman and @keewis suggested for now I make it so that you can from xarray import DataTree, using the current xarray-datatree package as an optional dependency. That way I can create a smoother on-ramp, get some more users testing it, but without committing all the code into this repo yet.

@pydata/xarray what do you think? Any other thoughts about best practices when moving a good few thousand lines of code into xarray?

  • [x] First step towards moving solution of #4118 into this repository
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7418/reactions",
    "total_count": 6,
    "+1": 4,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
    xarray 13221727 pull
1820788594 PR_kwDOAMm_X85WW40r 8019 Generalize cumulative reduction (scan) to non-dask types TomNicholas 35968931 closed 0     2 2023-07-25T17:22:07Z 2023-12-18T19:30:18Z 2023-12-18T19:30:18Z MEMBER   0 pydata/xarray/pulls/8019
  • [x] Needed for https://github.com/tomwhite/cubed/issues/277#issuecomment-1648567431 - should have been added in #7019
  • [ ] ~~Tests added~~ (would go in cubed-xarray)
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst (new ABC method will be documented on chunked array types page automatically)
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8019/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1048697792 PR_kwDOAMm_X84uSksS 5961 [Experimental] Refactor Dataset to store variables in a manifest TomNicholas 35968931 closed 0     7 2021-11-09T14:51:03Z 2023-12-06T17:38:53Z 2023-12-06T17:38:52Z MEMBER   0 pydata/xarray/pulls/5961

This PR is part of an experiment to see how to integrate a DataTree into xarray.

What is does is refactor Dataset to store variables in a DataManifest class, which is also capable of maintaining a ledger of child tree nodes. The point of this is to prevent name collisions between stored variables and child datatree nodes, as first mentioned in https://github.com/TomNicholas/datatree/issues/38 and explained further in https://github.com/TomNicholas/datatree/issues/2.

("Manifest" in the old sense, of a noun meaning "a document giving comprehensive details of a ship and its cargo and other contents")

  • [x] Would eventually close https://github.com/TomNicholas/datatree/issues/38
  • [ ] Tests added
  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5961/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1084220684 PR_kwDOAMm_X84wDPg5 6086 Type protocol for internal variable mapping TomNicholas 35968931 closed 0     9 2021-12-19T23:32:04Z 2023-12-06T17:20:48Z 2023-12-06T17:19:30Z MEMBER   1 pydata/xarray/pulls/6086

In #5961 and #6083 I've been experimenting extending Dataset to store variables in a custom mapping object (instead of always in a dict), so as to eventually fix this mutability problem with DataTree.

I've been writing out new storage class implementations in those PRs, but on Friday @shoyer suggested that I could instead simply alter the allowed type for ._variables in xarray.Dataset's type hints. That would allow me to mess about with storage class implementations outside of xarray, whilst guaranteeing type compatibility with xarray main itself with absolutely minimal changes (hopefully no runtime changes to Dataset at all!).

The idea is to define a protocol in xarray which specifies the structural subtyping behaviour of any custom variable storage class that I might want to set as Dataset._variables. The type hint for the ._variables attribute then refers to this protocol, and will be satisfied as long as whatever object is set as ._variables has compatibly-typed methods. Adding type hints to the ._construct_direct and ._replace constructors is enough to propagate this new type specification all over the codebase.

In practice this means writing a protocol which describes the type behaviour of all the methods on dict that currently get used by ._variable accesses.

So far I've written out a CopyableMutableMapping protocol which defines all the methods needed. The issues I'm stuck on at the moment are:

1) The typing behaviour of overloaded methods, specifically update. (setdefault also has similar problems but I think I can safely omit that from the protocol definition because we don't call ._variables.setdefault() anywhere.) Mypy complains that CopyableMutableMapping is not a compatible type when Dict is specified because the type specification of overloaded methods isn't quite right somehow:

```
xarray/core/computation.py:410: error: Argument 1 to "_construct_direct" of "Dataset" has incompatible type "Dict[Hashable, Variable]"; expected "CopyableMutableMapping[Hashable, Variable]"  [arg-type]
xarray/core/computation.py:410: note: Following member(s) of "Dict[Hashable, Variable]" have conflicts:
xarray/core/computation.py:410: note:     Expected:
xarray/core/computation.py:410: note:         @overload
xarray/core/computation.py:410: note:         def update(self, other: Mapping[Hashable, Variable], **kwargs: Variable) -> None
xarray/core/computation.py:410: note:         @overload
xarray/core/computation.py:410: note:         def update(self, other: Iterable[Tuple[Hashable, Variable]], **kwargs: Variable) -> None
xarray/core/computation.py:410: note:         <1 more overload not shown>
xarray/core/computation.py:410: note:     Got:
xarray/core/computation.py:410: note:         @overload
xarray/core/computation.py:410: note:         def update(self, Mapping[Hashable, Variable], **kwargs: Variable) -> None
xarray/core/computation.py:410: note:         @overload
xarray/core/computation.py:410: note:         def update(self, Iterable[Tuple[Hashable, Variable]], **kwargs: Variable) -> None
```
I don't understand what the inconsistency is because I literally looked up the exact way that [the type stubs](https://github.com/python/typeshed/blob/e6911530d4d52db0fbdf05be3aff89e520ee39bc/stdlib/typing.pyi#L490) for `Dict` were written (via `MutableMapping`).

2) Making functions which expect a Mapping accept my CopyableMutableMapping. I would have thought this would just work because I think my protocol defines all the methods which Mapping has, so CopyableMutableMapping should automatically become a subtype of Mapping. But instead I get errors like this with no further information as to what to do about it.

```xarray/core/dataset.py:785: error: Argument 1 to "Frozen" has incompatible type "CopyableMutableMapping[Hashable, Variable]"; expected "Mapping[Hashable, Variable]"  [arg-type]```

3) I'm expecting to get a runtime problem whenever we assert isinstance(ds._variables, dict), which happens in a few places. I'm no sure what the best way to deal with that is, but I'm hoping that simply adding @typing.runtime_checkable to the protocol class definition will be enough?

Once that passes mypy I will write a test that checks that if I define my own custom variable storage class I can _construct_direct a Dataset which uses it without any errors. At that point I can be confident that Dataset is general enough to hold whichever exact variable storage class I end up needing for DataTree.

@max-sixty this is entirely a typing challenge, so I'm tagging you in case you're interested :)

  • [ ] Would supercede #5961 and #6083
  • [ ] Tests added
  • [ ] Passes pre-commit run --all-files

EDIT: Also using Protocol at all is only available in Python 3.8+

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6086/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2027528985 PR_kwDOAMm_X85hQBHP 8525 Remove PR labeler bot TomNicholas 35968931 closed 0     3 2023-12-06T02:31:56Z 2023-12-06T02:45:46Z 2023-12-06T02:45:41Z MEMBER   0 pydata/xarray/pulls/8525

RIP

  • [x] Closes #8524
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8525/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1974681146 PR_kwDOAMm_X85edMm- 8404 Hypothesis strategy for generating Variable objects TomNicholas 35968931 closed 0     6 2023-11-02T17:04:03Z 2023-12-05T22:45:57Z 2023-12-05T22:45:57Z MEMBER   0 pydata/xarray/pulls/8404

Breaks out just the part of #6908 needed for generating arbitrary xarray.Variable objects. (so ignore the ginormous number of commits)

EDIT: Check out this test which performs a mean on any subset of any Variable object!

```python In [36]: from xarray.testing.strategies import variables

In [37]: variables().example() <xarray.Variable (ĭ: 3)> array([-2.22507386e-313-6.62447795e+016j, nan-6.46207519e+185j, -2.22507386e-309+3.33333333e-001j]) ```

@andersy005 @maxrjones @jhamman I thought this might be useful for the NamedArray testing. (xref #8370 and #8244)

@keewis and @Zac-HD sorry for letting that PR languish for literally a year :sweat_smile: This PR addresses your feedback about accepting a callable that returns a strategy generating arrays. That suggestion makes some things a bit more complex in user code but actually allows me to simplify the internals of the variables strategy significantly. I'm actually really happy with this PR - I think it solves what we were discussing, and is a sensible checkpoint to merge before going back to making strategies for generating composite objects like DataArrays/Datasets work.

  • [x] Closes part of #6911
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8404/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2017285297 PR_kwDOAMm_X85gtObP 8491 Warn on repeated dimension names during construction TomNicholas 35968931 closed 0     13 2023-11-29T19:30:51Z 2023-12-01T01:37:36Z 2023-12-01T00:40:18Z MEMBER   0 pydata/xarray/pulls/8491
  • [x] Closes #2226 and #1499 by forbidding those situations (but we should leave #3731 open as the "official" place to discuss supporting repeated dimensions
  • [x] Tests added
  • [x] 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/8491/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1806973709 PR_kwDOAMm_X85VoNVM 7992 Docs page on interoperability TomNicholas 35968931 closed 0     3 2023-07-17T05:02:29Z 2023-10-26T16:08:56Z 2023-10-26T16:04:33Z MEMBER   0 pydata/xarray/pulls/7992

Builds upon #7991 by adding a page to the internals enumerating all the different ways in which xarray is interoperable.

Would be nice if https://github.com/pydata/xarray/pull/6975 were merged so that I could link to it from this new page.

  • [x] Addresses comment in https://github.com/pydata/xarray/pull/6975#issuecomment-1246487152
  • [ ] ~~Tests added~~
  • [x] 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/7992/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1036473974 PR_kwDOAMm_X84tsaL3 5900 Add .chunksizes property TomNicholas 35968931 closed 0     2 2021-10-26T15:51:09Z 2023-10-20T16:00:15Z 2021-10-29T18:12:22Z MEMBER   0 pydata/xarray/pulls/5900

Adds a new .chunksizes property to Dataset, DataArray and Variable, which returns a mapping from dimensions names to chunk sizes in all cases.

Supercedes #5846 because this PR is backwards-compatible.

  • [x] Closes #5843
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5900/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1790161818 PR_kwDOAMm_X85UvI4i 7963 Suggest installing dask when not discovered by ChunkManager TomNicholas 35968931 open 0     2 2023-07-05T19:34:06Z 2023-10-16T13:31:44Z   MEMBER   0 pydata/xarray/pulls/7963
  • [x] Closes #7962
  • [ ] Tests added
  • [x] 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/7963/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1801393806 PR_kwDOAMm_X85VVV4q 7981 Document that Coarsen accepts coord func as callable TomNicholas 35968931 open 0     0 2023-07-12T17:01:31Z 2023-09-19T01:18:49Z   MEMBER   0 pydata/xarray/pulls/7981

Documents a hidden feature I noticed yesterday, corrects incorrect docstrings, and tidies up some of the typing internally.

  • [ ] ~~Closes #xxxx~~
  • [ ] Tests added
  • [x] 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/7981/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1083507645 PR_kwDOAMm_X84wBDeq 6083 Manifest as variables attribute TomNicholas 35968931 closed 0     2 2021-12-17T18:14:26Z 2023-09-14T15:37:38Z 2023-09-14T15:37:37Z MEMBER   1 pydata/xarray/pulls/6083

Another attempt like #5961

@shoyer

  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] 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
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6083/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1806949831 PR_kwDOAMm_X85VoH2o 7991 Docs page on internal design TomNicholas 35968931 closed 0     1 2023-07-17T04:46:55Z 2023-09-08T15:41:32Z 2023-09-08T15:41:32Z MEMBER   0 pydata/xarray/pulls/7991

Adds a new page to the xarray internals documentation giving an overview of the internal design of xarray.

This should be helpful for xarray contributors and for developers of extensions because nowhere in the docs does it really explain how DataArray and Dataset are constructed from Variable.

  • [ ] ~~Closes #xxxx~~
  • [ ] ~~Tests added~~
  • [x] 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/7991/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1368740629 PR_kwDOAMm_X84-uWtE 7019 Generalize handling of chunked array types TomNicholas 35968931 closed 0     30 2022-09-10T22:02:18Z 2023-07-24T20:40:29Z 2023-05-18T17:34:31Z MEMBER   0 pydata/xarray/pulls/7019

Initial attempt to get cubed working within xarray, as an alternative to dask.

  • [x] Closes #6807, at least for the case of cubed
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
  • [x] Correct type hints

I've added a manager kwarg to the .chunk methods so you can do da.chunk(manager="cubed") to convert to a chunked cubed.CoreArray, with the default still being da.chunk(manager="dask"). (I couldn't think of a better name than "manager", as "backend" and "executor" are already taken.)

~~At the moment it should work except for an import error that I don't understand, see below.~~

Fro cubed to work at all with this PR we would also need: - [x] Cubed to expose the correct array type consistently https://github.com/tomwhite/cubed/issues/123 - [x] A cubed version of apply_gufunc https://github.com/tomwhite/cubed/pull/119 - implemented in https://github.com/tomwhite/cubed/pull/149 :partying_face:

To-dos for me on this PR: - [x] Re-route xarray.apply_ufunc through cubed.apply_gufunc instead of dask's apply_gufunc when appropriate, - [x] Add from_array_kwargs to opening functions, e.g. open_zarr, and open_dataset, - [x] Add from_array_kwargs to creation functions, such as full_like, - [x] Add store_kwargs as a way to propagate cubed-specific kwargs when saving to_zarr.

To complete this project more generally we should also: - [ ] Have cubed.apply_gufunc support multiple output arguments https://github.com/tomwhite/cubed/issues/152 - [x] Have a top-level cubed.unify_chunks to match dask.array.core.unify_chunks - [ ] Write a test suite for wrapping cubed arrays, which would be best done via #6894 - [ ] Generalise xarray.map_blocks to work on cubed arrays, ideally by first rewriting xarray's implementation of map_blocks to use dask.array.map_blocks

cc @tomwhite

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7019/reactions",
    "total_count": 4,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 2,
    "eyes": 0
}
    xarray 13221727 pull
1810167498 PR_kwDOAMm_X85VzHaS 7999 Core team member guide TomNicholas 35968931 closed 0     4 2023-07-18T15:26:01Z 2023-07-21T14:51:57Z 2023-07-21T13:48:26Z MEMBER   0 pydata/xarray/pulls/7999

Adds a guide for core developers of xarray. Mostly adapted from napari's core dev guide, but with some extra sections and ideas from the pandas maintainance guide.

@pydata/xarray please give your feedback on this! If you prefer to give feedback in a non-public channel for whatever reason then please use the private core team email.

  • [ ] ~~Closes #xxxx~~
  • [ ] ~~Tests added~~
  • [x] 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/7999/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1807044282 PR_kwDOAMm_X85VodDN 7993 Update whats-new.rst for new release TomNicholas 35968931 closed 0     0 2023-07-17T06:03:19Z 2023-07-17T06:03:43Z 2023-07-17T06:03:42Z MEMBER   0 pydata/xarray/pulls/7993

Needed because I started the release process earlier this week by writing a whatsnew, that apparently got merged, but the release hasn't been issued since. I'll self-merge this and release now.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7993/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1799476089 PR_kwDOAMm_X85VO0Wz 7979 Release summary for v2023.07.0 TomNicholas 35968931 closed 0     0 2023-07-11T17:59:28Z 2023-07-13T16:33:43Z 2023-07-13T16:33:43Z MEMBER   0 pydata/xarray/pulls/7979  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7979/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1753401384 PR_kwDOAMm_X85Szs7X 7911 Duck array documentation improvements TomNicholas 35968931 closed 0     0 2023-06-12T19:10:41Z 2023-07-10T09:36:05Z 2023-06-29T14:39:22Z MEMBER   0 pydata/xarray/pulls/7911

Draft improvements to the user guide page on using duck arrays.

Intended as part of the scipy tutorial effort, though I wasn't sure whether to concentrate on content in the main xarray docs or the tutorial repo.

(I wrote this on a train without enough internet to update my conda environment so I will come back and fix anything that doesn't run.)

  • [x] Part of https://github.com/xarray-contrib/xarray-tutorial/issues/170
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

cc @dcherian and @keewis

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7911/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1779880070 PR_kwDOAMm_X85UMTE7 7951 Chunked array docs TomNicholas 35968931 closed 0     3 2023-06-28T23:01:42Z 2023-07-05T20:33:33Z 2023-07-05T20:08:19Z MEMBER   0 pydata/xarray/pulls/7951

Builds upon #7911

  • [x] Documentation for #7019
  • [ ] ~~Tests added~~
  • [x] 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/7951/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1786830423 PR_kwDOAMm_X85Uj4NA 7960 Update minimum version of typing extensions in pre-commit TomNicholas 35968931 closed 0     1 2023-07-03T21:27:40Z 2023-07-05T19:09:04Z 2023-07-05T15:43:40Z MEMBER   0 pydata/xarray/pulls/7960

Attempt to fix the pre-commit build failure I keep seeing in the CI (e.g. this failure from https://github.com/pydata/xarray/pull/7881)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7960/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1773373878 PR_kwDOAMm_X85T2T_2 7941 Allow cubed arrays to be passed to flox groupby TomNicholas 35968931 closed 0     0 2023-06-25T16:48:56Z 2023-06-26T15:28:06Z 2023-06-26T15:28:03Z MEMBER   0 pydata/xarray/pulls/7941

Generalizes a small check for chunked arrays in groupby so it now allows cubed arrays through to flox rather than just dask arrays. Does not actually mean that flox groupby will work with cubed yet though, see https://github.com/tomwhite/cubed/issues/223 and https://github.com/xarray-contrib/flox/issues/224

  • [x] Should have been done in #7019
  • [ ] ~~Tests added~~ (The place to test this would be in [cubed-xarray]
  • [x] 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/7941/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1768095127 PR_kwDOAMm_X85Tkubk 7934 Release summary for v2023.06.0 TomNicholas 35968931 closed 0     4 2023-06-21T17:34:29Z 2023-06-23T03:02:12Z 2023-06-23T03:02:11Z MEMBER   0 pydata/xarray/pulls/7934

Release summary:

This release adds features to curvefit, improves the performance of concatenation, and fixes various bugs.


For some reason when I try to use git log "$(git tag --sort=v:refname | tail -1).." --format=%aN | sort -u | perl -pe 's/\n/$1, /' to return the list of all contributors since last release, it only returns Deepak :laughing: I'm not sure what's going wrong there - I definitely have all the git tags fetched, and other people have definitely contributed since the last version!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7934/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1716200316 PR_kwDOAMm_X85Q1k5D 7847 Array API fixes for astype TomNicholas 35968931 closed 0     0 2023-05-18T20:09:32Z 2023-05-19T15:11:17Z 2023-05-19T15:11:16Z MEMBER   0 pydata/xarray/pulls/7847

Follows on from #7067 and #6804, ensuring that we call xp.astype() on arrays rather than arr.astype(), as the latter is commonly-implemented by array libraries but not part of the array API standard.

A bit of a pain to test in isolation because I made the changes so that xarray's .pad would work with array-API-conforming libraries, but actually np.pad is not part of the array API either, so it's going to coerce to numpy for that reason anyway.

(This PR replaces #7815, as making a new branch was easier than merging/rebasing with all the changes in #7019.)

  • [ ] ~~Closes #xxxx~~
  • [ ] ~~Tests added~~
  • [x] 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/7847/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1716345200 PR_kwDOAMm_X85Q2EmD 7849 Whats new for release of v2023.05.0 TomNicholas 35968931 closed 0     0 2023-05-18T22:30:32Z 2023-05-19T02:18:03Z 2023-05-19T02:17:55Z MEMBER   0 pydata/xarray/pulls/7849

Summary:

This release adds some new methods and operators, updates our deprecation policy for python versions, fixes some bugs with groupby, and introduces experimental support for alternative chunked parallel array computation backends via a new plugin system!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7849/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1695244129 PR_kwDOAMm_X85PvJSS 7815 Array API fixes for astype TomNicholas 35968931 closed 0     2 2023-05-04T04:33:52Z 2023-05-18T20:10:48Z 2023-05-18T20:10:43Z MEMBER   0 pydata/xarray/pulls/7815

While it's common for duck arrays to have a .astype method, this doesn't exist in the new array API standard. We now have duck_array_ops.astype to deal with this, but for some reason changing it in just a couple more places broke practically every pint test in test_units.py :confused: @keewis

Builds on top of #7019 with just one extra commit to separate out this issue.

  • [ ] 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/7815/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1615570467 PR_kwDOAMm_X85LlkLA 7595 Clarifications in contributors guide TomNicholas 35968931 closed 0     5 2023-03-08T16:35:45Z 2023-03-13T17:55:43Z 2023-03-13T17:51:24Z MEMBER   0 pydata/xarray/pulls/7595

Add suggestions @paigem made in #7439, as well as fix a few small formatting things and broken links.

I would like to merge this so that it can be helpful for the new contributors we will hopefully get through Outreachy.

  • [x] Closes #7439
  • [ ] ~~Tests added~~
  • [x] 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/7595/reactions",
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 2,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1579829674 PR_kwDOAMm_X85JuG-F 7518 State which variables not present in drop vars error message TomNicholas 35968931 closed 0     0 2023-02-10T15:00:35Z 2023-03-09T20:47:47Z 2023-03-09T20:47:47Z MEMBER   0 pydata/xarray/pulls/7518

Makes the error message more informative

  • [ ] Closes #xxxx
  • [x] Tests added
  • [x] 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/7518/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1586144997 PR_kwDOAMm_X85KDKDY 7534 Docs page on numpy to xarray TomNicholas 35968931 open 0     0 2023-02-15T16:16:53Z 2023-02-15T16:16:53Z   MEMBER   0 pydata/xarray/pulls/7534
  • [x] Closes #7533
  • [ ] ~~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/7534/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1573538162 PR_kwDOAMm_X85JY_1l 7509 Update apply_ufunc output_sizes error message TomNicholas 35968931 closed 0     0 2023-02-07T01:35:08Z 2023-02-07T15:45:54Z 2023-02-07T05:01:36Z MEMBER   0 pydata/xarray/pulls/7509
  • [x] Closes poor error message reported in https://github.com/pydata/xarray/discussions/7503
  • [x] Tests added
  • [x] 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/7509/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1366751031 PR_kwDOAMm_X84-n1xC 7011 Add sphinx-codeautolink extension to docs build TomNicholas 35968931 open 0     15 2022-09-08T17:43:47Z 2023-02-06T17:55:52Z   MEMBER   1 pydata/xarray/pulls/7011

I think that sphinx-codeautolink is different from sphinx.ext.linkcode...

  • [x] Closes #7010
  • [ ] 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/7011/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1565458372 PR_kwDOAMm_X85I-VC2 7497 Enable datatree * dataset commutativity TomNicholas 35968931 open 0     0 2023-02-01T05:24:53Z 2023-02-03T17:32:20Z   MEMBER   0 pydata/xarray/pulls/7497

Change binary operations involving DataTree objects and Dataset objects to be handled by the DataTree class. Necessary to enable ds * dt to return the same type as dt * ds.

Builds on top of #7418.

  • [x] Closes https://github.com/xarray-contrib/datatree/issues/146
  • [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/7497/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1365266461 PR_kwDOAMm_X84-it_s 7006 Fix decorators in ipython code blocks in docs TomNicholas 35968931 open 0     0 2022-09-07T22:38:07Z 2023-01-15T18:11:17Z   MEMBER   0 pydata/xarray/pulls/7006

There was a bug in ipython's sphinx extension causing decorators to be skipped when evaluating code blocks. I assume that's why there is this weird workaround in the docs page on defining accessors (which uses decorators).

I fixed that bug, and the fix is in the most recent release of ipython, so this PR bumps our ipython version for the docs, and removes the workaround.

  • [ ] 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/7006/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1470025851 PR_kwDOAMm_X85D_b_W 7338 Docs: add example of writing and reading groups to netcdf TomNicholas 35968931 closed 0     0 2022-11-30T18:01:32Z 2022-12-01T16:24:08Z 2022-12-01T16:24:04Z MEMBER   0 pydata/xarray/pulls/7338
  • [x] Came from https://github.com/pydata/xarray/discussions/7329#discussioncomment-4256845
  • [ ] ~~Tests added~~
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] ~~New functions/methods are listed in api.rst~~

@dcherian

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7338/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
906023492 MDExOlB1bGxSZXF1ZXN0NjU3MDYxODI5 5400 Multidimensional histogram TomNicholas 35968931 open 0     3 2021-05-28T20:38:53Z 2022-11-21T22:41:01Z   MEMBER   0 pydata/xarray/pulls/5400

Initial work on integrating the multi-dimensional dask-powered histogram functionality from xhistogram into xarray. Just working on the skeleton to fit around the histogram algorithm for now, to be filled in later.

  • [x] Closes #4610
  • [x] API skeleton
  • [x] Input checking
  • [ ] Internal blockwise algorithm from https://github.com/xgcm/xhistogram/pull/49
  • [x] Redirect plot.hist
  • [x] da.weighted().hist()
  • [ ] Tests added for results
  • [x] Hypothesis tests for different chunking patterns
  • [ ] Examples in documentation
  • [ ] Examples in docstrings
  • [x] Type hints (first time trying these so might be wrong)
  • [ ] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
  • [x] Range argument
  • [ ] Handle multidimensional bins (for a future PR? - See https://github.com/xgcm/xhistogram/pull/59)
  • [ ] Handle np.datetime64 dtypes by refactoring to use np.searchsorted (for a future PR? See discussion)
  • [ ] Fast path for uniform bin widths (for a future PR? See suggestion)

Question: da.hist() or da.histogram()?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5400/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
925098557 MDExOlB1bGxSZXF1ZXN0NjczNjM4NDQy 5493 Fix bug when querying unnamed dataarray TomNicholas 35968931 open 0     0 2021-06-18T17:51:01Z 2022-11-21T22:32:37Z   MEMBER   0 pydata/xarray/pulls/5493

There might be a slightly neater way to do this, but this works.

  • [x] Closes #5492
  • [x] Tests added
  • [ ] 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/5493/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1426387580 PR_kwDOAMm_X85BtKwb 7233 Ensure Coarsen.construct keeps all coords TomNicholas 35968931 closed 0     0 2022-10-27T23:46:49Z 2022-10-28T17:46:50Z 2022-10-28T17:46:50Z MEMBER   0 pydata/xarray/pulls/7233
  • [x] Closes #7232
  • [x] Tests added
  • [x] 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/7233/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1417378270 PR_kwDOAMm_X85BPGqR 7192 Example using Coarsen.construct to split map into regions TomNicholas 35968931 closed 0     3 2022-10-20T22:14:31Z 2022-10-21T18:14:59Z 2022-10-21T18:14:56Z MEMBER   0 pydata/xarray/pulls/7192

I realised there is very little documentation on Coarsen.construct, so I added this example.

Unsure whether it should instead live in the page on reshaping and reorganising data though, as it is essentially a reshape operation. EDIT: Now on the reshape page

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

cc @jbusecke @paigem

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7192/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1391319978 PR_kwDOAMm_X84_4UWs 7107 2022.09.0 release summary TomNicholas 35968931 closed 0     0 2022-09-29T18:34:02Z 2022-09-29T21:57:43Z 2022-09-29T21:54:14Z MEMBER   0 pydata/xarray/pulls/7107

Thumbs up if it looks fine to you

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7107/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1386723044 PR_kwDOAMm_X84_pBKj 7090 Fill in missing docstrings for ndarray properties TomNicholas 35968931 closed 0     0 2022-09-26T21:05:37Z 2022-09-26T22:24:13Z 2022-09-26T22:05:34Z MEMBER   0 pydata/xarray/pulls/7090
  • [ ] ~~Closes #xxxx~~
  • [ ] ~~Tests added~~
  • [x] 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/7090/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1370416843 PR_kwDOAMm_X84-z6DG 7023 Remove dask_array_type checks TomNicholas 35968931 closed 0     3 2022-09-12T19:31:04Z 2022-09-13T00:35:25Z 2022-09-13T00:35:22Z MEMBER   0 pydata/xarray/pulls/7023
  • [ ] From https://github.com/pydata/xarray/pull/7019#discussion_r968606140
  • [ ] ~~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/7023/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
592312709 MDExOlB1bGxSZXF1ZXN0Mzk3MzIwNzgx 3925 sel along 1D non-index coordinates TomNicholas 35968931 closed 0     13 2020-04-02T02:23:56Z 2022-09-07T14:31:58Z 2022-09-07T14:31:58Z MEMBER   0 pydata/xarray/pulls/3925

As a user, I find not being able to select along one-dimensional non-dimensional coordinates actually comes up fairly often. I think it's quite common to use multiple coordinates to be able to choose between plotting in different coordinate systems (or units) easily.

I've tried to close #2028 in the simplest (but also least efficient) way which was suggested by @shoyer (suggestion 1 here).

This should be temporary anyway: it will get superseded by the explicit indexes refactor. If there is another approach which would achieve the same functionality as this PR but actually bring us closer to #1603 then I would be happy to take a stab at that instead.

I don't really know what to do about the failing test in groupby arithmetic - I think it's caused here but I'm not sure what to replace the triple error type catching (?!) with.

  • [x] Closes #2028
  • [x] Tests added
  • [ ] Passes isort -rc . && black . && mypy . && flake8
  • [ ] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3925/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1338010273 PR_kwDOAMm_X849IeCt 6913 Fix core team page TomNicholas 35968931 closed 0     0 2022-08-13T17:05:51Z 2022-08-15T13:39:47Z 2022-08-15T13:39:43Z MEMBER   0 pydata/xarray/pulls/6913

Adds missing core team members @alexamici and @aurghs to docs, as well as fixing @benbovy 's username.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6913/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1337587854 PR_kwDOAMm_X849HJCV 6912 Automatic PR labeler TomNicholas 35968931 closed 0     2 2022-08-12T18:40:27Z 2022-08-12T19:52:49Z 2022-08-12T19:47:19Z MEMBER   0 pydata/xarray/pulls/6912

GH action to automatically label new PRs according to which files they touch.

Idea stolen from dask, see https://github.com/dask/dask/pull/7506 . Their PR labelling by file/module is specified here.

(My first use of this bot so might well be a mistake.)

@max-sixty you will probably enjoy this extra automation :robot:

  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6912/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1078842125 PR_kwDOAMm_X84vxops 6076 Add labels to dataset diagram TomNicholas 35968931 closed 0     0 2021-12-13T18:21:02Z 2022-07-11T14:49:40Z 2022-01-03T16:58:51Z MEMBER   0 pydata/xarray/pulls/6076

While making a talk I made a version of our data structure diagram but with added labels along the bottom:

I think this helps clarify the relationship between Variables, DataArrays, and Datasets for new users.

I just made it quickly in inkscape by adding to the previous png - I only realised afterwards that the original was made in LaTeX, so maybe it would be better to add labels directly to that code?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6076/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
936313924 MDExOlB1bGxSZXF1ZXN0NjgzMDY3OTU5 5571 Rely on NEP-18 to dispatch to dask in duck_array_ops TomNicholas 35968931 closed 0     20 2021-07-03T19:24:33Z 2022-07-09T18:12:05Z 2021-09-29T17:48:40Z MEMBER   0 pydata/xarray/pulls/5571

Removes special-casing for dask in duck_array_ops.py, instead relying on NEP-18 to call it when the input is a dask array.

Probably actually don't need the _dask_or_eager_func() (now _module_func()) helper function at all, because all remaining instances look like pandas_isnull = _module_func("isnull", module=pd), which could just be pandas_isnull = pd.isnull.

Only problem is that I seem to have broken one (parameterized) test: test_duck_array_ops.py::test_min_count[True-True-None-sum-True-bool_-1] fails with

```python @pytest.mark.parametrize("dim_num", [1, 2]) @pytest.mark.parametrize("dtype", [float, int, np.float32, np.bool_]) @pytest.mark.parametrize("dask", [False, True]) @pytest.mark.parametrize("func", ["sum", "prod"]) @pytest.mark.parametrize("aggdim", [None, "x"]) @pytest.mark.parametrize("contains_nan", [True, False]) @pytest.mark.parametrize("skipna", [True, False, None]) def test_min_count(dim_num, dtype, dask, func, aggdim, contains_nan, skipna): if dask and not has_dask: pytest.skip("requires dask")

    da = construct_dataarray(dim_num, dtype, contains_nan=contains_nan, dask=dask)
    min_count = 3

    # If using Dask, the function call should be lazy.
    with raise_if_dask_computes():
      actual = getattr(da, func)(dim=aggdim, skipna=skipna, min_count=min_count)

/home/tegn500/Documents/Work/Code/xarray/xarray/tests/test_duck_array_ops.py:578:


/home/tegn500/Documents/Work/Code/xarray/xarray/core/common.py:56: in wrapped_func return self.reduce(func, dim, axis, skipna=skipna, kwargs) /home/tegn500/Documents/Work/Code/xarray/xarray/core/dataarray.py:2638: in reduce var = self.variable.reduce(func, dim, axis, keep_attrs, keepdims, kwargs) /home/tegn500/Documents/Work/Code/xarray/xarray/core/variable.py:1725: in reduce data = func(self.data, kwargs) /home/tegn500/Documents/Work/Code/xarray/xarray/core/duck_array_ops.py:328: in f return func(values, axis=axis, kwargs) /home/tegn500/Documents/Work/Code/xarray/xarray/core/nanops.py:106: in nansum a, mask = _replace_nan(a, 0) /home/tegn500/Documents/Work/Code/xarray/xarray/core/nanops.py:23: in _replace_nan mask = isnull(a) /home/tegn500/Documents/Work/Code/xarray/xarray/core/duck_array_ops.py:83: in isnull return pandas_isnull(data) /home/tegn500/Documents/Work/Code/xarray/xarray/core/duck_array_ops.py:40: in f return getattr(module, name)(args, kwargs) /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/pandas/core/dtypes/missing.py:127: in isna return _isna(obj) /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/pandas/core/dtypes/missing.py:166: in _isna return _isna_ndarraylike(np.asarray(obj), inf_as_na=inf_as_na) /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/numpy/core/_asarray.py:102: in asarray return array(a, dtype, copy=False, order=order) /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/dask/array/core.py:1502: in array x = self.compute() /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/dask/base.py:285: in compute (result,) = compute(self, traverse=False, kwargs) /home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/dask/base.py:567: in compute results = schedule(dsk, keys, *kwargs)


self = <xarray.tests.CountingScheduler object at 0x7f0804db2310> dsk = {('xarray-<this-array>-29953318277423606f95b509ad1a9aa7', 0): array([False, False, False, False], dtype=object), ('xar...pe=object), ('xarray-<this-array>-29953318277423606f95b509ad1a9aa7', 3): array([nan, False, False, nan], dtype=object)} keys = [[('xarray-<this-array>-29953318277423606f95b509ad1a9aa7', 0), ('xarray-<this-array>-29953318277423606f95b509ad1a9aa7'...array-<this-array>-29953318277423606f95b509ad1a9aa7', 2), ('xarray-<this-array>-29953318277423606f95b509ad1a9aa7', 3)]] kwargs = {}

def __call__(self, dsk, keys, **kwargs):
    self.total_computes += 1
    if self.total_computes > self.max_computes:
      raise RuntimeError(
            "Too many computes. Total: %d > max: %d."
            % (self.total_computes, self.max_computes)
        )

E RuntimeError: Too many computes. Total: 1 > max: 0.

/home/tegn500/Documents/Work/Code/xarray/xarray/tests/init.py:118: RuntimeError ```

  • [x] Closes #5559
  • [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/5571/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1012713019 PR_kwDOAMm_X84siCtw 5835 combine_nested dataarrays TomNicholas 35968931 open 0     1 2021-09-30T23:19:03Z 2022-06-09T14:50:16Z   MEMBER   0 pydata/xarray/pulls/5835

The spiritual successor to #4696 , this attempts to generalise combine_nested to handle both named and unnamed DataArrays in the same way that combine_by_coords does.

Unfortunately it doesn't actually work yet - I think the problem is a bit more subtle than I originally thought.

Ideally I would implement this using the same logical structure as in #5834, but my attempt to do that was thwarted by how tricky it is to iterate over a nested list-of-lists of arbitrary and modify the stored objects in place...

  • [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~~
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5835/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1223270563 PR_kwDOAMm_X843L_J2 6566 New inline_array kwarg for open_dataset TomNicholas 35968931 closed 0     11 2022-05-02T19:39:07Z 2022-05-11T22:12:24Z 2022-05-11T20:26:43Z MEMBER   0 pydata/xarray/pulls/6566

Exposes the inline_array kwarg of dask.array.from_array in xr.open_dataset, and ds/da/variable.chunk.

What setting this to True does is inline the array into the opening/chunking task, which avoids an an extra array object at the start of the task graph. That's useful because the presence of that single common task connecting otherwise independent parts of the graph can confuse the graph optimizer.

With open_dataset(..., inline_array=False):

With open_dataset(..., inline_array=True):

In our case (xGCM) this is important because once inlined the optimizer understands that all the remaining parts of the graph are embarrasingly-parallel, and realizes that it can fuze all our chunk-wise padding tasks into one padding task per chunk.

I think this option could help in any case where someone is opening data from a Zarr store (the reason we had this opener task) or a netCDF file.

The value of the kwarg should be kept optional because in theory inlining is a tradeoff between fewer tasks and more memory use, but I think there might be a case for setting the default to be True?

Questions: 1) How should I test this? 2) Should it default to False or True? 3) inline_array or inline? (inline_array doesn't really make sense for open_dataset, which creates multiple arrays)

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

@rabernat @jbusecke

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6566/reactions",
    "total_count": 3,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 2,
    "eyes": 0
}
    xarray 13221727 pull
1200309334 PR_kwDOAMm_X842BOIk 6471 Support **kwargs form in `.chunk()` TomNicholas 35968931 closed 0     6 2022-04-11T17:37:38Z 2022-04-12T03:34:49Z 2022-04-11T19:36:40Z MEMBER   0 pydata/xarray/pulls/6471

Also adds some explicit tests (and type hinting) for Variable.chunk(), as I don't think it had dedicated tests before.

  • [x] Closes #6459
  • [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/6471/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1157289286 PR_kwDOAMm_X84z1Xnf 6319 v2022.03.0 release notes TomNicholas 35968931 closed 0     2 2022-03-02T14:43:34Z 2022-03-02T19:49:25Z 2022-03-02T15:49:23Z MEMBER   0 pydata/xarray/pulls/6319  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6319/reactions",
    "total_count": 4,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 4,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1150694186 PR_kwDOAMm_X84zenJA 6307 Drop duplicates over multiple dims, and add Dataset.drop_duplicates TomNicholas 35968931 closed 0     0 2022-02-25T17:34:12Z 2022-03-01T23:13:38Z 2022-02-25T21:08:30Z MEMBER   0 pydata/xarray/pulls/6307

Allows for dropping duplicates over multiple dims at once, and adds Dataset.drop_duplicates.

  • [x] Inspired by this discussion question
  • [x] Tests added
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6307/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1039034826 PR_kwDOAMm_X84t0t3V 5912 Remove lock kwarg TomNicholas 35968931 closed 0     4 2021-10-28T23:36:13Z 2021-12-29T16:34:45Z 2021-12-29T16:34:45Z MEMBER   0 pydata/xarray/pulls/5912

These were due to be removed post-0.19.

  • [x] Completes deprecation cycle started in #5256
  • [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/5912/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1041675013 PR_kwDOAMm_X84t8yv7 5924 v0.20 Release notes TomNicholas 35968931 closed 0     2 2021-11-01T21:53:29Z 2021-11-02T19:22:46Z 2021-11-02T16:37:45Z MEMBER   0 pydata/xarray/pulls/5924

@pydata/xarray the release notes for your approval

5889

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5924/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1039714252 PR_kwDOAMm_X84t25p8 5916 Update open_rasterio deprecation version number TomNicholas 35968931 closed 0     2 2021-10-29T15:56:04Z 2021-11-02T18:03:59Z 2021-11-02T18:03:58Z MEMBER   0 pydata/xarray/pulls/5916  
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5916/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1039833986 PR_kwDOAMm_X84t3SlI 5917 Update minimum dependencies for 0.20 TomNicholas 35968931 closed 0     14 2021-10-29T18:38:37Z 2021-11-01T21:14:03Z 2021-11-01T21:14:02Z MEMBER   0 pydata/xarray/pulls/5917

=============== ====== ==== Package Old New =============== ====== ==== cartopy 0.17 0.18 cftime 1.1 1.2 dask 2.15 2.30 distributed 2.15 2.30 hdf5 1.10 1.12 lxml 4.5 4.6 matplotlib-base 3.2 3.3 numba 0.49 0.51 numpy 1.17 1.18 pandas 1.0 1.1 pint 0.15 0.16 scipy 1.4 1.5 seaborn 0.10 0.11 sparse 0.8 0.11 toolz 0.10 0.11 zarr 2.4 2.5 =============== ====== ====

  • [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/5917/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1012428149 PR_kwDOAMm_X84shL9H 5834 Combine by coords dataarray bugfix TomNicholas 35968931 closed 0     3 2021-09-30T17:17:00Z 2021-10-29T19:57:36Z 2021-10-29T19:57:36Z MEMBER   0 pydata/xarray/pulls/5834

Also reorganised the logic that deals with combining mixed sets of objects (i.e. named dataarrays, unnamed dataarrays, datasets) that was added in #4696.

TODO - same reorganisation / testing but for combine_nested as well as combine_by_coords. EDIT: I'm going to do this in a separate PR, so that this bugfix can be merged without it.

  • [x] Closes #5833
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] 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/5834/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1033884661 PR_kwDOAMm_X84tkKtA 5886 Use .to_numpy() for quantified facetgrids TomNicholas 35968931 closed 0     6 2021-10-22T19:25:24Z 2021-10-28T22:42:43Z 2021-10-28T22:41:59Z MEMBER   0 pydata/xarray/pulls/5886

Follows on from https://github.com/pydata/xarray/pull/5561 by replacing .values with .to_numpy() in more places in the plotting code. This allows pint.Quantity arrays to be plotted without issuing a UnitStrippedWarning (and will generalise better to other duck arrays later).

I noticed the need for this when trying out this example (but trying it without the .dequantify() call first).

(@Illviljan in theory .values should be replaced with .to_numpy() everywhere in the plotting code by the way)

  • [ ] Closes #xxxx
  • [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/5886/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1020555552 PR_kwDOAMm_X84s6zAH 5846 Change return type of DataArray.chunks and Dataset.chunks to a dict TomNicholas 35968931 closed 0     3 2021-10-08T00:02:20Z 2021-10-26T15:52:00Z 2021-10-26T15:51:59Z MEMBER   1 pydata/xarray/pulls/5846

Rectifies the the issue in #5843 by making DataArray.chunks and Variable.chunks consistent with Dataset.chunks. This would obviously need a deprecation cycle before it were merged.

Currently a WIP - I changed the behaviour but this obviously broke quite a few tests and I haven't looked at them yet.

  • [x] Closes #5843
  • [ ] 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
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5846/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1016576623 PR_kwDOAMm_X84stU8v 5839 Dataset.__setitem__ raise on being passed a Dataset (for single key) TomNicholas 35968931 closed 0     1 2021-10-05T17:18:43Z 2021-10-23T19:01:24Z 2021-10-23T19:01:24Z MEMBER   0 pydata/xarray/pulls/5839

Inspired by confusion in #5833, this PR slightly clarifies the error thrown when the user attempts to do ds['var'] = xr.Dataset. The original error is TypeError: cannot directly convert an xarray.Dataset into a numpy array. Instead, create an xarray.DataArray first, either with indexing on the Dataset or by invoking the `to_array()` method. while the new error is TypeError: Cannot assign a Dataset to a single key - only a DataArray or Variable object can be stored under a single key.

  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] 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/5839/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
957001788 MDExOlB1bGxSZXF1ZXN0NzAwNTEyNjg3 5653 Roll coords deprecation TomNicholas 35968931 closed 0     4 2021-07-30T19:16:59Z 2021-10-01T19:24:02Z 2021-10-01T18:54:22Z MEMBER   0 pydata/xarray/pulls/5653

The default behaviour of da.roll() caught me out whilst trying to hand-write a diff function, so I completed the transition to defaulting to roll_coords=False as the default. It's been throwing a warning for 3 years so I think it's time!

I also improved the docstrings and added type hints whilst there, although mypy doesn't seem to like some of the type hinting :/

  • [x] Completes deprecation started in #2360
  • [x] Tests updated
  • [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/5653/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
959317311 MDExOlB1bGxSZXF1ZXN0NzAyNDQ5NDg1 5669 Combine='by_coords' and concat dim deprecation in open_mfdataset TomNicholas 35968931 closed 0     2 2021-08-03T17:03:44Z 2021-10-01T18:52:00Z 2021-10-01T18:52:00Z MEMBER   0 pydata/xarray/pulls/5669

Noticed this hadn't been completed in https://github.com/pydata/xarray/discussions/5659

  • [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/5669/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
928490583 MDExOlB1bGxSZXF1ZXN0Njc2NDg2ODM0 5519 Type hints for combine functions TomNicholas 35968931 closed 0     4 2021-06-23T17:33:36Z 2021-09-30T20:16:45Z 2021-09-30T19:52:47Z MEMBER   0 pydata/xarray/pulls/5519

Added type hints to combine_nested and combine_by_coords.

Builds on #4696 because that PR generalised the argument types to include DataArrays, but I couldn't see that branch in the list to base this PR off of.

The "nested list-of-lists" argument to combine_nested opens up a can of worms: the only way I can see to specify the type of a nested list of arbitrary depth is to define the type recursively, but mypy does not currently support recursive type definitions, though some other type checkers can, e.g. Microsoft's Pylance does. We're going to have the same problem when specifying types for open_mfdataset. For now this problem is just ignored by the type checker, meaning that we don't actually check the type of the nested-list-of-lists.

  • [x] Passes pre-commit run --all-files
  • [ ] ~~User visible changes (including notable bug fixes) are documented in whats-new.rst~~
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5519/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
951882363 MDExOlB1bGxSZXF1ZXN0Njk2MTk4NDcx 5632 v0.19.0 release notes TomNicholas 35968931 closed 0     5 2021-07-23T20:38:49Z 2021-07-23T21:39:50Z 2021-07-23T21:12:53Z MEMBER   0 pydata/xarray/pulls/5632

Release notes:

rst This release brings improvements to plotting of categorical data, the ability to specify how attributes are combined in xarray operations, a new high-level :py:func:`unify_chunks` function, as well as various deprecations, bug fixes, and minor improvements.

  • [x] Closes #5588
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5632/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
935317034 MDExOlB1bGxSZXF1ZXN0NjgyMjU1NDE5 5561 Plots get labels from pint arrays TomNicholas 35968931 closed 0     6 2021-07-02T00:44:28Z 2021-07-21T23:06:21Z 2021-07-21T22:38:34Z MEMBER   0 pydata/xarray/pulls/5561

Stops you needing to call .pint.dequantify() before plotting.

Builds on top of #5568, so that should be merged first.

  • [x] Closes (1) from https://github.com/pydata/xarray/issues/3245#issue-484240082
  • [x] Tests added
  • [x] Tests passing
  • [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/5561/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
936045730 MDExOlB1bGxSZXF1ZXN0NjgyODYzMjgz 5568 Add to_numpy() and as_numpy() methods TomNicholas 35968931 closed 0     9 2021-07-02T20:17:40Z 2021-07-21T22:06:47Z 2021-07-21T21:42:48Z MEMBER   0 pydata/xarray/pulls/5568
  • [x] Closes #3245
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5568/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
400678645 MDExOlB1bGxSZXF1ZXN0MjQ1ODA4Nzg3 2690 Add create_test_data to public testing API TomNicholas 35968931 closed 0     11 2019-01-18T11:08:01Z 2021-06-24T08:51:36Z 2021-06-23T16:14:28Z MEMBER   0 pydata/xarray/pulls/2690
  • [x] Closes #2686 and #1839
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2690/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
602579471 MDExOlB1bGxSZXF1ZXN0NDA1NTc4NTA2 3982 Combine by point coords TomNicholas 35968931 closed 0     1 2020-04-19T00:00:30Z 2021-06-24T08:48:51Z 2021-06-23T15:58:30Z MEMBER   0 pydata/xarray/pulls/3982

This PR was based off of #3926, though it probably doesn't need to be and could be rebased if we wanted to merge this first.

  • [x] Closes #3774
  • [x] Tests added
  • [x] Passes isort -rc . && black . && mypy . && flake8
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3982/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
404945709 MDExOlB1bGxSZXF1ZXN0MjQ5MDE0MTc3 2729 [WIP] Feature: Animated 1D plots TomNicholas 35968931 closed 0     14 2019-01-30T20:15:52Z 2021-06-24T08:46:31Z 2021-06-23T16:14:28Z MEMBER   0 pydata/xarray/pulls/2729

This is an attempt at a proof-of-principle for making animated plots in the way I suggested in #2355. (Also relevant for #2030.)

This example code: ```python import matplotlib.pyplot as plt import xarray as xr

Load data as done in plotting tutorial

airtemps = xr.tutorial.open_dataset('air_temperature') air = airtemps.air - 273.15 air.attrs = airtemps.air.attrs air.attrs['units'] = 'deg C'

Downsample to make reasonably-sized gif

data = air.isel(lat=10, time=slice(None,None,40))

Create animated plot

anim = data.plot(animate_over='time') anim.save('line1.gif', writer='imagemagick') plt.show() ``` now produces this gif: ~~The units on the timeline are formatted incorrectly because this PR isn't merged yet~~

I think it looks pretty good! It even animates the title properly. The actual animation creation only takes one line to do.

This currently only works for a plot with a single line, which is animated over a coordinate dimension. ~~It also required some minor modifications/bugfixes to animatplot, so it probably isn't reproducible right out of the box yet.~~ If you want to try this out then use the develop branch of my forked version of animatplot.

The reason I've put this up is because I wanted to

  1. show people the level of complexity required, and
  2. get people's opinion on the implementation.

I feel like although it required only ~100 lines extra to do this then the logic is very fragmented and scattered through the plot.line and plot._infer_line_data functions. In 2D this would get even more complicated, but I can't see a good way to abstract the case of animation out?

(@t-makaro I expect you will be interested in this)

EDIT: To-Do list:

  • [x] Animate single line
  • [x] Animated line and static line on same axes
  • [x] Animate multiple lines on same axes
  • [x] Multiple animated line plots on same figure
  • [ ] ~~FacetGrids of multiple animated lines~~ (will leave for a later PR)
  • [ ] Complete set of tests
  • [x] Add animatplot as optional dependency
  • [x] Add new CI tests using animatplot
  • [ ] New documentation page
  • [x] Fix issues with formatting of timeline label (fixed by https://github.com/t-makaro/animatplot/pull/46)
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2729/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
905974760 MDExOlB1bGxSZXF1ZXN0NjU3MDE1ODU4 5398 Multi dimensional histogram (see #5400 instead) TomNicholas 35968931 closed 0     0 2021-05-28T19:59:02Z 2021-05-30T15:34:33Z 2021-05-28T20:00:08Z MEMBER   0 pydata/xarray/pulls/5398

Initial work on integrating the multi-dimensional dask-powered histogram functionality from xhistogram into xarray. Just working on the skeleton to fit around the histogram algorithm for now, to be filled in later.

  • [ ] Closes #4610
  • [x] API skeleton
  • [x] Redirect plot.hist
  • [ ] Tests added
  • [ ] Type hinting
  • [ ] 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

EDIT: Didn't notice that using git commit --amend has polluted the git history for this branch...

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5398/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
902830027 MDExOlB1bGxSZXF1ZXN0NjU0MTU2NTA5 5383 Corrected reference to blockwise to refer to apply_gufunc instead TomNicholas 35968931 closed 0     2 2021-05-26T19:23:53Z 2021-05-26T21:34:06Z 2021-05-26T21:34:06Z MEMBER   0 pydata/xarray/pulls/5383

I noticed that the apply_ufunc tutorial notebook says that xarray.apply_ufunc uses dask.array.blockwise, but that's no longer true as of PR #4060 .

  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5383/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
877944829 MDExOlB1bGxSZXF1ZXN0NjMxODI1Nzky 5274 Update release guide TomNicholas 35968931 closed 0     3 2021-05-06T19:50:53Z 2021-05-13T17:44:47Z 2021-05-13T17:44:47Z MEMBER   0 pydata/xarray/pulls/5274

Updated the release guide to account for what is now automated via github actions, and any other bits I felt could be clearer.

Now only 16 easy steps!

  • Motivated by #5232 and #5244
  • [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/5274/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
887597884 MDExOlB1bGxSZXF1ZXN0NjQwODE5NTMz 5289 Explained what a deprecation cycle is TomNicholas 35968931 closed 0     2 2021-05-11T15:15:08Z 2021-05-13T16:38:19Z 2021-05-13T16:38:19Z MEMBER   0 pydata/xarray/pulls/5289

Inspired by a question asked in #4696, but does not close that issue - [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/5289/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
871234354 MDExOlB1bGxSZXF1ZXN0NjI2Mjg2ODQy 5237 Add deprecation warnings for lock kwarg TomNicholas 35968931 closed 0     2 2021-04-29T16:45:45Z 2021-05-04T19:17:31Z 2021-05-04T19:17:31Z MEMBER   0 pydata/xarray/pulls/5237

Does this need a test?

  • [x] Closes #5073
  • [ ] 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/5237/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
874768820 MDExOlB1bGxSZXF1ZXN0NjI5MjU0ODU0 5255 Warn instead of error on combine='nested' with concat_dim supplied TomNicholas 35968931 closed 0     0 2021-05-03T17:38:10Z 2021-05-04T02:45:52Z 2021-05-04T02:45:52Z MEMBER   0 pydata/xarray/pulls/5255

Changes error introduced in #5231 into a warning, as discussed.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5255/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
870266283 MDExOlB1bGxSZXF1ZXN0NjI1NDg5NTQx 5231 open_mfdataset: Raise if combine='by_coords' and concat_dim=None TomNicholas 35968931 closed 0     1 2021-04-28T19:16:19Z 2021-04-30T12:41:17Z 2021-04-30T12:41:17Z MEMBER   0 pydata/xarray/pulls/5231

Fixes bug which allowed incorrect arguments to be passed to open_mfdataset without complaint.

The combination open_mfdataset(files, combine='by_coords', concat_dim='t') should never have been permitted, and in fact it wasn't permitted until the last part of the deprecation process from the old auto_combine. It makes no sense to pass this combination because the combine_by_coords function does not have a concat_dim argument at all!

The effect was pretty benign - the concat_dim arg wasn't really used for anything in that case, and the result of passing dodgy datasets would just be a less informative error. However there were multiple tests which assumed this behaviour was okay - I had to remove that particular parametrization for a bunch of your join tests @dcherian because they now fail with a different (clearer) error.

I also noticed a related issue which I fixed - internally open_mfdataset was performing a rearrangement of the input datasets that it needs for the case combine='nested', even in the case combine='by_coords'. I hadn't previously realised that we can just skip this rearrangement without issue, so open_mfdataset(combine='by_coords') should be a little bit faster now.

  • [x] Closes #5230
  • [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/5231/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
604265838 MDExOlB1bGxSZXF1ZXN0NDA2ODkyMzc3 3993 dim -> coord in DataArray.integrate TomNicholas 35968931 closed 0     2 2020-04-21T20:30:35Z 2021-02-05T21:48:39Z 2021-01-29T22:59:30Z MEMBER   0 pydata/xarray/pulls/3993
  • [x] Closes #3992
  • [x] Tests added
  • [x] Passes isort -rc . && black . && mypy . && flake8
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3993/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
592331420 MDExOlB1bGxSZXF1ZXN0Mzk3MzM1NTY3 3926 Remove old auto combine TomNicholas 35968931 closed 0     8 2020-04-02T03:25:54Z 2020-06-24T18:22:55Z 2020-06-24T18:22:55Z MEMBER   0 pydata/xarray/pulls/3926
  • [x] Finishes deprecation cycle started in #2616 (was supposed to have been done in 0.15)
  • [x] Passes isort -rc . && black . && mypy . && flake8
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API

I've set combine='by_coords' as the default argument to open_mfdataset. Technically we could go for either, as the deprecation warning just told users to make it explicit from now on, but going for by_coords rather than nested means that: - The concat_dim argument is not needed by default, - The default behaviour of the function is the "magic" one - users have to opt-in to the more explicit behaviour.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3926/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
599597677 MDExOlB1bGxSZXF1ZXN0NDAzMjA0MTI5 3970 keep attrs in interpolate_na TomNicholas 35968931 closed 0     2 2020-04-14T14:02:33Z 2020-04-17T20:16:27Z 2020-04-17T20:16:27Z MEMBER   0 pydata/xarray/pulls/3970

dataarray.interpolate_na was dropping attrs because even though the internal apply_ufunc call was being passed keep_attrs=True, the order of arguments index, da to apply_ufunc meant that it was trying to keep only the non-existent attrs from the first argument. I just swapped them round, and added a globally-aware keep_attrs kwarg.

  • [x] Closes #3968
  • [x] Tests added
  • [x] Passes isort -rc . && black . && mypy . && flake8
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3970/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "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 42.465ms · About: xarray-datasette