module documentation
Undocumented
| Class | |
Undocumented |
| Function | apply |
Recursively apply mathematical operator(s). |
| Function | bib2html |
Undocumented |
| Function | eval |
Evaluate a mathematical expression stored as a string in a JSON file. |
| Function | extract |
Recursively extract a formula from a list of operands and dataset fields. |
| Function | extract |
Recursively extract a formula from a list of operands and dataset fields. |
| Function | extract |
Extract a list of unique variable names from an expression. |
| Function | will |
Test a string to determine if it will convert to a float. |
| Function | _bib2html |
Undocumented |
| Function | _bib2html |
Undocumented |
| Function | _bib2html |
Undocumented |
Recursively apply mathematical operator(s).
| Parameters | |
operands:list | List of operands, either two field names, or a field name and another list of field names (e.g. [U, V], or [T, [U, V]], or [T, [U, [V, X]]]) |
operator:str | Operator to apply recursively to the pairs of operands (one of +, -, *, /, or ^) |
name:bool | If true, return a string of the applied operation, if false, return the value. |
| Returns | |
(type(operands), str) | output - Returns the result of the mathematical expression, with the same type as
operands[0] or a string representation of the expression |
Evaluate a mathematical expression stored as a string in a JSON file.
| Parameters | |
expr:str | Mathematical expression, stored as a single string: e.g. "1 + 1 * 3", "24 * 3600 * 365", etc. Will be checked to contain _only_ numbers and mathematical symbols: [0-9], +, -, *, /, ^, (, and ) |
| Returns | |
float | result - Result of mathematical expression |
Recursively extract a formula from a list of operands and dataset fields.
| Parameters | |
expr:list | List of expressions where first element is operator, subsequent
two elements are operands, either numeric values, fields within dset,
or an expression of this kind.
(e.g. ["^", ["+", ["*", "U", "U"], ["*", "V", "V"]], "0.5"] for the wind velocity) |
dset:xarray.Dataset | Dataset which contains the fields described in expr |
name:bool, optional | If true, output the string of the interpreterd expression rather than its result |
| Returns | |
xarray.DataArray | output - Evaluated expression |
Recursively extract a formula from a list of operands and dataset fields.
| Parameters | |
expr:list | List of expressions where first element is operator, subsequent
two elements are operands, either numeric values, fields within dset,
or an expression of this kind.
(e.g. ["^", ["+", ["*", "U", "U"], ["*", "V", "V"]], "0.5"] for the wind velocity) |
| Returns | |
str | output - Human redable text of evaluated expression |