pywr.recorders.NumpyArrayDailyProfileParameterRecorder
- class pywr.recorders.NumpyArrayDailyProfileParameterRecorder(model, Parameter param, **kwargs)
Recorder for an annual profile from a Parameter.
This recorder stores a daily profile returned by a specific parameter. For each day of the year it stores the value encountered for that day during a simulation. This results in the final profile being the last value encountered on each day of the year during a simulation. This recorder is useful for returning the daily profile that may result from the combination of one or more parameters. For example, during optimisation of new profiles non-daily parameters (e.g. RbfProfileParameter) and/or aggregations of several parameters might be used. With this recorder the daily profile used in the simulation can be easily saved.
The data is saved internally using a memory view. The data can be accessed through the data attribute or to_dataframe() method.
- Parameters:
- modelpywr.core.Model
- parampywr.parameters.Parameter
Parameter instance to record.
- temporal_agg_funcstr or callable (default=”mean”)
Aggregation function used over time when computing a value per scenario. For aggregation over scenarios see the agg_func keyword argument.
- __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 This DataFrame contains a MultiIndex for the columns with the recorder name as the first level and scenario combination names as the second level.
unregister(cls)values(self)Compute a value for each scenario using temporal_agg_func.
Attributes
agg_funcchildrencommentcomment: str
constraint_lower_boundsconstraint_upper_boundsdataepsilonepsilon: 'double'
ignore_nanignore_nan: 'bool'
is_constraintReturns true if either upper or lower constraint bounds is defined.
is_double_bounded_constraintReturns true if upper and lower constraint bounds are both defined and not-equal to one another.
is_equality_constraintReturns true if upper and lower constraint bounds are both defined and equal to one another.
is_lower_bounded_constraintReturns true if lower constraint bounds is defined and upper constraint bounds is not.
is_objectiveis_upper_bounded_constraintReturns true if upper constraint bounds is defined and lower constraint bounds is not.
modelnameparameterparentstagstags: dict
temporal_agg_func