Skip to content

[Python][RDF] Add support for std::vector and std::array in numba jitted functions #19487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2025

Conversation

siliataider
Copy link
Contributor

@siliataider siliataider commented Jul 31, 2025

This Pull request:

Changes or fixes:

This PR adds support for using std::vector<T> and std::array<T> as input and return types in functions declared with ROOT.Numba.Declare used in RDataFrame .Define operations.

This makes it possible to define and use functions like:

@ROOT.Numba.Declare(["std::array<int, 3>"], "std::vector<int>")
def square_vec(x):
    return x * x

rdf = ROOT.RDataFrame(3) \
        .Define("xvec", "std::array{(int)rdfentry_, (int)rdfentry_ + 1, (int)rdfentry_ + 2}") \
        .Define("xvec_square", "Numba::square_vec(xvec)")

The implementation reuses the logic for handling RVecs.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Copy link

github-actions bot commented Jul 31, 2025

Test Results

    21 files      21 suites   3d 12h 9m 3s ⏱️
 3 223 tests  3 220 ✅ 0 💤 3 ❌
65 956 runs  65 952 ✅ 1 💤 3 ❌

For more details on these failures, see this check.

Results for commit 662ee98.

♻️ This comment has been updated with latest results.

@siliataider siliataider changed the title [Python][RDF] Add support for std::vector in numba jitted functions [Python][RDF] Add support for std::vector and std::array in numba jitted functions Aug 1, 2025
@siliataider siliataider marked this pull request as ready for review August 1, 2025 10:04
Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

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

Thank you!

@vepadulano
Copy link
Member

Please squash commit history before merging 👍

@siliataider siliataider force-pushed the py-rdf branch 2 times, most recently from e932e0f to ae6f87f Compare August 4, 2025 08:31
@siliataider siliataider merged commit 0050514 into root-project:master Aug 4, 2025
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants