-
Notifications
You must be signed in to change notification settings - Fork 7
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
YAML utilization tool #149
Comments
A better approach (which is what Trilinos ParameterList offers) would be to have a "valid" parameter list, to compare against the input one. The comparison can then error out if some of the input keys are not in the valid PL, and, possibly, if some valid PL entries are not in the input PL. So something like this:
The 'validate' routine could also give the option of recurse or not into sublists, and to make sure all keys in the valid PL are set in the input PL (not by default though). |
Note: Trilinos' ParameterList also offers It also has some mechanism to check that the values associated to some keys satisfy user-defined checks, but I find that way too advanced, and not needed for ekat's purposes. |
I'm gonna transfer the issue in EKAT. |
Thanks for opening your first issue here! Be sure to follow the issue template! |
Would it be possible to generate a tool, most likely in EKAT, that could check if all valid entries in a YAML file are used, and then issue a warning to screen if any entries are ignored?
Maybe a general approach would be to store all entries in a yaml file as a map to a bool and trigger true the first time an entry is gotten with
param_list.get
?The use case I can think of is that currently the YAML parser will ignore anything that isn't requested, and in a lot of cases we use "if" statements to check if something is in the YAML file at all before taking some action. A typo in the yaml file is enough to cause the "if" statement to be false which can make a user believe something is happening when it isn't. A warning printed to screen would be enough to alert a user to the fact that they've made a mistake in the YAML file.
The text was updated successfully, but these errors were encountered: