home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

20 rows where issue = 584837010 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • toddrjen 11
  • max-sixty 7
  • shoyer 1
  • dcherian 1

author_association 2

  • CONTRIBUTOR 11
  • MEMBER 9

issue 1

  • Implement idxmax and idxmin functions · 20 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
605588070 https://github.com/pydata/xarray/pull/3871#issuecomment-605588070 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTU4ODA3MA== max-sixty 5635139 2020-03-29T06:02:19Z 2020-03-29T06:02:19Z MEMBER

@toddrjen thank you again! This ended up being quite an adventure, really appreciate you pushing all the way.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
605545749 https://github.com/pydata/xarray/pull/3871#issuecomment-605545749 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTU0NTc0OQ== dcherian 2448579 2020-03-29T01:58:24Z 2020-03-29T01:58:24Z MEMBER

Thanks @toddrjen that's a great contribution!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
605542337 https://github.com/pydata/xarray/pull/3871#issuecomment-605542337 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTU0MjMzNw== toddrjen 2272878 2020-03-29T01:18:37Z 2020-03-29T01:18:37Z CONTRIBUTOR

I have gone over it one more time and made a few documentation fixes. Please take one more look before merging.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
605540515 https://github.com/pydata/xarray/pull/3871#issuecomment-605540515 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTU0MDUxNQ== max-sixty 5635139 2020-03-29T00:55:43Z 2020-03-29T00:55:43Z MEMBER

Amazing — let's merge on green!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
605387218 https://github.com/pydata/xarray/pull/3871#issuecomment-605387218 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTM4NzIxOA== max-sixty 5635139 2020-03-28T03:18:53Z 2020-03-28T03:18:53Z MEMBER

Thank you again @toddrjen, both for the content and the iteration.

@shoyer any final thoughts? Otherwise I'll merge tomorrow?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
605375373 https://github.com/pydata/xarray/pull/3871#issuecomment-605375373 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNTM3NTM3Mw== toddrjen 2272878 2020-03-28T01:32:00Z 2020-03-28T01:32:00Z CONTRIBUTOR

Here is a new commit with the discussed changes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
604798935 https://github.com/pydata/xarray/pull/3871#issuecomment-604798935 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNDc5ODkzNQ== toddrjen 2272878 2020-03-27T03:41:56Z 2020-03-27T03:41:56Z CONTRIBUTOR

I think I have implemented all the requested changes and all tests are passing. Please take a look.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
604462268 https://github.com/pydata/xarray/pull/3871#issuecomment-604462268 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNDQ2MjI2OA== toddrjen 2272878 2020-03-26T14:28:04Z 2020-03-26T14:28:04Z CONTRIBUTOR

I figured out what is going wrong. I will make a commit with a fix and include it in this pull request later today.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
604226585 https://github.com/pydata/xarray/pull/3871#issuecomment-604226585 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNDIyNjU4NQ== toddrjen 2272878 2020-03-26T04:46:07Z 2020-03-26T04:46:07Z CONTRIBUTOR

I am not sure why the tests are suddenly failing. The tests were all working, then I rebased on the latest master and they are failing and I can't figure out why.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
604219688 https://github.com/pydata/xarray/pull/3871#issuecomment-604219688 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwNDIxOTY4OA== toddrjen 2272878 2020-03-26T04:17:55Z 2020-03-26T04:17:55Z CONTRIBUTOR

Please see the newest version with the promote argument changed to fill_value.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
603900793 https://github.com/pydata/xarray/pull/3871#issuecomment-603900793 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMzkwMDc5Mw== toddrjen 2272878 2020-03-25T15:19:01Z 2020-03-25T15:19:01Z CONTRIBUTOR

That could work.

The corner case we would need to decide on is again promotion.

What happens if the fill value is a "higher" type in the numeric tower than the original type? What if it is lower?

  1. We could try to always convert to the fill dtype (or more often the dtype equivalent to the Python native type), and raise and exception of it doesn't work.
  2. We could promote the fill value or original data, whichever is "lower".

What if someone tries to use a string type for numeric data or vice versus? If we do option 1 that is easy. Otherwise we probably need to use numpy casting rules?

What about an object dtype fill value?

What about a date/time regard dtype?

On Mon, Mar 23, 2020, 23:49 Stephan Hoyer notifications@github.com wrote:

@shoyer commented on this pull request.

In xarray/core/dataset.py https://github.com/pydata/xarray/pull/3871#discussion_r396887940:

@@ -5914,5 +5921,169 @@ def pad(

     return self._replace_vars_and_dims(variables)
  • def idxmin(
  • self,
  • dim: Hashable = None,
  • axis: int = None,
  • skipna: bool = None,
  • promote: bool = None,

Just to throw out another API option: what about having a fill_value argument instead of promote? The default (fill_value=dtypes.NA) would do type promotion for integer dtypes and always fill with NA. Other values (e.g., fill_value=0) could be used to avoid type promotion with an integer coordinate.

Advantages:

  • No special cases to keep track of.
  • Consistent with other xarray methods that take a fill_value argument.

Disadvantages:

  • No built-in way to raise an error instead of promotion (but users could do this themselves pretty easily)
  • No built-in way to "only promote if necessary" (but this is a weird non-type stable API that doesn't work great with Dask, anyways)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/3871#discussion_r396887940, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARK43Q3GISCTFURNDUDQNDRJAUTJANCNFSM4LP7WEMA .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
602287483 https://github.com/pydata/xarray/pull/3871#issuecomment-602287483 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMjI4NzQ4Mw== shoyer 1217238 2020-03-22T22:37:40Z 2020-03-22T22:37:40Z MEMBER

In general this is really nicely put together. My main asks:

  1. Remove the unrelated API change to map
  2. Think about if the alternative of returning an arbitrary value rather than promotion or raising an error.

For details see the comments above. If we want to support (2), then it might make sense to use a string for selecting values of promote rather than True/False/None (e.g., so we can include the option to return an arbitrary coordinate value).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
602138813 https://github.com/pydata/xarray/pull/3871#issuecomment-602138813 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMjEzODgxMw== max-sixty 5635139 2020-03-22T02:32:53Z 2020-03-22T02:32:53Z MEMBER

LGTM! Any other thoughts before we merge?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
602134329 https://github.com/pydata/xarray/pull/3871#issuecomment-602134329 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMjEzNDMyOQ== toddrjen 2272878 2020-03-22T01:45:05Z 2020-03-22T01:45:05Z CONTRIBUTOR

I fixed the extra space in the docstring and moved the business logic to computation.py.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601991643 https://github.com/pydata/xarray/pull/3871#issuecomment-601991643 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTk5MTY0Mw== max-sixty 5635139 2020-03-21T04:13:32Z 2020-03-21T04:13:32Z MEMBER

Do you mean non-dimension coordinates?

Yes, thanks for clarifying

Does that even make sense in a general way? If they are 1D and tied to just one dimension coordinate that could be done, but if they are not tied to any dimension or tied to multiple dimensions or otherwise not 1D I am not sure what it would mean to take the idxmin/idxmax of them.

Yes, it wouldn't work in all cases, fair point. There are some cases in which it would work though, I'm unsure if it would be too complicated an interface to return them depending on whether it would work.

(and completely fine to contemplate these later)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601989897 https://github.com/pydata/xarray/pull/3871#issuecomment-601989897 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTk4OTg5Nw== max-sixty 5635139 2020-03-21T03:57:00Z 2020-03-21T03:57:00Z MEMBER

The one complication is that using DataArray.idxmax and DataArray.idxmin assumes that the Dataset would only ever contain DataArray objects

I hear you and share the impulse that baking this in seems not ideal. Though I think it's a reasonable compromise to make, and there are no plans to deviate from it.

(Ideally maybe we have a ._contained_class attribute on the dataset which is almost always DataArray)

I think having a lambda is fine too.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601982212 https://github.com/pydata/xarray/pull/3871#issuecomment-601982212 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTk4MjIxMg== toddrjen 2272878 2020-03-21T02:41:23Z 2020-03-21T02:41:23Z CONTRIBUTOR

@max-sixty

To what extent should this support non-index coordinates?

I am not familiar with non-index coordinates, what are those?

Do you mean non-dimension coordinates? Does that even make sense in a general way? If they are 1D and tied to just one dimension coordinate that could be done, but if they are not tied to any dimension or tied to multiple dimensions or otherwise not 1D I am not sure what it would mean to take the idxmin/idxmax of them.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601979282 https://github.com/pydata/xarray/pull/3871#issuecomment-601979282 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTk3OTI4Mg== toddrjen 2272878 2020-03-21T02:16:27Z 2020-03-21T02:16:27Z CONTRIBUTOR

@keewis @max-sixty The new commit with the requested changes has been pushed to this branch (except for the map one, pending ongoing discussion). Please take a look.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601947199 https://github.com/pydata/xarray/pull/3871#issuecomment-601947199 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTk0NzE5OQ== toddrjen 2272878 2020-03-20T23:06:45Z 2020-03-20T23:06:45Z CONTRIBUTOR

@keewis @max-sixty The map thing is purely a convenience function. I know there are other ways to do it, but since I thought this would be a useful feature for users in its own right, I did it that way. But of course I can do it another way if you disagree.

The one complication is that using DataArray.idxmax and DataArray.idxmin assumes that the Dataset would only ever contain DataArray objects. That may be mostly the case now, but I didn't want to bake that into the code. I could do it using a lambda or nested function, but as I said I thought this approach had other benefits to users.

I will address the other comments inline.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010
601814285 https://github.com/pydata/xarray/pull/3871#issuecomment-601814285 https://api.github.com/repos/pydata/xarray/issues/3871 MDEyOklzc3VlQ29tbWVudDYwMTgxNDI4NQ== max-sixty 5635139 2020-03-20T17:12:46Z 2020-03-20T17:12:46Z MEMBER

This looks extremely good and thorough! Thanks @toddrjen !

I'll have a proper look through later. I see a couple of minor questions I'll add in too. Others feel free to get ahead of me!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement idxmax and idxmin functions 584837010

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