limit lines in html repr of dataset attrs #7653
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Truncates the amount of lines output by
_html_repr_
forDataSet
/DataArray
objects.Motivation is that currently, if an attribute has a larger number of line breaks, it will pollute your Jupyter (etc) view.
For example, I like to append the measurement script source file to all my measurement results. When I then load the netcdf file, the attributes will contain a file with potentially hundreds of lines. I don't want all these lines to be shown in my output cells when viewing the html representation.
In the suggested edit,
max_lines
defines above which amount of lines the output should be truncated, whilemin_lines
defines how many should still be shown (like a preview). The current values of 15 and 10 are somewhat arbitrary.