Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List "Unindexed dimensions" separately in __repr__ #1221

Merged
merged 2 commits into from
Jan 22, 2017

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Jan 20, 2017

  • fixes Document the new __repr__ #1199
  • tests added / passed
  • passes git diff upstream/master | flake8 --diff (except for lines which need to be long for displaying a repr)
  • whatsnew entry

Previously (on master):

<xarray.Dataset>
Dimensions:  (x: 1, y: 2)
Coordinates:
  o x        (x) -
  o y        (y) -
Data variables:
    foo      (x, y) int64 1 2

Now:

<xarray.Dataset>
Dimensions:  (x: 1, y: 2)
Coordinates:
    *empty*
Unindexed dimensions:
    x, y
Data variables:
    foo      (x, y) int64 1 2

This version of the __repr__ should be much more self-explanatory.

Fixes GH1199

Previously (on master):

    <xarray.Dataset>
    Dimensions:  (x: 1, y: 2)
    Coordinates:
      o x        (x) -
      o y        (y) -
    Data variables:
        foo      (x, y) int64 1 2

Now:

    <xarray.Dataset>
    Dimensions:  (x: 1, y: 2)
    Coordinates:
        *empty*
    Unindexed dimensions:
        x, y
    Data variables:
        foo      (x, y) int64 1 2

This version of the `__repr__` should be much more self-explanatory.
@@ -685,6 +686,23 @@ def test_coords_merge_mismatched_shape(self):
actual = orig_coords.merge(other_coords)
self.assertDatasetIdentical(expected, actual)

def test_data_vars_properties(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we were missing tests for data_vars previously, which I noticed when I renamed the formatting function and an error appeared in the docs build. Oops!

@shoyer shoyer merged commit 84b326a into pydata:master Jan 22, 2017
@shoyer shoyer deleted the unindexed-dims-repr branch January 22, 2017 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document the new __repr__
2 participants