The source expression language on the Python side: its functions and variables, validation, constant substitution, region lowering and NumPy evaluation. More...
Go to the source code of this file.
Data Structures | |
| class | picurv_cli.source_expressions._LogicalRewriter |
| Rewrite logical operators and chained comparisons into array operations. More... | |
Namespaces | |
| namespace | picurv_cli |
| namespace | picurv_cli.source_expressions |
Functions | |
| None | picurv_cli.source_expressions.validate_expression (str expression, names=EULERIAN_EXPRESSION_NAMES, random=False) |
| Reject anything outside the expression language the runtime also evaluates. | |
| int | picurv_cli.source_expressions._series_bound (node) |
| The integer a series bound denotes: an integer literal, possibly negated. | |
| None | picurv_cli.source_expressions._check_expression_node (node, names, indices, random) |
| Check one node of a parsed expression, with the series indices enclosing it in scope. | |
| None | picurv_cli.source_expressions._validate_expression (str expression) |
| Reject Eulerian expression syntax outside the supported language. | |
| picurv_cli.source_expressions._solver_only (str name) | |
| A stand-in for a function only the runtime evaluates. | |
| picurv_cli.source_expressions.evaluate_values (str expression, dict values) | |
| Evaluate an already validated expression over named arrays or scalars. | |
| str | picurv_cli.source_expressions._number_text (value, dict params, str where) |
| Render one numeric region parameter, which may name a declared parameter. | |
| str | picurv_cli.source_expressions._region_distance (dict region, dict params, str where) |
| Signed distance to a region's boundary, negative inside, as expression text. | |
| str | picurv_cli.source_expressions._substitute_params (str expression, dict params) |
| Replace declared parameter names in an expression by their values. | |
| picurv_cli.source_expressions._validate_at (str expression, names, bool random, str where) | |
| Validate an expression written in a configuration value, naming where it is. | |
| str | picurv_cli.source_expressions.lower_value (spec, names=PARTICLE_EXPRESSION_NAMES, random=True, where="value") |
| Turn a field value - number, expression, or structured regions - into one expression. | |
The source expression language on the Python side: its functions and variables, validation, constant substitution, region lowering and NumPy evaluation.
The CLI checks every source with it before a run; generators/ic.gen evaluates one with it. The solver evaluates the same language in src/expression.c, and tests/test_expression_language.py holds the two to one conformance fixture.
Definition in file source_expressions.py.