Skip to content

Allow a generic number of EKOs to be passed to pineappl evolve#331

Merged
cschwan merged 8 commits into
masterfrom
many-ekos
Mar 9, 2025
Merged

Allow a generic number of EKOs to be passed to pineappl evolve#331
cschwan merged 8 commits into
masterfrom
many-ekos

Conversation

@Radonirinaunimi
Copy link
Copy Markdown
Member

@Radonirinaunimi Radonirinaunimi commented Feb 25, 2025

This addresses #330.

Things to do:

  • rename EkoNames to EkoPaths
  • find a robust and stable way to parse multiple EKOs
  • rely on information inside the EKOs to derive the types of convolutions
  • add minor tutorial on the use of p,f,pf,fpmarkings in multi-convolution

@Radonirinaunimi Radonirinaunimi linked an issue Feb 25, 2025 that may be closed by this pull request
@cschwan
Copy link
Copy Markdown
Contributor

cschwan commented Feb 25, 2025

I'd make this a bit simpler by relying more on clap: replace EkoPaths with Vec<EkoPath> and make EkoPath a struct of a String and a ConvType. Furthermore, use #[arg(value_delimiter = ',', num_args = 1)]. Then clap does most of the parsing.

@Radonirinaunimi
Copy link
Copy Markdown
Member Author

I'd make this a bit simpler by relying more on clap: replace EkoPaths with Vec<EkoPath> and make EkoPath a struct of a String and a ConvType. Furthermore, use #[arg(value_delimiter = ',', num_args = 1)]. Then clap does most of the parsing.

So you want to remove EKOs as a positional argument? Because I don't think it would work otherwise.

@cschwan
Copy link
Copy Markdown
Contributor

cschwan commented Feb 28, 2025

No, it should remain a positional parameter. It's exactly one argument, but internally clap fills the Vec by splitting the argument by ,.

@cschwan
Copy link
Copy Markdown
Contributor

cschwan commented Feb 28, 2025

On second thought, the information in the +p, +f and +pf syntax should be encoded in EKO's yaml files. We should rely on them instead of the information provided by the user.

@Radonirinaunimi
Copy link
Copy Markdown
Member Author

No, it should remain a positional parameter. It's exactly one argument, but internally clap fills the Vec by splitting the argument by ,.

But this, I think, doesn't work. #[arg(value_delimiter = ',')] is functionally equivalent to .num_args(1..) so it can only be the last positional argument and no positional arguments can come after.

The alternative would be to use named optional argument #[arg(short, long, value_delimiter = ',')], but I am not sure we also want this.

On second thought, the information in the +p, +f and +pf syntax should be encoded in EKO's yaml files. We should rely on them instead of the information provided by the user.

Yes, I will double check this to be certain, but if that's the case then that should definitely be the way to do it (added in the TODO of the description).

@felixhekhorn
Copy link
Copy Markdown
Contributor

On second thought, the information in the +p, +f and +pf syntax should be encoded in EKO's yaml files. We should rely on them instead of the information provided by the user.

they are of course

just to say: if only we had someone work on NNPDF/eko#97

Comment thread docs/cli-tutorial.md Outdated
Co-authored-by: Felix Hekhorn <felixhekhorn@users.noreply.github.com>
@Radonirinaunimi
Copy link
Copy Markdown
Member Author

With respect to how the EKOs are parsed, our only option is to pass everything a one big STRING. As mentioned above having something like Vec<String> is not working.

Also, in the end, I didn't add a documentation on how to use pineappl evolve as this might not be used by many people. As currently present in the documentation, that'd be referred in the extra-subcommands.

And with these, this PR is ready.

@cschwan
Copy link
Copy Markdown
Contributor

cschwan commented Mar 9, 2025

But this, I think, doesn't work. #[arg(value_delimiter = ',')] is functionally equivalent to .num_args(1..) so it can only be the last positional argument and no positional arguments can come after.

Yes, I didn't realize this sooner, had to see it for myself. Thank for trying it out!

@cschwan cschwan merged commit 15e4f4a into master Mar 9, 2025
@cschwan cschwan deleted the many-ekos branch March 9, 2025 10:59
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.

Allow CLI evolve to take a generic number of EKOs

3 participants