-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEP006] Create a JSON schema in YAML to replace the old tardis_config_definition.yml #549
Conversation
Added a conversion to JSON Schema of |
|
||
# A container property expressed in JSON Schema | ||
# Property: convergence_strategy, transcoded from tardis_config_definition.yml | ||
type: object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does type: object
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object
is basically how javascript/json names dictionaries. For reference, the JSON → Python type analogs are as follows:
JSON type | Python type |
---|---|
integer | int |
number | float |
string | unicode |
array | list |
object | dict |
boolean | bool |
Added the complete JSON schema for the configuration, as transcoded from
|
I've now split the schema to multiple files, one for each top-level section, with With some customizations to I'll present a full-fledged validator for this structure in another PR. Also, I moved the schemas to @wkerzendorf Thoughts? |
73efec0
to
88c2f6f
Compare
Express (in JSON Schema) the constraints of the property black_body_sampling as found in tardis_config_definition.yml.
…sible to specify the abundances.
Why is this PR abandoned in favor of #576 ? |
@yeganer - because I asked. |
This is a conversion of the configuration definition for the
convergence_strategy
property to JSON Schema to demonstrate the ability of JSON Schema to cover our needs without changing our configuration file syntax.The convergence_strategy property was chosen intentionally as a starting point because:
container-property
which I consider to be the most complicated of TARDIS' types to express in JSON Schema, andQuantity
sub-properties and therefore it's easier to demonstrate its validation, even with an online tool such ashttp://jsonschemalint.com/draft4/
(accepts YAML).For example, you could try the input below taken from
http://tardis.readthedocs.org/en/latest/examples/profilemodel.html
in the aforementioned site against the schema in this commit.Of course, try to change any value to something invalid, or remove a required sub-property.