reno.components.Reference#

class reno.components.Reference(label=None, doc=None)#

Bases: EquationPart

A symbolic reference to some other equation component, e.g. a stock, flow, or variable.

This is a largely semantic parent class, probably shouldn’t directly be using this.

Semantically a reference is anything that will need to “resolve” somehow, either by looking up a historical value or running a sub equation to get the result.

Methods

__init__([label, doc])

Create a reference node/something that refers to another equation or thing.

astype(dtype)

Returns a symbolic operation to convert the output of this equation to the specified type.

clip(min, max)

Returns a symbolic operation for enforcing the output is between the passed min and max.

equal(obj)

Returns a symbolic operation for checking equality with passed object.

eval([t, save, force])

Execute the compute graph for this equation, this needs to be implemented in every subclass.

find_parts_of_type(search_type[, ...])

Recursively search for all EquationParts in the tree of the specified type.

get_shape()

Get the size of the additional "data" dimension.

get_type()

Get the type of the target output of this equation expression.

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)

String representation suitable for a latex display.

mean([axis])

Returns a symbolic operation to find the series-wise mean of the array.

not_equal(obj)

Returns a symbolic operation for checking inequality with passed object.

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([include_ref_types])

Recursively find a list of all References immediately underneath this part.

series_max()

Returns a symbolic operation to find the series-wise maximum of the array.

series_min()

Returns a symbolic operation to find the series-wise minimum of the array.

sum([axis])

Returns a symbolic operation to find the series-wise sum of the array.

Attributes

dtype

The type of each underlying value.

shape

The size of the data dimension, 1 by default.

timeseries

Returns symbolic operation for getting a timeseries view of the data.

label

Label is what's used in any visual representation (e.g. allows spaces where name does not.).

doc

A docstring to explain/describe the reference.

Parameters:
  • label (str)

  • doc (str)

__annotations__ = {}#
__module__ = 'reno.components'#
__repr__()#

Return repr(self).

Return type:

str

doc#

A docstring to explain/describe the reference.

label#

Label is what’s used in any visual representation (e.g. allows spaces where name does not.)

latex(**kwargs)#

String representation suitable for a latex display.

Parameters:

kwargs (dict)

Return type:

str