Trilinos: Teuchos: Abbreviated Maps in YAML Parser

Created on 27 Jun 2018  路  4Comments  路  Source: trilinos/Trilinos

Expectations


The following YAML input

try: {a: 1, b: 2, c: 3}

should be equivalent to

try:
  a: 1
  b: 2
  c: 3

This behavior is expected from some users for the same reason that

timesteps: [1, 2, 3, 4, 5]

is equivalent to

timesteps:
  - 1
  - 2
  - 3
  - 4
  - 5

Current Behavior


The code currently throws the following error when parsing try: {a: 1, b: 2, c: 3}:

unexpected YAML map value type v for key "try"

Motivation and Context


Readability for some input files can be improved by using this standard shortcut version of mappings. For example,
Fields: {rho: 0.125, px: 0., py: 0., pz: 0., rho_E: 0.25}
is easier for many people to read and write compared to the following

Fields:
  rho: 0.125
  px: 0.
  py: 0.
  pz: 0.
  rho_E: 0.25

This is especially helpful for long and complicated input files as it helps limit the total number of input lines.

Definition of Done


The short version of YAML maps should be parsed correctly or the documentation should explain why it isn't supported.

Possible Solution

Steps to Reproduce

Your Environment

Related Issues

Additional Information

Teuchos

All 4 comments

@trilinos/teuchos @ibaned

Thanks @danielsjensen1 for pointing this out! Also thanks to @mhoemmen for making sure it showed up in my inbox. This is an oversight on my part, and I've developed a fix in PR #3028.

@danielsjensen1 the fix is in the develop branch, please let me know if it works for you. Thanks!

Everything is being parsed properly now with your fix. Thanks for taking care of this so fast!

Was this page helpful?
0 / 5 - 0 ratings