zero.config.query module¶
Library query parser
-
exception
zero.config.query.
LibraryParserError
(message, line=None, pos=None, **kwargs)[source]¶ Bases:
ValueError
Library parser error
-
class
zero.config.query.
LibraryQueryEngine
[source]¶ Bases:
object
Query engine for op-amp library
-
property
opamp_set
¶
-
property
parameters
¶
-
query
(text, sort_order=None)[source]¶ Query the library.
- Parameters
text (
str
) – The query text.sort_order (
dict
, optional) – The sort order map. If specified, the items in this dictionary are used to determine the sort order for the returned results. The keys represent the parameter to filter, and the values represent the order (standard or reverse). The sorting is applied in the order that the parameter appears in the query text (left to right).
- Returns
list
– The matched op-amps.
-
property
-
class
zero.config.query.
LibraryQueryParser
[source]¶ Bases:
object
Op-amp library query parser.
This implements a lexer to identify search terms for the Zero op-amp library, and returns lambda functions that perform corresponding checks.
-
p_comparison_expression
(t)[source]¶ expression : PARAMETER comparison_operator ID | PARAMETER comparison_operator value_with_unit
-
p_comparison_operator
(t)[source]¶ comparison_operator : EQUAL | NOT_EQUAL | GREATER_THAN | GREATER_THAN_EQUAL | LESS_THAN | LESS_THAN_EQUAL
-
parameters
= {'a0': 'OPEN_LOOP_GAIN', 'gbw': 'GAIN_BANDWIDTH', 'icorner': 'INOISE_CORNER', 'imax': 'I_MAX', 'inoise': 'INOISE', 'model': 'MODEL', 'sr': 'SLEW_RATE', 'vcorner': 'VNOISE_CORNER', 'vmax': 'V_MAX', 'vnoise': 'VNOISE'}¶
-
t_AND
= '\\&'¶
-
t_EQUAL
= '=='¶
-
t_GREATER_THAN
= '>'¶
-
t_GREATER_THAN_EQUAL
= '>='¶
-
t_LESS_THAN
= '<'¶
-
t_LESS_THAN_EQUAL
= '<='¶
-
t_LPAREN
= '\\('¶
-
t_NOT_EQUAL
= '!='¶
-
t_OR
= '\\|'¶
-
t_RPAREN
= '\\)'¶
-
t_ignore
= ' \t'¶
-
tokens
= ['ID', 'PARAMETER', 'EQUAL', 'NOT_EQUAL', 'GREATER_THAN', 'GREATER_THAN_EQUAL', 'LESS_THAN', 'LESS_THAN_EQUAL', 'AND', 'OR', 'LPAREN', 'RPAREN']¶
-