Skip to content

Sort YAML output in a more semantically useful order #299

@agbuckley

Description

@agbuckley

At least when I've been running it recently, the YAML output seems to be sorting dict keys alphabetically, which is not very helpful when checking and iterating the output.

For example, additional_resources, by definition the non-core aspects, gets listed first in the submission.yaml blocks, ahead of e.g. name, description, location, data_file and keywords (one of many orders that would feel more intuitive to me; right now the name that defines the block comes last!).

Within individual tables' YAML files, dependent_variables comes first: it would be more natural at top-level to list the x-axis independent_variables first, then the y values, imho. Within the variables blocks, the header and qualifiers come first (before values) which seems good, but within each value the errors are listed before the actual (and more compact) value.

I've not checked the code doing the writing, but in Python 3.6+, dictionaries should iterate/persist in insertion order. So if the insertion code in the writer were to operate in more semantic orders and the key sorting were disabled, I hope the output would "automatically" become more user-friendly. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions