home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 276241764 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

  • shoyer 5
  • max-sixty 3
  • jhamman 2
  • stale[bot] 1

author_association 2

  • MEMBER 10
  • NONE 1

issue 1

  • Utility to restore original dimension order after apply_ufunc · 11 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
554600952 https://github.com/pydata/xarray/issues/1739#issuecomment-554600952 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1NDYwMDk1Mg== max-sixty 5635139 2019-11-16T03:48:19Z 2019-11-16T03:48:19Z MEMBER

OK great. We can meditate on it for a while, no great rush! Thanks for engaging.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
554594809 https://github.com/pydata/xarray/issues/1739#issuecomment-554594809 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1NDU5NDgwOQ== shoyer 1217238 2019-11-16T02:21:44Z 2019-11-16T02:21:44Z MEMBER

we would either have to raise an error or automatically transpose the second variable. Neither option sounds great to me.

Agree, I was thinking we'd transpose the second one, but fair if you think too invasive

Maybe this would be fine. We already do automatic alignment, and this is really not that much different.

It would be a breaking change, though, so we would need to roll it out slowly.

Perhaps this could be relaxed now that Python's dict always preserves the order in which items are added.

Ah OK. If we relaxed that, what would the order be? Just the order they were initially added, and so at least consistent through time (though not necessarily with the variables)?

Yes, that's right.

One potential concern is that this would expose a detail of xarray's data model that would not be easy for users to control. I can imagine that we might have internal xarray methods that inadvertently change dimension order.

So maybe this would make sense only if we also do your other suggested change (enforcing a consistent dimension order throughout a Dataset).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
554592920 https://github.com/pydata/xarray/issues/1739#issuecomment-554592920 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1NDU5MjkyMA== max-sixty 5635139 2019-11-16T02:01:08Z 2019-11-16T02:01:08Z MEMBER

we would either have to raise an error or automatically transpose the second variable. Neither option sounds great to me.

Agree, I was thinking we'd transpose the second one, but fair if you think too invasive

Perhaps this could be relaxed now that Python's dict always preserves the order in which items are added.

Ah OK. If we relaxed that, what would the order be? Just the order they were initially added, and so at least consistent through time (though not necessarily with the variables)?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
554585004 https://github.com/pydata/xarray/issues/1739#issuecomment-554585004 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1NDU4NTAwNA== shoyer 1217238 2019-11-16T00:50:57Z 2019-11-16T00:50:57Z MEMBER

Consistent dimension ordering is usually a best practice, but I'm not sure we want to enforce it. If a user explicitly supplies two variables, with dimensions ('x', 'y') and ('y', 'x'), respectively, we would either have to raise an error or automatically transpose the second variable. Neither option sounds great to me.

As for the current order in ds.dims, right now we use sorted order. Mostly this is because I didn't want to need to use an OrderedDict for keeping track of dimensions on datasets, and until recently Python dict order was entirely arbitrary. Perhaps this could be relaxed now that Python's dict always preserves the order in which items are added.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
554581481 https://github.com/pydata/xarray/issues/1739#issuecomment-554581481 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1NDU4MTQ4MQ== max-sixty 5635139 2019-11-16T00:28:37Z 2019-11-16T00:28:37Z MEMBER

What do we think about attempting to enforce a dimension order throughout the dataset? That would solve these issues for free.

We already have some order in .dims & .sizes. Could we transpose all dimensions to that ordering after any operation?

(Maybe this doesn't need to be strictly enforced, but we'd at least set the expectation that dimensions could be reordered to that dimension order at any time)

Or are there uses to having different dimension order throughout a dataset?

```python In [45]: ds Out[45]: <xarray.Dataset> Dimensions: (lat: 25, lon: 53, time: 2920) Coordinates: * lat (lat) float32 75.0 72.5 70.0 67.5 65.0 ... 25.0 22.5 20.0 17.5 15.0 * lon (lon) float32 200.0 202.5 205.0 207.5 ... 322.5 325.0 327.5 330.0 * time (time) datetime64[ns] 2013-01-01 ... 2014-12-31T18:00:00 Data variables: air (time, lat, lon) float32 ... Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...

In [46]: ds.dims Out[46]: Frozen(SortedKeysDict({'lat': 25, 'time': 2920, 'lon': 53}))

In [47]: ds.sizes Out[47]: Frozen(SortedKeysDict({'lat': 25, 'time': 2920, 'lon': 53})) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
551352469 https://github.com/pydata/xarray/issues/1739#issuecomment-551352469 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDU1MTM1MjQ2OQ== stale[bot] 26384082 2019-11-08T02:10:34Z 2019-11-08T02:10:34Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
350151394 https://github.com/pydata/xarray/issues/1739#issuecomment-350151394 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDM1MDE1MTM5NA== shoyer 1217238 2017-12-08T02:06:59Z 2017-12-08T02:06:59Z MEMBER

What if we just supplied an output_dims kwarg to apply_ufunc or apply_raw?

We could do that, but how to do we handle specifying output dimensions for a Dataset function? Maybe use a dict?

This is part of why a helper function starts to make sense to me.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
350145043 https://github.com/pydata/xarray/issues/1739#issuecomment-350145043 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDM1MDE0NTA0Mw== jhamman 2443309 2017-12-08T01:25:21Z 2017-12-08T01:25:21Z MEMBER

What if we just supplied an output_dims kwarg to apply_ufunc or apply_raw?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
347178210 https://github.com/pydata/xarray/issues/1739#issuecomment-347178210 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDM0NzE3ODIxMA== shoyer 1217238 2017-11-27T13:15:42Z 2017-11-27T13:15:42Z MEMBER

I started trying to implement this in apply_ufunc and then realized why I hadn't done so before: it's really not clear how to match up input/output arguments if there are more than one of each. We could do something special for there first input/output but that could be more confusing than helpful.

This is probably better reserved for the simpler apply_raw(https://github.com/pydata/xarray/issues/1618).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
347078577 https://github.com/pydata/xarray/issues/1739#issuecomment-347078577 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDM0NzA3ODU3Nw== jhamman 2443309 2017-11-27T04:54:03Z 2017-11-27T04:54:03Z MEMBER

At this point, I think I'm +1 on either automatically restoring dimension order or providing some option to do so (with restoring as the default). I'm still getting used to apply_ufunc so I'm not sure I feel strongly enough to make this call yet though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764
346746989 https://github.com/pydata/xarray/issues/1739#issuecomment-346746989 https://api.github.com/repos/pydata/xarray/issues/1739 MDEyOklzc3VlQ29tbWVudDM0Njc0Njk4OQ== shoyer 1217238 2017-11-24T05:39:22Z 2017-11-24T05:39:22Z MEMBER

I wonder if it would make sense to simply change the behavior of apply_ufunc so existing dimensions always get restored to their original location, and only new dimensions remain at the end. It seems like this is almost always desirable.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Utility to restore original dimension order after apply_ufunc 276241764

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 29.878ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows