Perform calculations against values stored in the Thorium register.
These states are useful when Thorium should react to trends in recent event
data instead of reacting to a single event. They are most often paired with
reg.list so that a rolling window of values can be evaluated.
New in version 2016.11.0.
statistics PyPi module
Adds together the num most recent values. Requires a list.
USAGE:
foo:
calc.add:
- name: myregentry
- num: 5
Perform a calculation on the num most recent values. Requires a list.
Valid values for oper are:
add: Add last num values together
mul: Multiple last num values together
mean: Calculate mean of last num values
median: Calculate median of last num values
median_low: Calculate low median of last num values
median_high: Calculate high median of last num values
median_grouped: Calculate grouped median of last num values
mode: Calculate mode of last num values
USAGE:
load_samples:
calc.calc:
- name: load_samples
- num: 5
- oper: mean
- ref: load
- minimum: 4
Calculates the mean of the num most recent values. Requires a list.
When the register contains dictionaries from reg.list, use ref to
select the field to evaluate.
USAGE:
load_samples:
calc.mean:
- name: load_samples
- num: 5
- ref: load
- minimum: 4
Calculates the mean of the num most recent values. Requires a list.
USAGE:
foo:
calc.median:
- name: myregentry
- num: 5
Calculates the grouped mean of the num most recent values. Requires a
list.
USAGE:
foo:
calc.median_grouped:
- name: myregentry
- num: 5
Calculates the high mean of the num most recent values. Requires a list.
USAGE:
foo:
calc.median_high:
- name: myregentry
- num: 5
Calculates the low mean of the num most recent values. Requires a list.
USAGE:
foo:
calc.median_low:
- name: myregentry
- num: 5
Calculates the mode of the num most recent values. Requires a list.
USAGE:
foo:
calc.mode:
- name: myregentry
- num: 5
Multiplies together the num most recent values. Requires a list.
USAGE:
foo:
calc.mul:
- name: myregentry
- num: 5