[df] Lift requirement to provide explicit return type in Vary expression#22028
Open
vepadulano wants to merge 1 commit intoroot-project:masterfrom
Open
[df] Lift requirement to provide explicit return type in Vary expression#22028vepadulano wants to merge 1 commit intoroot-project:masterfrom
vepadulano wants to merge 1 commit intoroot-project:masterfrom
Conversation
4f9a9f4 to
6034471
Compare
Test Results 22 files 22 suites 3d 10h 48m 33s ⏱️ For more details on these failures, see this check. Results for commit 2d2f03a. ♻️ This comment has been updated with latest results. |
dpiparo
approved these changes
Apr 24, 2026
6034471 to
17eb96f
Compare
hageboeck
reviewed
Apr 24, 2026
The expression gets a trailing return type injected of the equivalent necessary RVec type, only in case the user is not already providing it. As long as the expression returns a sequence of characters that is a valid way to instantiate an RVec constructor, the expression will compile.
The condition that triggers the injection of the trailing return type is if the user expression is of type '{...}', which could be a potential candidate constructor for an RVec.
17eb96f to
2d2f03a
Compare
hageboeck
approved these changes
Apr 24, 2026
Member
There was a problem hiding this comment.
This is really great to have!
Let's also add a bit of docs, because otherwise it might go unnoticed. Something to the effect of:
/**
df.Vary(
std::vector<std::string>{"x", "y", "z"},
"{
{-1*entry, 2, 3}, // x variations
{41, 43*entry, 44}, // y variations
{500-entry, 600, 700 + entry} // z variations
}",
{"down", "up", "other"},
"xyz")
*/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on the presentation about systematic variations for the ATLAS columnar hackathon https://indico.cern.ch/event/1661946/, I had an idea on how to simplify the user experience of using Vary with JIT-ted expressions.
The expression gets a trailing return type injected of the equivalent necessary RVec type, only in case the user is not already providing it. As long as the expression returns a sequence of characters that is a valid way to instantiate an RVec constructor, the expression will compile.
The condition that triggers the injection of the trailing return type is if the user expression is of type '{...}', which could be a potential candidate constructor for an RVec.