Skip to content

WIP: Update pctpairprotons to handle all return types of Uproot#74

Open
acoussat wants to merge 3 commits intoRTKConsortium:mainfrom
acoussat:pctpairprotons-uproot
Open

WIP: Update pctpairprotons to handle all return types of Uproot#74
acoussat wants to merge 3 commits intoRTKConsortium:mainfrom
acoussat:pctpairprotons-uproot

Conversation

@acoussat
Copy link
Copy Markdown
Collaborator

It seems that depending on Uproot's version, the arrays method sometimes returns a Python dict, and sometimes a numpy.ndarray. This PR generalizes the code to handle both cases.

As a first attempt to avoid future regressions, I have also added a small test that runs the pctpairprotons applications. I still need to check if it runs correctly on the CI.

I have also updated the documentation with a paragraph about the installation of Uproot, but I am wondering if Uproot shouldn't become a mandatory dependency of PCT as it is very unlikely that anyone will run PCT without using pctpairprotons.

Let me know if any part of the above should be in a separate PR.

This PR is still a WIP because it needs further testing (from Laura, but also from me).

@acoussat acoussat force-pushed the pctpairprotons-uproot branch from d1a43af to f319a8e Compare April 15, 2026 08:59
@acoussat acoussat changed the title WIP: Update pctpairprotons to support more uproot versions Update pctpairprotons to support more uproot versions Apr 15, 2026
@acoussat acoussat changed the title Update pctpairprotons to support more uproot versions Update pctpairprotons to handle all return types of Uproot Apr 15, 2026
@acoussat acoussat force-pushed the pctpairprotons-uproot branch from f319a8e to 7ee0939 Compare April 15, 2026 12:12
@acoussat acoussat force-pushed the pctpairprotons-uproot branch from 7ee0939 to ad01834 Compare April 15, 2026 14:50
@acoussat acoussat changed the title Update pctpairprotons to handle all return types of Uproot WIP: Update pctpairprotons to handle all return types of Uproot Apr 15, 2026
Comment on lines +8 to +11
return (
"/home/acoussat/Software/dev/PCT/PCT/output/PhaseSpaceIn.root",
"/home/acoussat/Software/dev/PCT/PCT/output/PhaseSpaceOut.root",
)
Copy link
Copy Markdown
Collaborator Author

@acoussat acoussat Apr 15, 2026

Choose a reason for hiding this comment

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

This is obviously temporary. Where should I get the data from? In RTK data are either generated from scratch, or downloaded from a remote location. In my case I have two ROOT files that need to serve as inputs to pctpairprotons.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd say downloaded from RTK's Girder collection, there is already a folder there.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The generation test should be in Gate.

Copy link
Copy Markdown
Collaborator Author

@acoussat acoussat Apr 15, 2026

Choose a reason for hiding this comment

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

Good point, but now this PR is getting mixed-up with #75. My proposal is to drop any pctpairprotons test from this PR (hence remove 28c3d94) and either move it to #75 or to another PR that will depend on #75. What do you think?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good.

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.

2 participants