Skip to content

[Python] Add missing numpy int8/uint8 support in AsRVec#21374

Merged
siliataider merged 2 commits intoroot-project:masterfrom
siliataider:numpy_conv
Feb 25, 2026
Merged

[Python] Add missing numpy int8/uint8 support in AsRVec#21374
siliataider merged 2 commits intoroot-project:masterfrom
siliataider:numpy_conv

Conversation

@siliataider
Copy link
Contributor

@siliataider siliataider commented Feb 25, 2026

This Pull request:

Changes or fixes:

This PR adds the missing numpy.int8 (i1) and numpy.uint8 (u1) pythonizations in AsRVec, an issue (partially) reported and described in this ROOT forum post:
https://root-forum.cern.ch/t/missing-numpy-uint8-pythonisation-in-setbranchaddress-in-root-6-38

Now:

  • u1 maps to unsigned char and adopts memory like all other numeric types.
  • i1 maps to signed char but must be copied rather than adopted because the the ptr+size constructor for RVec<signed char> is not exposed.

Checklist:

  • tested changes locally

This PR fixes # https://root-forum.cern.ch/t/wrong-conversion-of-bool-array-to-numpy-array/64714?u=siliataider

Fixes #21379

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! LGTM once tests are green.

@github-actions
Copy link

Test Results

    22 files      22 suites   3d 4h 36m 55s ⏱️
 3 796 tests  3 791 ✅ 0 💤 5 ❌
75 468 runs  75 463 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit dfd05d8.

@siliataider siliataider merged commit b0e39fc into root-project:master Feb 25, 2026
27 of 30 checks passed
@dpiparo
Copy link
Member

dpiparo commented Feb 25, 2026

/backport to 6.38

@root-project-bot
Copy link

Something went wrong with the backport to 6.38: @dpiparo please see the logs

@dpiparo
Copy link
Member

dpiparo commented Feb 25, 2026

Let me re-iterate, please

/backport to 6.38

@root-project-bot
Copy link

This PR has been backported to branch 6.38: #21381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing numpy.uint8 pythonisation in SetBranchAddress in ROOT 6.38

4 participants