httk.serve.optimade.filter¶
Re-exports of the OPTIMADE filter-language parser.
The parser is implemented in httk.core.optimade, beside the
vendored OPTIMADE property definitions, and is
also exposed through this package.
Exceptions¶
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Functions¶
|
Parse an OPTIMADE filter into the public abstract syntax tree format. |
|
Parse an OPTIMADE filter and return its raw grammar parse tree. |
Package Contents¶
- exception httk.serve.optimade.filter.ParserError[source]¶
Bases:
ExceptionCommon base class for all non-exit exceptions.
- exception httk.serve.optimade.filter.ParserSyntaxError(*args)[source]¶
Bases:
ParserErrorCommon base class for all non-exit exceptions.
- info¶
- line¶
- pos¶
- linestr¶
- httk.serve.optimade.filter.parse_optimade_filter(filter_string, verbosity=0)[source]¶
Parse an OPTIMADE filter into the public abstract syntax tree format.
- Parameters:
- Returns:
Nested tuple abstract syntax tree in
ojfformat.- Raises:
ParserSyntaxError – If the filter cannot be parsed, or is too long or too deeply nested to parse within the interpreter’s recursion limit.
ParserError – If the filter cannot be parsed.
- Return type:
- httk.serve.optimade.filter.parse_optimade_filter_raw(filter_string, verbosity=0)[source]¶
Parse an OPTIMADE filter and return its raw grammar parse tree.
- Parameters:
- Returns:
Raw nested tuple parse tree before
ojfconversion.- Raises:
ParserSyntaxError – If the filter cannot be parsed, or is too long or too deeply nested to parse within the interpreter’s recursion limit.
ParserError – If the filter cannot be parsed.
- Return type:
tuple[Any, …]