home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

2 rows where state = "closed" and user = 42680748 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 2

  • issue 1
  • pull 1

state 1

  • closed · 2 ✖

repo 1

  • xarray 2
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
1615645463 PR_kwDOAMm_X85Ll0US 7598 Fix missing 'dim' argument in _get_nan_block_lengths Ockenfuss 42680748 closed 0     3 2023-03-08T17:28:56Z 2023-03-23T16:04:32Z 2023-03-16T18:55:56Z CONTRIBUTOR   0 pydata/xarray/pulls/7598
  • Add missing dim argument (GH7597)
  • Append a nan gap at the end of existing tests cases

  • [x] Closes #7597

  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7598/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
1615599224 I_kwDOAMm_X85gTBZ4 7597 Interpolate_na: max_map argument not working at array boundaries Ockenfuss 42680748 closed 0     6 2023-03-08T16:56:36Z 2023-03-16T18:55:58Z 2023-03-16T18:55:58Z CONTRIBUTOR      

What happened?

In the case of multidimensional arrays, the max_gap argument of interpolate_na is currently not working correctly at the array boundaries. This is likely due to a missing "dim" argument in the max() aggregation in xarray.core.missing._get_nan_block_lengths, I think.

What did you expect to happen?

In the following code example, due to max_gap=2, no extrapolation should be performed for the second row. Currently, this is the case, the output created is:

<xarray.DataArray (x: 2, y: 5)> array([[1., 2., 3., 4., 5.], [1., 2., 3., 4., 5.]]) Coordinates: * x (x) int64 0 1 * y (y) int64 0 1 2 3 4

Minimal Complete Verifiable Example

Python import xarray as xr import numpy as np da=xr.DataArray([[1, 2,3,4, np.nan],[1,2, np.nan, np.nan, np.nan]], coords=[('x', [0,1]), ('y', [0,1,2,3,4])]) da_interp=da.interpolate_na(dim='y', max_gap=2, fill_value='extrapolate') print(da_interp)

MVCE confirmation

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

Relevant log output

No response

Anything else we need to know?

I added the missing dim argument and adapted the test cases (Currently, there was no test case for fully multidimensional arrays with a gap at the end).

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-135-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.2 libnetcdf: 4.9.0 xarray: 2023.2.0 pandas: 1.5.3 numpy: 1.23.5 scipy: 1.8.1 netCDF4: 1.6.1 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.6.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.5 dask: 2022.10.2 distributed: None matplotlib: 3.6.3 cartopy: None seaborn: None numbagg: 0.2.1 fsspec: 2022.10.0 cupy: None pint: 0.20.1 sparse: None flox: 0.6.8 numpy_groupies: 0.9.20 setuptools: 58.1.0 pip: 23.0.1 conda: None pytest: None mypy: None IPython: 8.6.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7597/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

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 20.921ms · About: xarray-datasette