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

Teuchos Yaml Parser with duplicate names #2306

Closed
bathmatt opened this issue Feb 27, 2018 · 5 comments
Closed

Teuchos Yaml Parser with duplicate names #2306

bathmatt opened this issue Feb 27, 2018 · 5 comments
Assignees
Labels
pkg: Teuchos Issues primarily dealing with the Teuchos Package stage: in progress Work on the issue has started type: enhancement Issue is an enhancement, not a bug

Comments

@bathmatt
Copy link
Contributor

Should this be allowed or should it throw an error

Foo:
  Bar: 
    Val:1
  Bar:
    Val:2

When I ask for Bar in the PL I get one entry, Val=2

Shouldn't this throw an error?
@ibaned

@bathmatt bathmatt added the pkg: Teuchos Issues primarily dealing with the Teuchos Package label Feb 27, 2018
@ibaned ibaned added the type: enhancement Issue is an enhancement, not a bug label Feb 27, 2018
@ibaned ibaned self-assigned this Feb 27, 2018
@ibaned
Copy link
Contributor

ibaned commented Feb 27, 2018

Yea, I guess this is a lack of error checking. I'm probably calling an API in ParameterList that overwrites previous values. Its not technically a bug, but the code would be more user-friendly if it threw an error.

@bathmatt
Copy link
Contributor Author

Can we add a feature req for this :).
Thanks! I know yaml-cpp puked..

@bathmatt
Copy link
Contributor Author

Oh, and thanks for the new yaml cpp parser that now keeps order of entries. The old one did not! That allows us to have order dependent parsing

ibaned added a commit to ibaned/Trilinos that referenced this issue Feb 27, 2018
@ibaned ibaned added the stage: in progress Work on the issue has started label Feb 27, 2018
@ibaned
Copy link
Contributor

ibaned commented Feb 28, 2018

@bathmatt this should be fixed now in the Trilinos develop branch, please let me know if you can confirm the fix.

@bathmatt
Copy link
Contributor Author

Thanks!!

*********** Caught Exception: Begin Error Report ***********
Error Type: Generic exception type thrown
error: Parser failure at line 44 column 4 of foo.yaml
  Output:
  ^

/home/mbetten/Trilinos/Trilinos/packages/teuchos/parameterlist/src/Teuchos_YamlParser.cpp:178:

Throw number = 1

Throw test that evaluated to true: list.isParameter(name_in)

Parameter "Time Stepping" already exists in list "ANONYMOUS"


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: Teuchos Issues primarily dealing with the Teuchos Package stage: in progress Work on the issue has started type: enhancement Issue is an enhancement, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants