Repository navigation
fix: correct errors found while testing writing - #1827
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 ❌ Your patch check has failed because the patch coverage (93.07%) is below the target coverage (98.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files
|
These were found by the tests of scikit-hep#1814, which are the regression tests here. The fixes are to keys that move or grow past 2 GB, streamers added after others, TTree type specifications and categorical strings, TArray classes from dtypes, histogram conversion, directory listings of names without cycles, copying directories, and extending TTrees with branches that Uproot can't interpret, which includes custom interpretations without a dtype: the methods of the Interpretation base class raise NotImplementedError, naming the subclass, instead of a bare AssertionError. Assisted-by: Claude Code:claude-opus-5-5
update_streamers rejected an object that isn't a streamer in the middle of its loop, after the streamers before it had been recorded but before space was made for them. A retry then skipped those streamers as already known, and the file's list of streamers couldn't be read back. Assisted-by: Claude Code:claude-opus-5-5
WritableDirectory.values() returned every cycle of each name, while keys(), items() and classnames() without cycles, and the values() of a ReadOnlyDirectory, return each name once, as its highest cycle. Assisted-by: Claude Code:claude-opus-5-5
mktree (and the cascade under it) silently left out a branch whose name was
already taken, including fields of records whose flattened names collided
with another branch: {"r_x": ..., "r": {"x": ..., "y": ...}} made a
TTree with only r_x and r_y, which could never be extended. Now a name
defined twice raises a ValueError. A scalar integer branch may still name
the counter of a jagged branch defined before it.
Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 6, 2026
…files Four tests skipped without ROOT before checking anything with uproot; now only their ROOT checks need it. The test of updating a file object closes both files. The test that the first of two branches with the same name was kept leaves for scikit-hep#1827, which rejects such names instead. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 12, 2026
…files Four tests skipped without ROOT before checking anything with uproot; now only their ROOT checks need it. The test of updating a file object closes both files. The test that the first of two branches with the same name was kept leaves for scikit-hep#1827, which rejects such names instead. Assisted-by: Claude Code:claude-opus-5-5
ariostas
added a commit
to ariostas/uproot5
that referenced
this pull request
Nov 12, 2026
…files Four tests skipped without ROOT before checking anything with uproot; now only their ROOT checks need it. The test of updating a file object closes both files. The test that the first of two branches with the same name was kept leaves for scikit-hep#1827, which rejects such names instead. 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_1827_fix_writing.pyholds their regression tests: every test in it fails on main (for parametrized tests, at least one of their cases).ReadOnlyDirectoryandWritableDirectory(keys,items,classnames), andWritableDirectory.values()lists each name once, as its highest cycle, likeReadOnlyDirectory.values(). The writable directory also stops listing a name twice and filters subdirectories on their full paths.TypeError.FileSink.telldoesn't reopen a file that is open.ValueError. Before, the second one was silently left out, and when it was a field of a record whose flattened name collided with another branch ({"r_x": ..., "r": {"x": ..., "y": ...}}), the TTree could never be extended. A scalar integer branch can still name the counter of a jagged branch before it.SyntaxErrorare understood.IndexedArray) can be written.TypeErrorthat names the branch.extendandadd_branchesrefuse trees with branches they can't interpret, instead of leaving those branches behind. These include custom interpretations without a dtype, soInterpretation's base methods now raiseNotImplementedErrornaming the subclass, instead of a bareAssertionError.to_TArraypicks the class from the dtype's kind and size, solong/long long/intcarrays work on every platform. On Windows with NumPy 1, int32 data was rejected.values()doesn't takeflowcan be written: their fallback still calledvalues(flow=False).TypeError.as_TGrapherror aboutmaxYnamesmaxY.copy_fromdoesn't try to make a directory named""for the root of the copy.