autowisp.evaluator module
Class Inheritance Diagram

More convenient interface to asteval interpreters.
- class autowisp.evaluator.Evaluator(*data)[source]
Bases:
EvaluatorBase
Evaluator for expressions involving fields of numpy array or headers.
- __init__(*data)[source]
Get ready to evaluate expressions given data.
- Parameters:
data ([dict-like]) – A mapping between variable names that will participate in the expressions to be evaluated and the value that should be used. In case of repeating keys, later entries overwrite earlier ones.
- Returns:
None
- class autowisp.evaluator.EvaluatorBase[source]
Bases:
Interpreter
Asteval interpreter with the symbols all AutoWISP expressions share.
- __call__(*args, **kwargs)[source]
Evaluate the expression, raising rather than returning None on error.
Asteval defaults to printing the error and returning
None, which only relocates the failure: theNoneflows on and breaks somewhere unrelated, long after the message about the offending expression has scrolled away. Callers wanting the permissive behaviour can still passraise_errors=Falseexplicitly.
- __init__()[source]
Create an interpreter with AutoWISP’s symbol table.
Sub-classes should add their data to the symbol table after invoking this, so a variable named like one of the aggregates shadows the function rather than the other way around.
- Returns:
None
- nan_aggregates = ('nanmean', 'nanmedian', 'nanstd', 'nanvar', 'nansum', 'nanprod', 'nanmin', 'nanmax', 'nanpercentile', 'nanquantile', 'nanargmin', 'nanargmax', 'nancumsum', 'nancumprod')
- removed_names = ('open', 'print')
- class autowisp.evaluator.LightCurveEvaluator(lightcurve, lc_points_selection=None, **lc_substitutions)[source]
Bases:
EvaluatorBase
Evaluator for expressions involving lightcurve datasets.
- __init__(lightcurve, lc_points_selection=None, **lc_substitutions)[source]
Get ready to evaluate expressions against the given light curve.
- property lc_points_selection
Getter for the poins selection property.
- property lc_substitutions
Substitutions to apply to resolve lightcurve datasets.
These can be changed after creating the instance.
