home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 584837010 and user = 2272878 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • toddrjen · 11 ✖

issue 1

  • Implement idxmax and idxmin functions · 11 ✖

author_association 1

  • CONTRIBUTOR 11
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
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
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
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
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

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