Skip to content

chore: improve mktree method and update docs to help transition to RNTuple#1515

Merged
ianna merged 8 commits into
mainfrom
ariostas/mktree_improvements
Oct 28, 2025
Merged

chore: improve mktree method and update docs to help transition to RNTuple#1515
ianna merged 8 commits into
mainfrom
ariostas/mktree_improvements

Conversation

@ariostas
Copy link
Copy Markdown
Member

This PR improves the mktree method so that it accepts data instead of having to first us it with type data and then use extend to write the data. This makes it a much simpler replacement for the old syntax. I also updated the documentation and tests.

Closes #1504

@ariostas ariostas requested review from Copilot and ianna October 24, 2025 14:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mktree to 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.

Comment thread tests-wasm/test_1365_awkwardforth_reading.py
Comment thread tests-wasm/test_1272_basic_functionality.py
Comment thread src/uproot/writing/writable.py
Comment thread src/uproot/writing/writable.py
@ariostas ariostas added the next-release Required for the next release label Oct 24, 2025
Copy link
Copy Markdown
Member

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ariostas - Great! Thanks.

@ianna ianna merged commit e70a164 into main Oct 28, 2025
29 checks passed
@ianna ianna deleted the ariostas/mktree_improvements branch October 28, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-release Required for the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation how to use mktree without assigning to WritableDirectory is hard to find

3 participants