home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 2220689594

This data as json

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
2220689594 PR_kwDOAMm_X85rcmw1 8904 Handle extra indexes for zarr region writes 39069044 open 0     8 2024-04-02T14:34:00Z 2024-04-03T19:20:37Z   CONTRIBUTOR   0 pydata/xarray/pulls/8904
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

Small follow up to #8877. If we're going to drop the indices anyways for region writes, we may as well not raise if they are still in the dataset. This makes the user experience of region writes simpler:

```python ds = xr.tutorial.open_dataset("air_temperature") ds.to_zarr("test.zarr") region = {"time": slice(0, 10)}

This fails unless we remember to ds.drop_vars(["lat", "lon"])

ds.isel(**region).to_zarr("test.zarr", region=region) ```

I find this annoying because I often have a dataset with a bunch of unrelated indexes and have to remember which ones to drop, or use some verbose set logic. I thought #8877 might have already done this, but not quite. By just reordering the point at which we drop indices, we can now skip this. We still raise if data vars are passed that don't overlap with the region.

cc @dcherian

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8904/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 78.927ms · About: xarray-datasette