Nektar++
|
Public Member Functions | |
def | __init__ (self, create_relaxng_validator=True) |
def | quit (self) |
def | validate (self, source, return_doc=False, assume_valid=False, **kw) |
Static Public Member Functions | |
def | setup_logging (show_errors=True, error_stream=sys.stderr, show_warnings=True, warning_stream=sys.stderr, space_errors=False, loglevel=logging.WARNING, **kwargs) |
def | cleanup_logging (handlers) |
Public Attributes | |
relaxng_validator | |
Definition at line 69 of file validator.py.
def CellMLToNektar.validator.CellMLValidator.__init__ | ( | self, | |
create_relaxng_validator = True |
|||
) |
Initialise a validator for CellML files.
Definition at line 70 of file validator.py.
|
static |
Flush logger & remove handlers.
Definition at line 136 of file validator.py.
def CellMLToNektar.validator.CellMLValidator.quit | ( | self | ) |
Since using __del__ is precarious, we provide this method to allow the RVP process to be killed cleanly. Call it when the validator is finished with, or you'll get an interesting error when the program terminates (if using RVP).
Definition at line 89 of file validator.py.
References CellMLToNektar.validator.CellMLValidator.quit(), and CellMLToNektar.validator.CellMLValidator.relaxng_validator.
Referenced by CellMLToNektar.validator.CellMLValidator.quit().
|
static |
Set up loggers for validation errors/warnings. Set show_errors or show_warnings to False to suppress the output of validation error or warning messages, respectively. When not suppressed, the messages will be output to the streams given by error_stream and warning_stream; these should be file-like objects. If space_errors is True, a blank line will be inserted between each message.
Definition at line 101 of file validator.py.
def CellMLToNektar.validator.CellMLValidator.validate | ( | self, | |
source, | |||
return_doc = False , |
|||
assume_valid = False , |
|||
** | kw | ||
) |
Validate the given document. source should be a file-like object, URI, local file name, or '-' for standard input. If a file-like object, it must support the seek method to reset it. If return_doc is True then the result is a tuple (valid, document), where if valid==True then document is an Amara binding of the CellML document. Otherwise just return True iff the document is valid. If xml_context is True, then the failing XML tree will be displayed with every units error. The assume_valid option allows you to skip RELAX NG validation, along with many of the checks in the Python code. This is useful for speeding transformation of models that are known to pass these checks. See cellml_model.validate and setup_logging for other keyword arguments.
Definition at line 143 of file validator.py.
References CellMLToNektar.pycml.amara_parse_cellml(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.validator.CellMLValidator.relaxng_validator, and CellMLToNektar.validator.CellMLValidator.validate().
Referenced by CellMLToNektar.validator.CellMLValidator.validate().
CellMLToNektar.validator.CellMLValidator.relaxng_validator |
Definition at line 73 of file validator.py.
Referenced by CellMLToNektar.validator.CellMLValidator.quit(), and CellMLToNektar.validator.CellMLValidator.validate().