pywr.recorders.NumpyArrayNodeCurtailmentRatioRecorder

class pywr.recorders.NumpyArrayNodeCurtailmentRatioRecorder

Recorder for timeseries of curtailment ratio from a Node.

This class stores curtailment ratio from a specific node for each time-step of a simulation. The data is saved internally using a memory view. The data can be accessed through the data attribute or to_dataframe() method. If the node’s max_flow returns zero then the curtailment ratio is recorded as 0.0.

Parameters:
modelpywr.core.Model
nodepywr.core.Node

Node instance to record.

temporal_agg_funcstr or callable (default=”mean”)

Aggregation function used over time when computing a value per scenario. This can be used to return, for example, the median flow over a simulation. For aggregation over scenarios see the agg_func keyword argument.

Notes

Curtailment ratio is calculated calculated as one minues the ratio of self.node.flow to self.node.max_flow for each time-step:

curtailment_ratio = 1 - actual_flow / max_flow
__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

after(self)

aggregated_value(self)

before(self)

finish(self)

is_constraint_violated(self)

Returns true if the value from this Recorder violates its constraint bounds.

load(cls, model, data)

register(cls)

reset(self)

setup(self)

to_dataframe(self)

Return a pandas.DataFrame of the recorder data

unregister(cls)

values(self)

Compute a value for each scenario using temporal_agg_func.

Attributes

agg_func

children

comment

comment: unicode

constraint_lower_bounds

constraint_upper_bounds

data

epsilon

epsilon: 'double'

factor

factor: 'float'

ignore_nan

ignore_nan: 'bool'

is_constraint

Returns true if either upper or lower constraint bounds is defined.

is_double_bounded_constraint

Returns true if upper and lower constraint bounds are both defined and not-equal to one another.

is_equality_constraint

Returns true if upper and lower constraint bounds are both defined and equal to one another.

is_lower_bounded_constraint

Returns true if lower constraint bounds is defined and upper constraint bounds is not.

is_objective

is_upper_bounded_constraint

Returns true if upper constraint bounds is defined and lower constraint bounds is not.

model

name

node

parents

tags

tags: dict

temporal_agg_func