I use YAML for a computer and a human-editable and readable input format for the simulator. For readability, some parts of the input are mostly suitable for a lock style, while a stream style is better for others.
By default, PyYAML uses a block style where there are nested maps or sequences, and a stream style throughout the world. * default_flow_style * allows you to select the all-stream or all-block-style style.
But I would like to output files from the form more
bonds: - { strength: 2.0 } - ... tiles: - { color: red, edges: [1, 0, 0, 1], stoic: 0.1} - ... args: block: 2 Gse: 9.4
As you can see, this does not correspond to a consistent template for styles, but instead changes depending on the part of the file. Essentially, I would like to be able to indicate that all values ββin some block style sequences will be in stream style. Is there any way to get such fine control over dumping? The ability to reset the top-level display in a specific order, without requiring that this order (e.g. omap) be enjoyable for readability.
source share