NeurodataWithoutBorders / pynwb

A Python API for working with Neurodata stored in the NWB Format
https://pynwb.readthedocs.io
Other
177 stars 84 forks source link

validator should be able to output machine readable results #1179

Open t-b opened 4 years ago

t-b commented 4 years ago

Could be JSON using --json in a format like

{
    "exitcode" : 0,
    "issues" : [ { "description": "", "location":"", "severity": 10}, ]
}
bendichter commented 4 years ago

Thanks @t-b , this sounds like a useful feature!

anhknguyen96 commented 2 years ago

Hi, I would appreciate it if this feature is added. @pgleeson and I are working on a GSoC project and one of the goals is to test NWB files' compatibility with NWBExplorer, thus having the validator's logs will be useful for debugging purposes.

bendichter commented 2 years ago

Check out NWB inspector. It calls validation and has this json output feature

anhknguyen96 commented 2 years ago

NWB inspector calls validation via this method?

The NWB inspector documentation/README file says "This inspector is meant as a companion to the pynwb validator, which checks for strict schema compliance. In contrast, this tool attempts to apply some common sense to find components of the file that are technically compliant, but probably incorrect, or suboptimal, or deviate from best practices". If I understand correctly, users are recommended to use both pynwb validator and NWB inspector, as they serve different purposes?

bendichter commented 2 years ago

nwb inspector has its own check and calls the validator and returns any errors, so you don't need to call both.

anhknguyen96 commented 2 years ago

great, thanks!