home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 811321550 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • dcherian 2
  • bradyrx 2
  • schild 1

author_association 3

  • CONTRIBUTOR 2
  • MEMBER 2
  • NONE 1

issue 1

  • Bottleneck and dask objects ignore `min_periods` on `rolling` · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
997406431 https://github.com/pydata/xarray/issues/4922#issuecomment-997406431 https://api.github.com/repos/pydata/xarray/issues/4922 IC_kwDOAMm_X847czbf schild 4749283 2021-12-19T14:59:33Z 2021-12-19T15:18:45Z NONE

encountered the same problem by Bottleneck.move_rank() ; i have to judge the length of dataframe in advance

python vol_list =[3,5,10,20,30,60,90] for i in vol_list: if len(last_df) >= i: last_df['vol_big_than_today_count_'+str(i)] = move_rank(last_df['vol'], i)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Bottleneck and dask objects ignore `min_periods` on `rolling` 811321550
791465015 https://github.com/pydata/xarray/issues/4922#issuecomment-791465015 https://api.github.com/repos/pydata/xarray/issues/4922 MDEyOklzc3VlQ29tbWVudDc5MTQ2NTAxNQ== bradyrx 8881170 2021-03-05T14:47:46Z 2021-03-05T14:47:46Z CONTRIBUTOR

I feel like this should not work i.e. rolling window length (6) < size along axis (3). So the bottleneck error seems right.

This is normally the case, but with min_periods=1 it should just return the given value so long as there's at least one observation (as in case #2, where the boundaries return as normal and the middle number is smoothed).

Thanks for the pointer on #4977!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Bottleneck and dask objects ignore `min_periods` on `rolling` 811321550
791011542 https://github.com/pydata/xarray/issues/4922#issuecomment-791011542 https://api.github.com/repos/pydata/xarray/issues/4922 MDEyOklzc3VlQ29tbWVudDc5MTAxMTU0Mg== dcherian 2448579 2021-03-04T23:02:48Z 2021-03-04T23:02:48Z MEMBER

```

Just apply rolling to the base array.

ds.rolling(time=6, center=False, min_periods=1).mean() ```

I feel like this should not work i.e. rolling window length (6) < size along axis (3). So the bottleneck error seems right.

The chunk size error in the last example should go away with #4977

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Bottleneck and dask objects ignore `min_periods` on `rolling` 811321550
790986252 https://github.com/pydata/xarray/issues/4922#issuecomment-790986252 https://api.github.com/repos/pydata/xarray/issues/4922 MDEyOklzc3VlQ29tbWVudDc5MDk4NjI1Mg== bradyrx 8881170 2021-03-04T22:21:37Z 2021-03-04T22:32:01Z CONTRIBUTOR

@dcherian, to add to the complexity here, it's even weirder than originally reported. See my test cases below. This might alter how this bug is approached.

```python import xarray as xr

def _rolling(ds): return ds.rolling(time=6, center=False, min_periods=1).mean()

Length 3 array to test that min_periods is called in, despite asking

for 6 time-steps of smoothing

ds = xr.DataArray([1, 2, 3], dims='time') ds['time'] = xr.cftime_range(start='2021-01-01', freq='D', periods=3) ```

1. With bottleneck installed, min_periods is ignored as a kwarg with in-memory arrays.

(bottleneck installed) ```python

Just apply rolling to the base array.

ds.rolling(time=6, center=False, min_periods=1).mean()

ValueError: Moving window (=6) must between 1 and 3, inclusive

Group into single day climatology groups and apply

ds.groupby('time.dayofyear').map(_rolling)

ValueError: Moving window (=6) must between 1 and 1, inclusive ```

2. With bottleneck uninstalled, min_periods works with in-memory arrays.

(bottleneck uninstalled) ```python

Just apply rolling to the base array.

ds.rolling(time=6, center=False, min_periods=1).mean()

<xarray.DataArray (time: 3)> array([1. , 1.5, 2. ]) Coordinates: * time (time) object 2021-01-01 00:00:00 ... 2021-01-03 00:00:00

Group into single day climatology groups and apply

ds.groupby('time.dayofyear').map(_rolling)

<xarray.DataArray (time: 3)> array([1., 2., 3.]) Coordinates: * time (time) object 2021-01-01 00:00:00 ... 2021-01-03 00:00:00 ```

3. Regardless of bottleneck, dask objects ignore min_period when a groupby object.

This specifically seems like an issue with .map()

(independent of bottleneck installation) ```python

Just apply rolling to the base array.

ds.chunk().rolling(time=6, center=False, min_periods=1).mean().compute()

<xarray.DataArray (time: 3)> array([1. , 1.5, 2. ]) Coordinates: * time (time) object 2021-01-01 00:00:00 ... 2021-01-03 00:00:00

Group into single day climatology groups and apply

ds.chunk().groupby('time.dayofyear').map(_rolling)

ValueError: For window size 6, every chunk should be larger than 3, but the smallest chunk size is 1. Rechunk your array with a larger chunk size or a chunk size that more evenly divides the shape of your array. ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Bottleneck and dask objects ignore `min_periods` on `rolling` 811321550
781571084 https://github.com/pydata/xarray/issues/4922#issuecomment-781571084 https://api.github.com/repos/pydata/xarray/issues/4922 MDEyOklzc3VlQ29tbWVudDc4MTU3MTA4NA== dcherian 2448579 2021-02-18T19:08:44Z 2021-02-18T19:08:44Z MEMBER

Maybe the padding is breaking down for length-1 arrays?

I would look at padded in this function https://github.com/pydata/xarray/blob/c9b9eec73a033e275b6012e7d391dd42591ccf52/xarray/core/rolling.py#L461-L463

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Bottleneck and dask objects ignore `min_periods` on `rolling` 811321550

Advanced export

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

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 12.58ms · About: xarray-datasette