home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

22 rows where author_association = "CONTRIBUTOR" and user = 223250 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 6

  • Allow no padding for rolling windows 8
  • Add `Dataset.drop_dims` 6
  • Add examples for `DataArrayRolling.reduce()` 4
  • rolling: allow control over padding 2
  • Removing dimensions from Dataset objects 1
  • Feature Request: Efficient rolling with strides 1

user 1

  • kmsquire · 22 ✖

author_association 1

  • CONTRIBUTOR · 22 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
885080322 https://github.com/pydata/xarray/pull/5603#issuecomment-885080322 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840wUEC kmsquire 223250 2021-07-22T17:18:58Z 2021-07-22T17:18:58Z CONTRIBUTOR

There was some discussion about syntax at the dev meeting today. There were multiple votes in favour of allowing full control of padding in the rolling object itself. So we could have

  1. .rolling(time=5, x=3, pad={"x": {"mode": "wrap"}, "time": False}), OR
  2. .rolling(time=5, x=3).pad({"x": {"mode": "wrap"}, "time": False})

FWIW, I think 1 would be more efficient (but perhaps harder to implement). With this one, the DataArrayRolling object is only created once, with all of the required information.

If 2 were implemented, what should the return value of the .pad() call be? Would it call construct on the rolling object and return a DataArray? Or would it return an updated DataArrayRolling object? Or would it be a new type entirely (e.g., DataArrayPaddedRolling)?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
884377683 https://github.com/pydata/xarray/issues/3608#issuecomment-884377683 https://api.github.com/repos/pydata/xarray/issues/3608 IC_kwDOAMm_X840tohT kmsquire 223250 2021-07-21T17:53:59Z 2021-07-21T17:53:59Z CONTRIBUTOR

Question: instead of adding stride to reduce and _reduce_method, why not add it as a member of DataArrayRolling directly? This would allow, e.g., __iter__ to use it as well, and seems like a cleaner interface.

I've been confused why some parameters are available only in construct (stride, fill_value), some are available both in construct and in the DataArrayRolling constructor (keep_attrs), and some are only available in the constructor (min_periods, center, and soon pad).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature Request: Efficient rolling with strides 535703663
883763039 https://github.com/pydata/xarray/pull/5603#issuecomment-883763039 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840rSdf kmsquire 223250 2021-07-20T23:08:26Z 2021-07-20T23:08:26Z CONTRIBUTOR

Mentioned in one of the comments above, but I think I've reached about the amount of time that I can spend on this right now. If there are other minor changes, please do let me know. I can also back out the breaking change if desired (although that will probably take some commit surgery).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
883754891 https://github.com/pydata/xarray/pull/5603#issuecomment-883754891 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840rQeL kmsquire 223250 2021-07-20T22:48:21Z 2021-07-20T22:48:21Z CONTRIBUTOR

The code also introduces a problem, the following no longer works: xr.DataArray([1, 2, 3], coords=dict(x=[1, 1, 1])).rolling(x=3).mean() thus you may have to use isel instead of sel if possible. Therefore I was also unable to test the following (from #2007 (comment)):

monthly.pad(month=n_months, mode="wrap").rolling(center=True, month=n_months, pad=False).mean(skipna=False)

Fixed and added a test for this. The example at the bottom now works.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
882856489 https://github.com/pydata/xarray/pull/5603#issuecomment-882856489 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840n1Ip kmsquire 223250 2021-07-19T21:02:27Z 2021-07-19T21:02:27Z CONTRIBUTOR

@dcherian Thank you for reviewing. I've started working through your comments.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
881781419 https://github.com/pydata/xarray/pull/5603#issuecomment-881781419 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840juqr kmsquire 223250 2021-07-17T00:16:18Z 2021-07-17T00:16:18Z CONTRIBUTOR

Also, FWIW, the test failure was caused by a problem in zarr/fsspec (https://github.com/intake/filesystem_spec/issues/707), which is fixed in master on fsspec (https://github.com/intake/filesystem_spec/pull/710).

So it should be fixed here whenever fsspec makes a release.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
881773236 https://github.com/pydata/xarray/pull/5603#issuecomment-881773236 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840jsq0 kmsquire 223250 2021-07-16T23:41:55Z 2021-07-16T23:41:55Z CONTRIBUTOR

@dcherian Okay, I think this is in good shape. I added some more tests, and fixed a few more bugs. Most of the fixes have been squashed back down to the original commit.

I left the second commit separate for now because it's breaking. Previously, iterating over a rolling window returned only returned blocks present in the original array, and ignored the chunk of nans before the start or after the end of the array. This meant that the view of the DataArray or Dataset that was returned for each iteration was potentially a different size.

Here, instead, the iterator was changed so that each returned view matches the corresponding slice of the output of the construct() function. To me, this seems more intuitive, and makes it easier to develop algorithms without having to call construct.

Other than the fact that it's breaking, the main drawback (and difference with construct()) is that the windows themselves are labeled with coordinates along the rolling axis, except for any nan values before the start or after the end of the actual data, which do not have labels. For comparison, in construct, the window dimension does not have any coordinates associated with it by default.

After writing this, I'm wondering if it might be useful to simply drop the coordinates along the rolling axis, so that the behavior matches the behavior of construct() even more closely.

I'm open to thoughts/comments/criticisms/suggestions/questions/whatever.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
881698914 https://github.com/pydata/xarray/pull/5603#issuecomment-881698914 https://api.github.com/repos/pydata/xarray/issues/5603 IC_kwDOAMm_X840jahi kmsquire 223250 2021-07-16T20:25:36Z 2021-07-16T20:25:36Z CONTRIBUTOR

@dcherian Thanks. I thought I was done, but I'm finding things that aren't working as expected. I'm working on adding more tests for expected behavior, so marking as WIP. Will ping back here when I'm finished (maybe today, maybe early next week).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
880222929 https://github.com/pydata/xarray/pull/5603#issuecomment-880222929 https://api.github.com/repos/pydata/xarray/issues/5603 MDEyOklzc3VlQ29tbWVudDg4MDIyMjkyOQ== kmsquire 223250 2021-07-14T21:29:10Z 2021-07-14T21:29:10Z CONTRIBUTOR

FWIW, the test failures are all the same error, which should be fixed, but should have nothing to do with this PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow no padding for rolling windows 944714417
880141480 https://github.com/pydata/xarray/issues/2007#issuecomment-880141480 https://api.github.com/repos/pydata/xarray/issues/2007 MDEyOklzc3VlQ29tbWVudDg4MDE0MTQ4MA== kmsquire 223250 2021-07-14T19:10:46Z 2021-07-14T19:10:46Z CONTRIBUTOR

I added support for .rolling(..., pad=False) in #5603. The basic implementation was simple, but getting it working for bottleneck/dask took a little more work.

That fixes, e.g., #4743, but I don't think it's a complete fix for this issue.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling: allow control over padding 307783090
876103462 https://github.com/pydata/xarray/issues/2007#issuecomment-876103462 https://api.github.com/repos/pydata/xarray/issues/2007 MDEyOklzc3VlQ29tbWVudDg3NjEwMzQ2Mg== kmsquire 223250 2021-07-08T03:55:33Z 2021-07-08T03:55:33Z CONTRIBUTOR

.pad(...).rolling(..., pad=False)

For this API, it seems that the only thing that would need to be implemented would be adding a pad keyword argument to rolling, defaulting to True. Is that correct?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling: allow control over padding 307783090
493632403 https://github.com/pydata/xarray/pull/2968#issuecomment-493632403 https://api.github.com/repos/pydata/xarray/issues/2968 MDEyOklzc3VlQ29tbWVudDQ5MzYzMjQwMw== kmsquire 223250 2019-05-18T00:18:37Z 2019-05-18T00:18:37Z CONTRIBUTOR

@dcherian added. Let me know if you want any changes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add examples for `DataArrayRolling.reduce()`  445045305
493497801 https://github.com/pydata/xarray/pull/2968#issuecomment-493497801 https://api.github.com/repos/pydata/xarray/issues/2968 MDEyOklzc3VlQ29tbWVudDQ5MzQ5NzgwMQ== kmsquire 223250 2019-05-17T15:34:23Z 2019-05-17T15:34:23Z CONTRIBUTOR

Changed to simply add examples to DataArrayRolling.reduce(). I changed the original description accordingly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add examples for `DataArrayRolling.reduce()`  445045305
493494703 https://github.com/pydata/xarray/pull/2968#issuecomment-493494703 https://api.github.com/repos/pydata/xarray/issues/2968 MDEyOklzc3VlQ29tbWVudDQ5MzQ5NDcwMw== kmsquire 223250 2019-05-17T15:25:45Z 2019-05-17T15:26:03Z CONTRIBUTOR

Actually, every window has at least 1 valid value, so this change isn't really needed at all.

I'll remove the code changes, and change the added example to show a working example of what I wanted.

I will say that min_periods isn't the most obvious name for this parameter--I'm struggling to figure out how the number of valid observations in a window is related to periods or periodicity.

Would it be reasonable to deprecate min_periods and change it to something like min_observations?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add examples for `DataArrayRolling.reduce()`  445045305
493489589 https://github.com/pydata/xarray/pull/2968#issuecomment-493489589 https://api.github.com/repos/pydata/xarray/issues/2968 MDEyOklzc3VlQ29tbWVudDQ5MzQ4OTU4OQ== kmsquire 223250 2019-05-17T15:10:49Z 2019-05-17T15:10:49Z CONTRIBUTOR

@mathause, thank you, I didn't realize that. I'll make those changes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add examples for `DataArrayRolling.reduce()`  445045305
469088112 https://github.com/pydata/xarray/pull/2767#issuecomment-469088112 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2OTA4ODExMg== kmsquire 223250 2019-03-04T01:22:04Z 2019-03-04T01:22:04Z CONTRIBUTOR

No worries--thanks for merging!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228
468980810 https://github.com/pydata/xarray/pull/2767#issuecomment-468980810 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2ODk4MDgxMA== kmsquire 223250 2019-03-03T02:28:02Z 2019-03-03T02:28:02Z CONTRIBUTOR

Rebased to fix the NEWS conflict.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228
467568430 https://github.com/pydata/xarray/pull/2767#issuecomment-467568430 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2NzU2ODQzMA== kmsquire 223250 2019-02-26T19:02:23Z 2019-02-26T19:02:23Z CONTRIBUTOR

@shoyer I force pushed the requested changes. Please let me know if there is anything else. Thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228
466463669 https://github.com/pydata/xarray/pull/2767#issuecomment-466463669 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2NjQ2MzY2OQ== kmsquire 223250 2019-02-22T16:47:11Z 2019-02-22T16:47:11Z CONTRIBUTOR

I agree that it makes sense to recompute dimensions from variables.

Okay, that's what this PR already did (via the call to _replace_with_new_dims).

Rebased on master. From my perspective, this should be good to go.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228
466083575 https://github.com/pydata/xarray/pull/2767#issuecomment-466083575 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2NjA4MzU3NQ== kmsquire 223250 2019-02-21T17:11:05Z 2019-02-21T17:11:05Z CONTRIBUTOR

@shoyer I'm sure you're busy... wondering if you might have time to review this (or direct it to someone else to review)? Other than my question above, it should be pretty straightforward.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228
463309270 https://github.com/pydata/xarray/issues/1949#issuecomment-463309270 https://api.github.com/repos/pydata/xarray/issues/1949 MDEyOklzc3VlQ29tbWVudDQ2MzMwOTI3MA== kmsquire 223250 2019-02-13T18:20:28Z 2019-02-13T18:20:28Z CONTRIBUTOR

I was looking for a way to drop dimensions, similar to the OP, and found this issue. I created an implementation of Dataset.drop_dims in #2767 which should work.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Removing dimensions from Dataset objects 301031693
463078403 https://github.com/pydata/xarray/pull/2767#issuecomment-463078403 https://api.github.com/repos/pydata/xarray/issues/2767 MDEyOklzc3VlQ29tbWVudDQ2MzA3ODQwMw== kmsquire 223250 2019-02-13T06:38:43Z 2019-02-13T06:38:43Z CONTRIBUTOR

I was looking for this functionality and ran across #1949.

There was one bit of behavior that was unclear to me. Say I have

```python In [6]: data = xr.Dataset({'A': (['x', 'y'], np.random.randn(2, 3)), ...: 'B': ('x', np.random.randn(2)), ...: 'x': ['a', 'b'], 'z': np.pi})

In [7]: data Out[7]: <xarray.Dataset> Dimensions: (x: 2, y: 3) Coordinates: * x (x) <U1 'a' 'b' Dimensions without coordinates: y Data variables: A (x, y) float64 -0.662 -0.705 -0.1866 -0.8655 0.5816 -0.2308 B (x) float64 -0.1002 2.402 z float64 3.142

In [8]: data.drop_dims('x') Out[8]: <xarray.Dataset> Dimensions: () Data variables: z float64 3.142 ```

In this case, I dropped x, but because that eliminated variable A, I also dropped my y dimension, since A was the only variable using y.

At one point, I implemented this slightly differently, which instead gave

python In [8]: data.drop_dims('x') Out[8]: <xarray.Dataset> Dimensions: (y: 3) Dimensions without coordinates: y Data variables: z float64 3.142

In some ways, this seems preferable, especially if y has coordinates. The only downside I can see is that this version called Dataset._replace_vars_and_dims(), the docstring for which says it's deprecated (although it's still widely used).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add `Dataset.drop_dims` 409618228

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