Closed lawrence-mbf closed 5 years ago
also see discussion in #124
@nclack yes the JSON loader won't be able to read YAML. However, a YAML loader should be able to load both JSON and YAML. I.e., we could possible use yaml.load (instead of json.load) in HDMF to read the spec. However, in general we'd ideally write JSON (not YAML) specs to the file.
@oruebel
@ln-vidrio and I were just talking about this and came to the same conclusion. Writing the JSON is the next thing to try, imo. We have the object representation in Java, so we need to identify/validate the right JSON encoder to use.
At the current moment, MatNWB does not support writing schema files or cached specs.
The reason for not writing cached specs stems from the fact that cached specs are, by default, only written in JSON format. This is not possible with MatNWB's YAML parser.
However, should we work around this issue, the default YAML string produced by the YAML parser on export() produces a YAML with specific tags that end up breaking the default pynwb yaml importer, shown below: