Skip to content
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

JSON tree #100

Open
rossant opened this issue Jul 22, 2015 · 3 comments
Open

JSON tree #100

rossant opened this issue Jul 22, 2015 · 3 comments

Comments

@rossant
Copy link

rossant commented Jul 22, 2015

Is it conceivable to use JSON instead of YAML in ASDF files? YAML being a "natural superset of JSON", what information would be lost by switching from YAML to JSON in a given ADSF file?

@mdboom
Copy link
Contributor

mdboom commented Jul 22, 2015

The tags, which drive the conversion of parts of the tree to specific datatypes (most importantly ndarrays), and schema validation (by matching a subtree to a particular schema. This feature, more than the syntax, was the major driving force for using YAML over JSON.

Less importantly, JSON has no comments.

There's some more detail in Section 4 of our recent paper: http://dx.doi.org/10.1016/j.ascom.2015.06.004

That said, one could develop a convention in JSON to losslessly store everything in a YAML file, but it would be cumbersome, e.g.:

--- !ndarray
    source: 0
    shape: [256, 256]
    datatype: float64
{
 '$tag': 'ndarray',
 '$data': {
    'source': 0,
    'shape': [256, 256],
    'datatype': 'float64'
  }
}

@mdboom
Copy link
Contributor

mdboom commented Jul 22, 2015

Also forgot to mention anchors and aliases. Though those could be replicated with the JSON Pointer convention, or just resolved away with duplication as long as the references aren't cyclical.

@embray
Copy link
Contributor

embray commented Jul 22, 2015

Yeah, I don't think a pure JSON tree is going to happen at this stage unless a clear performance benefit can be demonstrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants