mooflow.funcs.max_len_ones¶
-
mooflow.funcs.
max_len_ones
(inarray, indicator='max_len', parameter=14, fitness_group=None)¶ run length encoding. If this function is set for a set_area_function1, then omit the inarray.
Adopted from: https://stackoverflow.com/questions/1066758/find-length-of-sequences-of-identical-values-in-a-numpy-array-run-length-encodi
- Parameters
- inarraynumpy array or list
a 1d list or array with ones for violations and zeros for comliances with the gwr pattern
- indicatorstr
the type of evaluation: max_len… the maximum consecuative days violating the constraint num_days_th… the longest period with consecuative violations over a treshold perceptile… returns a quantile of days with violation
- parameterint
the function of the parameter depends on the indicator num_days_th… number of allowed consecuative days with violations perceptile… the percentile