ExtremeFLOW / neko

/ᐠ. 。.ᐟ\ᵐᵉᵒʷˎˊ˗
https://neko.cfd/
Other
159 stars 27 forks source link

JSON Schema for case files #1203

Open timfelle opened 3 months ago

timfelle commented 3 months ago

Utilize the JSON Schema system to define our case file structure. This should allow us to supply a specification of our json files with descriptions of each entry and specify required entries in a standardized way that others could utilize.

See more: https://json-schema.org/learn/getting-started-step-by-step

timofeymukha commented 3 months ago

Excellent suggestion! I was not aware of this, but it seems like another free bonus coming with a widely-used format. We could connect this to the versioning of the case file. We have a "version" keyword in the file, but unfortunately we never really updated this properly, and it is still just version 1. We need to think about how to do this in a structured manner.

As a sidenote, json_fortran, does support the extension of json with comments. So, we could actually augment the examples with commentary!

timofeymukha commented 3 months ago

It is unfortunate that there seems to be no validator in Fortran. Perhaps not surprising, but still. If one messes up the json bad right now (miss a brace or something), the case crashes with an error saying that "case.mesh" does not exist in the json, which is incorrect.

timfelle commented 3 months ago

Yea, well the lack of validator is something that should be okay. Sure, we cannot integrate it directly into neko itself right now. But we could probably supply a small tool that could be run based on python or something since there are some in plenty of other languages. Maybe we could even run it from makeneko, to ensure all case files located with the executable are valid.

In any case, we are able to make the specifcation publicly available which should help with all the data management folks. And it would also make versioning as you mention something we actually maintain instead of it being kinda arbitrary as it is now.

timofeymukha commented 3 months ago

Indeed