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

Fix exception when display_expand_data=False for file-backed array. #5235

Merged
merged 7 commits into from
May 6, 2021

Conversation

tomwhite
Copy link
Contributor

See discussion in #5126 (review)

Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

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

thanks for the follow-up, @tomwhite, this looks great. However, I would remove the difference between expanded and collapsed for MemoryCachedArray since it's always a single line (see the inline comments below).

xarray/tests/test_formatting.py Outdated Show resolved Hide resolved
xarray/core/formatting.py Outdated Show resolved Hide resolved
xarray/tests/test_formatting.py Outdated Show resolved Hide resolved
@dcherian dcherian mentioned this pull request Apr 30, 2021
13 tasks
Co-authored-by: keewis <keewis@users.noreply.github.com>
@pep8speaks
Copy link

pep8speaks commented May 4, 2021

Hello @tomwhite! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-05-05 10:10:40 UTC

tomwhite and others added 2 commits May 4, 2021 09:15
Co-authored-by: keewis <keewis@users.noreply.github.com>
Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

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

apparently, the memory cached array has to be bigger than 1e5 to be displayed as [xyz values with dtype=DTYPE], so we can either keep the test as is or increase the size. Not sure which is better, but in any case, the repr still is a single line. Thoughts, @pydata/xarray?

If we decide that we don't need to check for the repr for bigger arrays, this can be merged as soon as we stop loading the data into memory.

xarray/core/formatting.py Outdated Show resolved Hide resolved
xarray/tests/test_formatting.py Outdated Show resolved Hide resolved
xarray/tests/test_formatting.py Outdated Show resolved Hide resolved
@keewis
Copy link
Collaborator

keewis commented May 5, 2021

once we get the CI to pass, this should be ready for merging. Just note that I'm not entirely sure about the size of the test array.

@tomwhite
Copy link
Contributor Author

tomwhite commented May 5, 2021

This is now passing. We could add more tests or even change the representation a little in some cases, but it would be good to merge for the release (since it fixes a bug) if it looks OK to you @keewis.

@keewis
Copy link
Collaborator

keewis commented May 5, 2021

I agree, this looks ready. We classified this as a release blocker so it will definitely be part of the release. Before merging I'd like to have another maintainer look over this, though, to check my decisions.

@dcherian dcherian merged commit d63c26c into pydata:master May 6, 2021
dcherian added a commit to matzegoebel/xarray that referenced this pull request May 13, 2021
* upstream/master: (23 commits)
  combine keep_attrs and combine_attrs in apply_ufunc (pydata#5041)
  Explained what a deprecation cycle is (pydata#5289)
  Code cleanup (pydata#5234)
  FacetGrid docstrings (pydata#5293)
  Add whats new for dataset interpolation with non-numerics (pydata#5297)
  Allow dataset interpolation with different datatypes (pydata#5008)
  Flexible indexes: add Index base class and xindexes properties (pydata#5102)
  pre-commit: autoupdate hook versions (pydata#5280)
  convert the examples for apply_ufunc to doctest (pydata#5279)
  fix the new whatsnew section
  Ensure `HighLevelGraph` layers are `Layer` instances (pydata#5271)
  New whatsnew section
  Release-workflow: Bug fix (pydata#5273)
  more maintenance on whats-new.rst (pydata#5272)
  v0.18.0 release highlights (pydata#5266)
  Fix exception when display_expand_data=False for file-backed array. (pydata#5235)
  Warn ignored keep attrs (pydata#5265)
  Disable workflows on forks (pydata#5267)
  fix the built wheel test (pydata#5270)
  pypi upload workflow maintenance (pydata#5269)
  ...
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.

FR: Provide option for collapsing the HTML display in notebooks
4 participants