Repository navigation
fix: get_event_tree reject legal unique tree in sub-dir - #26
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical indexing bug can associate trees with the wrong paths and event data when entries are filtered or missing, causing incorrect results until the index-to-tree relationship is preserved.
1 open issue
What changed in this PR
Refactors JUNO event-tree discovery and assembly to tolerate missing or unsupported sub-event trees while excluding unsupported event data.
Changes:
- Makes
get_event_treereturnNonewhen no suitable event tree is found. - Skips header trees and trees containing
JM::SmartRefevent branches. - Excludes
/Event/Genand collects valid trees before assembling event arrays.
| File | Description |
|---|---|
| pyjuno/junoio.py | Updates event-tree selection and assembly to filter unsupported or missing trees before processing event data. |
Review effort: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

This pull request refactors the logic for selecting valid event trees in the
assemble_eventfunction and improves the robustness of theget_event_treefunction. The main changes simplify tree selection, avoid unsupported event types, and make the code more maintainable.Event tree selection and filtering improvements:
get_event_treeto returnNoneinstead of raising an error when the expected number of trees is not found, and to skip trees whose names end with"Header"or whose"m_event"field has a streamer type of"JM::SmartRef".assemble_eventto:/Event/Genpath, which is not supported.get_event_treelogic, and process only those trees, improving overall robustness and clarity.