reno.ops.inflow#
- class reno.ops.inflow(flow)#
Bases:
OperationA purely semantic op to aid in diagramming that allows specifying a flow as an “inflow” to another flow. This does not impact any equations, but alters rendering to show a thicker “material” line between the two flows.
This is relevant e.g. when a flow is purely a modification on some other flow, and is subsequently used as an inflow to a stock. This op helps avoid the separated “islands” that can crop up in certain circumstances
String notation:
(inflow FLOW)Methods
__init__(flow)Create an operation node involving the passed sub equation parts.
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])'wrap' all operation eval functions so we get better error handling.
find_parts_of_type(search_type[, ...])Recursively search for all EquationParts in the tree of the specified type.
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)Get a string of latex representing this op.
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.
op_eval(**kwargs)Any new operations should implement this method.
op_latex(**kwargs)Output the latex string for this operation.
op_repr()Get a string representation for the op name/label.
op_types()Get a list of all defined operations/Operation subclasses.
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
OP_REPRIf defined, this is what gets printed as the 'label' for the operation in the repr, and is what's used during parsing.
dtypeThe type of each underlying value.
shapeThe size of the data dimension, 1 by default.
timeseriesReturns symbolic operation for getting a timeseries view of the data.
non_repr_part_indicesUse 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.
- Parameters:
flow (reno.components.Flow)
- __annotations__ = {}#
- __module__ = 'reno.ops'#
- get_shape()#
Get the size of the additional “data” dimension.
Prefer using
shapeproperty over directly calling this function.“Broadcasts” any size 1 dims to a larger dim node if present.
- Return type:
int
- get_type()#
Get the type of the target output of this equation expression.
Prefer using
dtypeproperty over directly calling this function.- Return type:
type
- op_eval(**kwargs)#
Any new operations should implement this method.
Put all evaluation logic in here, as opposed to overriding eval.
- Parameters:
kwargs (dict)
- Return type:
int | float | ndarray
- op_latex(**kwargs)#
Output the latex string for this operation. Override this in subclasses.
- Parameters:
kwargs (dict)
- Return type:
str
- 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
- seek_refs(include_ref_types=False)#
Recursively find a list of all References immediately underneath this part.
Either provides a list of references that appear underneath these equations or a dictionary with the “roles” or types that those references play.
Note that this doesn’t infinitely recurse into TrackedReferences themselves, this is used to find the outermost references that need to resolve. (Avoiding circular refs)
- Parameters:
include_ref_types (bool)
- Return type:
list[reno.Reference] | dict[reno.Reference, list[str]]