fix: model member-name and AwkwardForth-API bugs in TTree v18, TTime, TAtt#1655
Open
henryiii wants to merge 3 commits into
Open
fix: model member-name and AwkwardForth-API bugs in TTree v18, TTime, TAtt#1655henryiii wants to merge 3 commits into
henryiii wants to merge 3 commits into
Conversation
… TAtt - TTree v18: rename `member_values` property to `member_names` so it matches every other version (v16/17/19/20) and is no longer silently shadowed by the empty base-class list. - TTime: port `read_members` Forth path from the removed old API (get_gen_obj/get_keys/add_to_header/…) to the current Node-based API, mirroring TDatime.py; previously any Forth-path read raised AttributeError. - TAtt: fix typo `fMarkserSize` -> `fMarkerSize` in Model_TAttMarker_v2.member_names. - TTable: remove dead module-level `format` dict that shadowed the builtin and was never used; fix docstring (was "TTree", should be "TTable"). - TMatrixT: fix docstring (was "TLeaf and its subclasses", should be "TMatrixT"). Assisted-by: ClaudeCode:claude-sonnet-4-6
Add tests/test_1647_model_fixes.py covering: - Model_TTree_v18.member_names returns a non-empty list (was misnamed member_values, silently falling back to the base-class empty list) - Model_TAttMarker_v2.member_names has fMarkerSize (not the typo fMarkserSize) - Model_TTime_v2.read_members Forth path uses the current Node-based API, not the removed old API methods - TTable module-level `format` attribute no longer shadows the builtin Assisted-by: ClaudeCode:claude-sonnet-4-6
Assisted-by: ClaudeCode:claude-fable-5
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (33.33%) is below the target coverage (98.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files
|
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.
🤖 AI text below 🤖
Part of #1646.
Summary
Five model-level bugs fixed:
TTree v18 (
src/uproot/models/TTree.py):Model_TTree_v18defined a property calledmember_values— a name that exists nowhere else and is never looked up. Every sibling version (v16, v17, v19, v20) definesmember_names. The result was thatmember_namessilently returned the base-class empty list[]for v18 trees. Renamed tomember_names.TTime (
src/uproot/models/TTime.py):Model_TTime_v2.read_membersused a long-removed ForthGenerator API (get_gen_obj(),get_keys(),add_to_header(),should_add_form(),add_form_key(),add_to_pre(),add_form(), oldadd_node(...)signature). None of these exist on the currentForthGenerator/NodeAPI in_awkwardforth.py. Any Forth-path read of a TTime-containing branch would raiseAttributeError. Ported to the currentNode-based API, mirroringTDatime.py(same structure: one big-endian fixed-width integer field, no versioning header).TAtt (
src/uproot/models/TAtt.py): Typo"fMarkserSize"inModel_TAttMarker_v2.member_names— corrected to"fMarkerSize"(consistent with the field name used inread_members,strided_interpretation,awkward_form, and_serialize).TTable (
src/uproot/models/TTable.py): Removed dead module-levelformat = {...}dict that (a) was never used anywhere — only the adjacent_dtypedict is used — and (b) shadowed the Python builtinformat. Also updated the module docstring, which incorrectly referred toTTreeinstead ofTTable.TMatrixT (
src/uproot/models/TMatrixT.py): Module docstring referred toTLeaf and its subclasses; corrected toTMatrixT.Test plan
uv run pytest tests/test_1647_model_fixes.py -v— 5 new regression tests, all passuv run pytest tests/test_0018_array_fetching_interface.py tests/test_0033_more_interpretations_2.py tests/test_0014_all_ttree_versions.py tests/test_0023_ttree_versions.py tests/test_0418_read_TTable.py tests/test_1610_read_TMatrixTSym_from_ttree.py tests/test_0011_generate_classes_from_streamers.py -q— all passprek -a --quiet— cleanSkipped / not applicable
skhep_testdata; the fix is verified via source inspection and API-level assertions.