chore: improve mktree method and update docs to help transition to RNTuple#1515
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the mktree method to accept data directly, eliminating the need for a two-step process (creating with types then extending with data). This simplifies the migration from the deprecated file["tree"] = data syntax to file.mktree("tree", data) as Uproot prepares to default to writing RNTuples.
Key changes:
- Enhanced
mktreeto accept either type specifications or actual data - Updated documentation to reflect the new recommended syntax
- Migrated all test files from deprecated assignment syntax to
mktree
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/uproot/writing/writable.py | Added logic to detect data vs types in mktree, extracted helper functions for type checking and data unpacking |
| src/uproot/writing/identify.py | Refactored to use new helper functions from writable.py, updated deprecation warning message |
| pyproject.toml | Removed filter for RNTuple deprecation warning (tests now use non-deprecated syntax) |
| docs-sphinx/basic.rst | Updated documentation examples to use mktree instead of assignment syntax |
| tests/*.py | Converted all test cases from file["tree"] = data to file.mktree("tree", data) |
| tests-wasm/*.py | Added comments explaining pytest_pyodide compatibility requirement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ianna
approved these changes
Oct 28, 2025
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 PR improves the
mktreemethod so that it accepts data instead of having to first us it with type data and then useextendto write the data. This makes it a much simpler replacement for the old syntax. I also updated the documentation and tests.Closes #1504