Add __repr__ and _repr_html_ methods to DimensionInterval and NDIndex#12
Open
ianhi wants to merge 8 commits into
Open
Add __repr__ and _repr_html_ methods to DimensionInterval and NDIndex#12ianhi wants to merge 8 commits into
ianhi wants to merge 8 commits into
Conversation
Implement informative representations for both index classes: DimensionInterval repr shows: - Continuous dimension (name, size, value range) - Interval dimensions with their coords and labels - Interval properties (size, range, closed) - Indication for onset/duration-derived intervals NDIndex repr shows: - Slice method configuration - N-D coordinates (name, dims, shape, value range) Both classes also provide HTML representations for Jupyter notebooks with styled tables showing dimension and coordinate information. Includes comprehensive test coverage for all repr methods.
✅ Deploy Preview for xarray-linked-indexes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
for more information, see https://pre-commit.ci
Create docs/index_repr_demo.ipynb that demonstrates the __repr__ and _repr_html_ methods for DimensionInterval and NDIndex directly, outside of xarray's dataset representation context. The notebook covers: - DimensionInterval text and HTML repr - DimensionInterval with onset/duration format - NDIndex text and HTML repr - NDIndex with different slice methods - NDIndex with multiple coordinates - NDIndex with 3D coordinates - Repr updates after slicing operations
for more information, see https://pre-commit.ci
Updates to DimensionInterval and NDIndex _repr_html_: - Add dark/light mode CSS with prefers-color-scheme media query - Add JupyterLab theme detection via [data-jp-theme-light] attribute - Add expandable "Show interval details" section for DimensionInterval - Add expandable "Selection examples" section with copy-paste code - Add expandable "Value preview" section for NDIndex - Improve color scheme for better readability in both modes Update docs/index_repr_demo.ipynb: - Add interactive selection demos for both index types - Add DimensionInterval selection examples (time, word, part_of_speech) - Add NDIndex selection examples (scalar, slice, step) - Document dark mode support - Fix word label references to match example data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implement informative representations for both index classes:
DimensionInterval repr shows:
NDIndex repr shows:
Both classes also provide HTML representations for Jupyter notebooks
with styled tables showing dimension and coordinate information.
Includes comprehensive test coverage for all repr methods.