home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 272841208

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1199#issuecomment-272841208 https://api.github.com/repos/pydata/xarray/issues/1199 272841208 MDEyOklzc3VlQ29tbWVudDI3Mjg0MTIwOA== 4160723 2017-01-16T11:47:47Z 2017-01-16T11:47:47Z MEMBER

I'm still not super happy with using o in the new repr

Yes this does not seem like the best alternative.

after giving it a second thought: have you considered not to list the coordinates with "o" in the coords repr?

+1. That was the initial implementation in #1017 I think, which is the most consistent. But @crusaderky raised an issue of readability (see https://github.com/pydata/xarray/pull/1017#issuecomment-260777664).

IMO this issue of readability is more a bad habit of using the Coordinates section to actually inspect the dimensions (and thus not focusing enough on the Dimensions section), resulting from the old behavior where each dimension was guaranteed to have a (default) coordinate. Now that this is not the case anymore I wonder if new xarray users (i.e., after #1017) will encounter this issue of readability.

If this remains an issue, another option than the ones above would be to list dimensions with no index in a separate, dedicated section of the repr, e.g. with the examples above,

<xarray.Dataset> Dimensions: (dim_0: 3) Unindexed dimensions: dim_0 Data variables: var (dim_0) int64 1 2 3

<xarray.DataArray 'xy' (y: 2, x: 3)> array([[ 1.1, 2.2, 3.3], [ 4.4, 5.5, 6.6]]) Unindexed dimensions: y Coordinates: * x (x) float64 0.1 1.1 2.2 xy (y, x) float64 1.1 2.2 3.3 4.4 5.5 6.6

To not add too much verbosity, multiple dimensions without coord may be displayed inline:

<xarray.Dataset> Dimensions: (dim_0: 3, dim_1: 4) Unindexed dimensions: dim_0, dim_1 Data variables: var (dim_0) int64 1 2 3

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  200125945
Powered by Datasette · Queries took 0.637ms · About: xarray-datasette