reno.ops.interpolate#

class reno.ops.interpolate(x, x_data, y_data)#

Bases: Operation

Given a dataset of x -> y datapoints, interpolate any new data along the line formed by the points. Equivalent to numpy’s interp function.

String notation: (interpolate X X_DATA Y_DATA)

Parameters:
  • x – The input x-coordinates that you want interpolated into y outputs.

  • x_data (list | ndarray) – The x-coordinate data to base interpolation on.

  • y_data (list | ndarray) – the y-coordinate data to base interpolation on.

Methods

__init__(x, x_data, y_data)

astype(dtype)

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

The shapes of x_data and y_data don't matter, should be same as input.

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)

Wrapper around op_latex, which subclasses should override

mean([axis])

not_equal(obj)

op_eval(**kwargs)

Any new operations should implement this method.

op_latex(**kwargs)

Override this in subclasses

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

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

non_repr_part_indices

Use this to "hide" a sub_equation_part in the string repr, e.g. if it's important for computation but isn't part of parsing.

__annotations__ = {}#
__module__ = 'reno.ops'#
get_shape()#

The shapes of x_data and y_data don’t matter, should be same as input.

Return type:

int

op_eval(**kwargs)#

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

op_latex(**kwargs)#

Override this in subclasses

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