Repository navigation
fix: correct errors found while testing the interpretations - #1824
Merged
Merged
Conversation
This was referenced Nov 6, 2026
ariostas
marked this pull request as ready for review
November 6, 2026 14:47
Codecov Report❌ Patch coverage is
Additional details and impacted files
|
ariostas
force-pushed
the
fix/interpretation
branch
from
November 6, 2026 15:09
aee6d7c to
92957c6
Compare
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 6, 2026
The check that a sequence isn't equal to a string passed for anything but True. The test of Node.__str__ expected its wrong indentation, which scikit-hep#1824 fixes; it is now there, with the right one. The test of Library equality in test_0016 is deleted here, as test_names_and_equality covers it. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 6, 2026
The edges of the variable-width axis spanned exactly fXmin to fXmax, so the test couldn't tell the mean of the widths from (fXmax - fXmin) / fNbins. The files that Rewritable opens are now closed after each test. The test of a version 3 TStreamerElement leaves for scikit-hep#1824, which reads its range. Assisted-by: Claude Code:claude-opus-5-5
These were found by the tests of scikit-hep#1814, which are the regression tests here. The fixes are to containers (std::map, C arrays, AsDynamic and AsArray equality and hashing), strided and object arrays, the Awkward and Pandas libraries, string baskets, typename parsing, Float16/Double32 titles, TLeafG, TRef, TBasket.array, and model pickling. The reset_classes fixture now puts the original model classes back after the test, so that tests running after it in the same process (with pytest-xdist) compare against the classes they looked up. Assisted-by: Claude Code:claude-opus-5-5
Version 3 of TStreamerElement writes fXmin, fXmax and fFactor after its type name (later versions take the range from the title instead), and reading one stopped before them, so a file with version 3 elements failed to deserialize. The format for them was defined but unused. Assisted-by: Claude Code:claude-opus-5-5
Children after the first were indented two spaces less than the first. Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
ariostas
force-pushed
the
fix/interpretation
branch
from
November 10, 2026 16:25
5601fc1 to
f179574
Compare
Member
Author
|
pre-commit.ci run |
ianna
approved these changes
Nov 10, 2026
ianna
pushed a commit
that referenced
this pull request
Nov 12, 2026
* test: cover the interpretations New tests from #1814, apart from the regression tests of its fixes. Assisted-by: Claude Code:claude-opus-5-5 * test: tighten an equality check and drop the test of Node.__str__ The check that a sequence isn't equal to a string passed for anything but True. The test of Node.__str__ expected its wrong indentation, which #1824 fixes; it is now there, with the right one. The test of Library equality in test_0016 is deleted here, as test_names_and_equality covers it. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 12, 2026
The edges of the variable-width axis spanned exactly fXmin to fXmax, so the test couldn't tell the mean of the widths from (fXmax - fXmin) / fNbins. The files that Rewritable opens are now closed after each test. The test of a version 3 TStreamerElement leaves for scikit-hep#1824, which reads its range. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 12, 2026
The check that a sequence isn't equal to a string passed for anything but True. The test of Node.__str__ expected its wrong indentation, which scikit-hep#1824 fixes; it is now there, with the right one. The test of Library equality in test_0016 is deleted here, as test_names_and_equality covers it. Assisted-by: Claude Code:claude-opus-5-5
ianna
pushed a commit
that referenced
this pull request
Nov 12, 2026
* test: cover the interpretations New tests from #1814, apart from the regression tests of its fixes. Assisted-by: Claude Code:claude-opus-5-5 * test: tighten an equality check and drop the test of Node.__str__ The check that a sequence isn't equal to a string passed for anything but True. The test of Node.__str__ expected its wrong indentation, which #1824 fixes; it is now there, with the right one. The test of Library equality in test_0016 is deleted here, as test_names_and_equality covers it. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 12, 2026
The edges of the variable-width axis spanned exactly fXmin to fXmax, so the test couldn't tell the mean of the widths from (fXmax - fXmin) / fNbins. The files that Rewritable opens are now closed after each test. The test of a version 3 TStreamerElement leaves for scikit-hep#1824, which reads its range. Assisted-by: Claude Code:claude-opus-5-5
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 the split of #1814 (the list is in #1834). These bugs were found while writing the coverage tests of #1814, and
tests/test_1824_fix_interpretation.pyholds their regression tests: every test in it fails on main (for parametrized tests, at least one of their cases).std::maps read their string keys and values without a header, and an empty map has the same dtypes as the others.AsArray) whose header has no byte count raises aDeserializationErrorinstead of reading a wrong length. AwkwardForth finds the end of an array from its byte count rather than the end of the entry, and arrays of a NumPy dtype fall back from AwkwardForth.AsArrayandAsDynamicget__eq__and__hash__, andAsDynamic.typenameworks for any model.AsFIXMEerrors carry the chunk, cursor and file.strsubclasses print as strings.ObjectArraysupports negative indexes, slices (step 1) and iteration from an offset.StridedObjectArrayitems are recognized asnumpy.void.AsStringsreads big-endian lengths and accumulates offsets.StringArrays and Awkward arrays are concatenated.ListOffsetArray32/ListOffsetArrayU32, which Awkward 2 doesn't have.how="zip"with no arrays works.howdocs and error say what a stringhowactually does.UnboundLocalError.awkward_formraises aTypeErrorfor a dtype it can't represent.awkward_form_of_iterkeeps the fields of records and tuples, andrecursively_fix_awkward_form_of_iter(which coffea calls) no longer callsawkward_can_optimize, which doesn't exist._content_cls_from_namestrips suffixes from the right end.JaggedArray.parents_localindexuseduproot._util.win, which doesn't exist, so it always raisedAttributeError.TLeafGis registered.fXmin,fXmax,fFactor) that only that version writes; reading one used to fail.strof an AwkwardForth node indents all of its children alike.TRefkeeps its reference number in its members, like other models.TBasket.arraypassesfinal_arraya dict, as every interpretation expects.reset_classesalso reloadsTClonesArray.TruncatedNumericalandlanguage.pythonerror messages no longer fail while being formatted.CustomInterpretationandAsBinarycompare by identity.The
reset_classesfixture intests/conftest.pynow puts the original model classes back afterward. Some tests here need that, because they run in the same process (with pytest-xdist) as a test that reloads the classes. #1823 makes the same change.