You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As observed in #1112 (and likely elsewhere), some of the human-readable output generated by YAML emitters could be improved.
Steps to reproduce
The YAML output below can be produced using the new save method proposed for 1D objects (#1112), but the underlying implementation predates this PR (goes back to #984).
Behavior
There are three formatting issues documented thus far:
(1) Scalars / Rounding
As already pointed out in #984 (where serialization was initially introduced), there are some "floating point rounding issues [that] result in kind of ugly values". For example:
tolerances:
steady-abstol: 1.0e-09steady-reltol: 1.0e-04transient-abstol: 9.999999999999999e-12# <-- should be 1.0e-11transient-reltol: 1.0e-04
I have not looked into details, but at least for scalar values there may be a way to catch these items.
(2) Vectors / Efficient use of space
Number blocks don't use horizontal space efficiently; this may be addressed by changing:
which uses space more efficiently and also improves readability from a human perspective. Beyond, there is likely an optimized number of characters per line that prevents ragged output in most cases.
is possible, but the leading indent is problematic. I located a couple of YAML::Emitter settings in yaml-cpp, but nothing changes the output.
Breaking the line as indicated above may look nicer in some cases, but I don't think it's a big enough improvement (if at all) to warrant implementation.
Problem description
As observed in #1112 (and likely elsewhere), some of the human-readable output generated by YAML emitters could be improved.
Steps to reproduce
The YAML output below can be produced using the new
save
method proposed for 1D objects (#1112), but the underlying implementation predates this PR (goes back to #984).Behavior
There are three formatting issues documented thus far:
(1) Scalars / Rounding
As already pointed out in #984 (where serialization was initially introduced), there are some "floating point rounding issues [that] result in kind of ugly values". For example:
I have not looked into details, but at least for scalar values there may be a way to catch these items.
(2) Vectors / Efficient use of space
Number blocks don't use horizontal space efficiently; this may be addressed by changing:
to
which uses space more efficiently and also improves readability from a human perspective. Beyond, there is likely an optimized number of characters per line that prevents ragged output in most cases.
System information
Additional context
The text was updated successfully, but these errors were encountered: