Skip to content
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

Provide a way in configuration validation to specify containers of a set length #13180

Open
Dr15Jones opened this issue Feb 3, 2016 · 7 comments

Comments

@Dr15Jones
Copy link
Contributor

There are times where a container of parameters is required to be of a set length. We'd like to have the configuration validation system be able to enforce such a requirement. One suggestion was to possibly allow the use of std::array<> as a C++ parameter type.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 3, 2016

A new Issue was created by @Dr15Jones (Chris Jones).

@davidlange6, @smuzaffar, @Degano, @davidlt, @Dr15Jones can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

assign core

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 3, 2016

New categories assigned: core

@Dr15Jones,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks

@Dr15Jones
Copy link
Contributor Author

The problem with using std::array<> as a drop in replacement for std::vector<> is the type specified in the python configuration is a one to one mapping to a C++ type. If we were to allow one python type to be used by multiple C++ types the system couldn't properly enforce that the same C++ type was used every single time that parameter is requested.

This does bring up the possibility that we abandon the need for standard types to be specified in the python. When converting from the python values to C++ we just enforce that the types are convertible (e.g. python int into a C++ float). The parameter system of the other framework at FNAL (derived originally from CMSSW) usage such a system.

@smuzaffar
Copy link
Contributor

@Dr15Jones , @makortel was this implemented?

@makortel
Copy link
Contributor

In the configuration validation system no, but in the configuration reading phase yes, first in #22362 and then improved in #31429.

@fwyzard
Copy link
Contributor

fwyzard commented Sep 17, 2021

Thanks Matti, I had missed the second part... I've made #35316 to use the new functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants