Skip to content

Validate case dictionaries #424

Closed
@henryleberre

Description

@henryleberre

Currently, we have a file in the toolchain named toolchain/mfc/run/case_dicts.py that lists all the keys a case dictionary can have for each target. This is done by programmatically generating the lists on the fly. We need to do this because each target has its own set of inputs (keys) it accepts. If you specify one that it does not know about, it will fail to load the input data.

However, we do not check data-types. This can cause trouble when Fortran tries to read values from the .inp files we generate. Depending on the compiler, the error message can be very misleading, sometimes pointing to innocent lines in the .inp files.

To mitigate this issue, we could define a schema in Python for these case dictionaries and use them to validate the JSON we get from cases. There are a few libraries that do this. One of them is jsonschema. It might not be the most appropriate.

There might be a better way of doing this (that does not require too much work) I cannot think of (perhaps with a larger-scoped change).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions