reno.ops.orient_timeseries#

class reno.ops.orient_timeseries(a)#

Bases: Operation

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. This is in essence “reorienting” the underlying data to include the time dimension.

NOTE: for pytensor I suspect this will only work in metric equations. pt/pt_str are dependent on whether the refs are populated with the full series or not, which will only occur within the metrics section? TODO: we can _eventually_ make this work within pytensor by the approach to solving general history time equations - if a timeseries op detected within non-metric context, include the full stops of the relevant variables

TODO: it probably doesn’t make sense to call this on anything except a trackedreference, may want to add checks for this.

Methods

__init__(a)

clip(min, max)

equal(obj)

eval([t, save, force])

'wrap' all operation eval functions so we get better error handling.

find_refs_of_type(search_type[, already_checked])

Actually recursive as opposed to seek_refs, returns a list of all equation parts matching passed type.

get_shape()

For now this is returning an integer because we only allow a single additional dimension.

get_type()

Similar to shape, this gets computed recursively, used to automatically determine if the value needs to be initialized with a certain numpy type.

is_static()

Convenience shortcut for reno.utils.is_static() - True if this equation doesn't rely on any dynamic values (thus constant), False if it does.

latex(**kwargs)

Construct a string representation of this portion of the equation for use in a latex display.

not_equal(obj)

op_eval(t, **kwargs)

Any new operations should implement this method.

op_repr()

Get a string representation for the op name/label, used for printing and parsing.

op_types()

Get a list of classes that inherit from this one, in other words all of the possible defined operations.

pt(**refs)

Get a pytensor graph representing this piece of an equation.

pt_str(**refs)

Construct a string containing relevant pytensor code for this piece of the equation.

seek_refs()

Immediate refs only, depth=1.

series_max()

series_min()

sum([axis])

Attributes

OP_REPR

If defined, this is what gets printed as the 'label' for the operation in the repr, and is what's used during parsing.

dtype

The type of each underlying value.

shape

The size of the data dimension, 1 by default.

timeseries

Get a timeseries view of the data (includes all historical data across all timesteps.)

__annotations__ = {}#
__module__ = 'reno.ops'#
latex(**kwargs)#

Construct a string representation of this portion of the equation for use in a latex display. Should probably be overriden in most subclasses, and often needs to be called recursively on sub_equation_parts.

Return type:

str

op_eval(t, **kwargs)#

Any new operations should implement this method. (Put all evaluation logic in here, as opposed to overriding eval.)

pt(**refs)#

Get a pytensor graph representing this piece of an equation.

Parameters:

refs (dict[str, TensorVariable])

Return type:

TensorVariable

pt_str(**refs)#

Construct a string containing relevant pytensor code for this piece of the equation. This is useful for “compiling” into pymc code.

Parameters:

refs (dict[str, str])

Return type:

str