goodmami / penman

PENMAN notation (e.g. AMR) in Python
https://penman.readthedocs.io/
MIT License
139 stars 27 forks source link

Replace Model.check() with Model.errors() #65

Closed goodmami closed 4 years ago

goodmami commented 4 years ago

The individual errors logged by Model.check() are not really inspectable except by a human reading stderr. Instead, the function could be replaced with something like Model.errors() which returns a data structure containing those error messages.

The data structure could be serialized as metadata when --check is used, thus removing the need to deal with synchronously flushing stdout and stderr (see #60).

The function's name change is so something like if model.errors(): ... executes the body of the if statement if there ARE errors, whereas with if model.check(): ... the intuition is that the body executes if there are no errors.