reno.ops.assign#

class reno.ops.assign(a)#

Bases: Operation

This is to handle the weird seek_refs issues when you just set a tracked ref’s equation to another tracked ref. By “wrapping” it in an effectively blank operation, this mitigates the annoying recursion issue.

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(**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.)

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. Otherwise, just uses class name.

__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.

op_eval(**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