pywr.recorders.AnnualCountIndexThresholdRecorder¶
-
class
pywr.recorders.AnnualCountIndexThresholdRecorder(model, list parameters, unicode name, int threshold, *args, **kwargs)¶ For each scenario, count the number of times a list of parameters exceeds a threshold in each year. If multiple parameters exceed in one timestep then it is only counted once.
Output from data property has shape: (years, scenario combinations)
- Parameters
- modelpywr.core.Model
- parameterslist
List of pywr.core.IndexParameter to record against
- namestr
The name of the recorder
- thresholdint
Threshold to compare parameters against
- exclude_monthslist or None
Optional list of month numbers to exclude from the count.
-
__init__(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(*args, **kwargs)Initialize self.
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(type cls, model, data)register(type cls)reset(self)setup(self)to_dataframe(self)Return a pandas.DataFrame of the recorder data
unregister(type cls)values(self)Compute a value for each scenario using temporal_agg_func.
Attributes
agg_funcchildrencommentcomment: unicode
constraint_lower_boundsconstraint_upper_boundsdataepsilonepsilon: ‘double’
exclude_monthsexclude_months: list
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.
modelnameparametersparameters: list
parentstemporal_agg_functhresholdthreshold: ‘int’