Recorders

Base Recorder classes

All the Recorder subclasses in pywr are descended from a common base class.

Recorder(model[, agg_func, ignore_nan, ...])

Base class for recording information from a pywr.model.Model.

NodeRecorder(model, AbstractNode node[, name])

StorageRecorder(model, AbstractStorage node)

ParameterRecorder(model, Parameter param[, name])

Base class for recorders that track Parameter values.

IndexParameterRecorder(model, ...[, name])

Aggregator(func)

Utility class for computing aggregate values.

Numpy array recorders

The following parameters are used for storing results in memory. The data can be accessed following a model run before the model instances is destroyed.

NumpyArrayNodeRecorder(model, ...)

Recorder for timeseries information from a Node.

NumpyArrayStorageRecorder(*args, **kwargs)

Recorder for timeseries information from a Storage node.

NumpyArrayLevelRecorder

Recorder for level timeseries from a Storage node.

NumpyArrayAreaRecorder

Recorder for area timeseries from a Storage node.

NumpyArrayParameterRecorder(model, ...)

Recorder for timeseries information from a Parameter.

NumpyArrayIndexParameterRecorder(model, ...)

Recorder for timeseries information from an IndexParameter.

NumpyArrayDailyProfileParameterRecorder(...)

Recorder for an annual profile from a Parameter.

Flow duration curve recorders

FlowDurationCurveRecorder(model, ...)

This recorder calculates a flow duration curve for each scenario.

StorageDurationCurveRecorder(model, ...)

This recorder calculates a storage duration curve for each scenario.

FlowDurationCurveDeviationRecorder(model, ...)

This recorder calculates a Flow Duration Curve (FDC) for each scenario and then calculates their deviation from upper and lower target FDCs.

SeasonalFlowDurationCurveRecorder(model, ...)

This recorder calculates a flow duration curve for each scenario for a given season specified in months.

Deficit recorders

NumpyArrayNodeDeficitRecorder

Recorder for timeseries of deficit from a Node.

NumpyArrayNodeSuppliedRatioRecorder

Recorder for timeseries of ratio of supplied flow from a Node.

NumpyArrayNodeCurtailmentRatioRecorder

Recorder for timeseries of curtailment ratio from a Node.

TotalDeficitNodeRecorder

Recorder to total the difference between modelled flow and max_flow for a Node

DeficitFrequencyNodeRecorder

Recorder to return the frequency of timesteps with a failure to meet max_flow.

Statistical recorders

AggregatedRecorder(model, recorders, **kwargs)

This Recorder is used to aggregate across multiple other Recorder objects.

MeanFlowNodeRecorder(*args, **kwargs)

Record the mean flow for a Node.

TotalFlowNodeRecorder(*args, **kwargs)

Recorder to total the flow for a Node.

AnnualTotalFlowRecorder(model, unicode name, ...)

For each scenario, record the total flow in each year across a list of nodes.

MeanParameterRecorder(*args, **kwargs)

Record the mean value of a Parameter during a simulation.

TotalParameterRecorder(*args, **kwargs)

Record the total value of a Parameter during a simulation.

RollingMeanFlowNodeRecorder(model, node[, ...])

Records the mean flow of a Node for the previous N timesteps

MinimumVolumeStorageRecorder

Record the minimum volume in a Storage node during a simulation.

MinimumThresholdVolumeStorageRecorder(model, ...)

Record whether a Storage node falls below a particular volume threshold during a simulation.

TimestepCountIndexParameterRecorder(model, ...)

Record the number of times an index parameter exceeds a threshold for each scenario.

AnnualCountIndexThresholdRecorder(model, ...)

For each scenario, count the number of times a list of parameters exceeds a threshold in each year.

RollingWindowParameterRecorder(model, ...)

Records the mean value of a Parameter for the last N timesteps.

GaussianKDEStorageRecorder(*args, **kwargs)

A recorder that fits a KDE to a time-series of volume.

NormalisedGaussianKDEStorageRecorder(*args, ...)

A recorder that fits a KDE to a normalised time-series of volume.

Index recorders

AnnualCountIndexParameterRecorder(model, ...)

Record the number of years where an IndexParameter is greater than or equal to a threshold

File recorders

CSVRecorder(model, csvfile[, ...])

A Recorder that saves Node values to a CSV file.

TablesRecorder(model, h5file[, nodes, ...])

A recorder that saves to PyTables CArray

Hydro-power recorders

HydropowerRecorder(model, node[, ...])

Calculates the power production using the hydropower equation

TotalHydroEnergyRecorder(model, node[, ...])

Calculates the total energy production using the hydropower equation from a model run.