Closed jonrkarr closed 2 years ago
Can you describe a use case please where one would need programmatic access to error messages? At the moment, they're meant to be printed on the console only. Users are not expected to parse these in their scripts.
For example, to provide validation of NeuroML models in a UI, such as a website.
A single string output would be a significant improvement
Alternatively, if a different library does this (e.g., libNeuroML), we'd be happy to use that.
libNeuroML will check the file against the schema, so it'll be able to say if it has a valid structure. pyneuroml, through jneuroml, also runs tests in addition to this one validation.
We can't return a single string, because then that's not appropriate for console output. We currently use logging when jnml is called:
This returns True or False to indicate whether the jnml command completed correctly.
We'll have to think of how to refactor this to also allow programmatic access to code. On our backlog now.
Should we use pyNeuroML or libNeuroML?
jneuroml via pyneuroml is the suggested validation tool.
https://docs.neuroml.org/Userdocs/ValidatingNeuroMLModels.html
@jonrkarr : could you please take a quick look to see if #127 works for your use case?
Its hard to retrieve those messages programmatically since they are printed to the console.
Describe the solution you'd like Expose programmatic access to the messages, ideally a list of errors and warnings
Describe alternatives you've considered Programmatically collecting console output, such as using capturer or subprocess.