-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Array formatting fixes for sparse and NEP-18 arrays. #3211
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
Conversation
I also did a bit of cleanup (e.g., renaming methods) in xarray.core.formatting. Sparse arrays were previously not shown in the Dataset repr: <xarray.Dataset> Dimensions: (x: 4) Coordinates: y (x) int64 ... Dimensions without coordinates: x Data variables: a (x) float64 ...""" Now they are: <xarray.Dataset> Dimensions: (x: 4) Coordinates: y (x) int64 <COO: shape=(4,), nnz=3, fill_value=0> Dimensions without coordinates: x Data variables: a (x) float64 <COO: shape=(4,), nnz=4, fill_value=0.0>"""
Hello @shoyer! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2019-08-15 20:33:50 UTC |
xarray/tests/test_dataset.py
Outdated
@@ -178,24 +178,22 @@ def test_repr(self): | |||
data = create_test_data(seed=123) | |||
data.attrs["foo"] = "bar" | |||
# need to insert str dtype at runtime to handle both Python 2 & 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# need to insert str dtype at runtime to handle both Python 2 & 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still need this for supporting different endiannesses
Possible improvements:
|
This is a good idea, but it will require slightly more complex logic to pull items only from the front of an array. I don't have a lot of time to iterate on this right now, so I'm going to leave it for later.
I have now added in |
Re legacy dask: #3222 |
I also did a bit of cleanup (e.g., renaming methods) in xarray.core.formatting.
Sparse arrays were previously not shown in the Dataset repr:
Now they are:
black . && mypy . && flake8