reno.ops#

Classes for math operations, these are used to build up symbolic equations, similar in principle to what something like PyTensor is doing.

Functions

dist_params(dist, refs)

Extract any dunder variables in the refs passed from pymc.py for setting up parameters for the pymc converted distribution.

dist_shape(dist, n, steps, dim)

Compute the shape/dimensions needed to populate the passed distribution

Classes

Bernoulli(p[, use_p_dist])

Discrete single event probability (p is probability of eval == 1)

Categorical(p[, use_p_dist])

Random categorical distribution - you specify the probability per category, and the output is a set of category indices.

DiscreteUniform([low, high])

Low is inclusive, high is exclusive.

List(values)

Tile passed list to the sample size so each value is hit roughly equally (dependent on exact sample size) and deterministically

Normal(mean[, std, per_timestep])

Observation(ref[, sigma, data])

Represents a Normal distribution around an observed value.

Uniform([low, high])

abs(a)

|a| (absolute value)

add(a, b)

a + b

assign(a)

This is to handle the weird seek_refs issues when you just set a tracked ref's equation to another tracked ref.

bool_and(a, b)

a and b

bool_or(a, b)

a or b

clip(a, b, c)

Simultaneously apply upper and lower bound constraint (element-wise).

delay1(input, delay_time)

delay3(input, delay_time)

div(a, b)

a / b

eq(a, b)

a == b

gt(a, b)

a > b

gte(a, b)

a >= b

index(a, ind)

Get a previous value in the time series at specified index, only works for tracked references inside of equations for metrics.

interpolate(x, x_data, y_data)

Given a dataset of x -> y datapoints, interpolate any new data along the line formed by the points.

log(a)

ln(a) (natural log, naming it log because this is pytensor's and numpy's default)

lt(a, b)

a < b

lte(a, b)

a <= b

maximum(a, b)

Element-wise maximum of array elements between two arrays or values, same as np.maximum.

minimum(a, b)

Element-wise minimum of array elements between two arrays or values, same as np.minimum.

mod(a, b)

a % b

mul(a, b)

a * b

ne(a, b)

a != b

orient_timeseries(a)

Get the full data of a component/equation as an array over time, allowing aggregate operations to operate across the full timeseries, e.g. for metric equations.

pulse(start[, width])

Return a '1' signal for width number of timesteps starting at timestep start.

repeated_pulse(start, interval[, width])

Return a '1' signal for width number of timesteps starting at timestep start, with interval number of timesteps between each subsequent leading edge.

series_max(a)

Maximum value throughout time series.

series_min(a)

Minimum value throughout time series.

sin(a)

slice(a[, start, stop])

Can be applied along with timeseries op in metrics for getting specific time segments, or can be applied generally in equations when dealing with vector data.

smooth(input, adjustment_time[, initial_value])

An information delay, material isn't necessarily preserved but the range is?

step(value, timesteps)

Return a specified value after a specified number of timesteps, otherwise 0.

sub(a, b)

a - b

sum(a[, axis])

Series-wise sum (e.g. row-wise if a matrix).