Skip to content

[ntuple] Add RNTupleProcessor::RequestField by typename string#22403

Open
enirolf wants to merge 1 commit into
root-project:masterfrom
enirolf:ntuple-proc-request-field-typename
Open

[ntuple] Add RNTupleProcessor::RequestField by typename string#22403
enirolf wants to merge 1 commit into
root-project:masterfrom
enirolf:ntuple-proc-request-field-typename

Conversation

@enirolf
Copy link
Copy Markdown
Contributor

@enirolf enirolf commented May 26, 2026

Adds a non-templated overload of RNTupleProcessor::RequestField that takes a typename string, in case the type is not known at compile time.

@enirolf enirolf self-assigned this May 26, 2026
@enirolf enirolf requested a review from jblomer as a code owner May 26, 2026 07:56
auto x = proc->RequestField("x", "float");

auto yPtr = std::make_shared<std::vector<float>>();
auto y = proc->RequestField("y", "std::vector<float>", yPtr.get());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To also test that the normalization steps are properly used consider using (in addition?) a non-normalized spelling (one of std::vector<float >, std::vector<Float_t>, etc.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@github-actions
Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 13h 43m 15s ⏱️
 3 862 tests  3 861 ✅ 0 💤 1 ❌
77 105 runs  77 104 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 997ccde.

@enirolf enirolf force-pushed the ntuple-proc-request-field-typename branch from 997ccde to 4e16836 Compare May 26, 2026 11:06
@enirolf enirolf requested a review from pcanal May 26, 2026 11:07
@enirolf enirolf force-pushed the ntuple-proc-request-field-typename branch from 4e16836 to bdcb912 Compare May 26, 2026 11:17
}
{
auto proc = RNTupleProcessor::Create({fNTupleNames[0], fFileNames[0]});
EXPECT_THROW(proc->RequestField("y", "std::vetor<float>"), ROOT::RException);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Last one :) ... We should also test the error ("type_that_does_not_exist")

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.

3 participants