tsutterley / pyTMD

Python-based tidal prediction software
https://pytmd.readthedocs.io
MIT License
128 stars 39 forks source link

Converting from definition files to JSON #310

Closed tsutterley closed 2 months ago

tsutterley commented 2 months ago

Currently the definition files for loading a (non-default) model use a simple tab-delimited format. To be more machine readable, we could switch to a JSON format.

from this :point_down:

format      OTIS
name        CATS2008
model_file  CATS2008/hf.CATS2008.out
grid_file   CATS2008/grid_CATS2008
projection  CATS2008
type        z
variable    tide_ocean
reference   https://doi.org/10.15784/601235

to this :point_down:

{
    "format": "OTIS",
    "name": "CATS2008",
    "model_file": "CATS2008/hf.CATS2008.out",
    "grid_file": "CATS2008/grid_CATS2008",
    "projection": "CATS2008",
    "type": "z",
    "variable": "tide_ocean",
    "reference": "https://doi.org/10.15784/601235"
}

Boolean values, lists and dictionaries could be serialized directly. Should require less maintenance.