Repository navigation
Print heterogeneous data collections as a tree - #92
Merged
Merged
Conversation
A flat table only works for a well-defined collection: every level named, and named alike across branches. Otherwise the collection prints as a tree and each homogeneous branch collapses into its dimensions and size, with its levels and leaf count hooked below; indexing into it shows its table. Empty branches force the tree so they are never dropped from the output. Leaves are now counted as arrays and tables, and an empty collection prints as <xdas.DataCollection: empty>.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #92 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 49 49
Lines 9391 9427 +36
Branches 1694 1699 +5
=========================================
+ Hits 9391 9427 +36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The flat table repr breaks down as soon as a collection mixes structures, e.g. DAS (
node/cable/record) next to seismic stations (network/station/location/channel): unrelated keys end up in the same columns and the headers disappear.Now the flat table is only used when every level is named, and named the same way across branches. Otherwise the collection prints as a tree, and each well-defined branch collapses into a two-line summary. Index into it to see its table.
Also: empty branches are shown instead of silently dropped, and leaves are counted as arrays and tables rather than "leaves".