New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simpler syntax for fillDescriptions items with limited choices #30932
Comments
assign core |
New categories assigned: core @Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks |
A new Issue was created by @kpedro88 Kevin Pedro. @Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
Here is an earlier discussion on the topic https://hypernews.cern.ch/HyperNews/CMS/get/progQuestions/331.html |
How about desc.ifValue(edm::ParameterDescription<std::string>("mode", "PseudoAsync", true),
edm::allowedValues("Sync", "Async", "PseudoAsync")); ? In a quick test I was able to make that work. All it needed was the new templated function |
That looks good to me. |
@Dr15Jones How necessary the I'm just wondering if we should think about a more general mechanism to specify constraints on allowed values. |
See #30950 |
+1 Done in #30950 |
This issue is fully signed and ready to be closed. |
I recently learned (in review of #30850) that fillDescriptions can restrict the allowed choices for a configuration parameter using
ifValue()
. However, the syntax for this is currently a bit clunky:This syntax is intended to allow for switching between more complex parameter groups. However, in the case of a simple choice (such as above), it would be nice to have a simpler syntax. For example, the allowed choices could just be provided as a vector.
The text was updated successfully, but these errors were encountered: