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.

Parameters:
  • label (str) – The visual label for the reference. In the context of a model, is set to the name assigned on the model if not explicitly provided.

  • doc (str) – A docstring/description explaining what this component is.

Methods

__init__([label, doc])

clip(min, max)

equal(obj)

eval([t, save, force])

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

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)

String representation suitable for a latex display.

not_equal(obj)

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

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

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.

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

Return repr(self).

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.

Return type:

str