sunpeek.core_methods.power_check.wrapper.PowerCheckAlgo#
- class sunpeek.core_methods.power_check.wrapper.PowerCheckAlgo(component, strategies=None, *args, **kwargs)#
Bases:
CoreAlgorithmMethods
__init__(component[, strategies])allowed_components()check_interval([eval_start, eval_end])Make sure we have data in the specified interval, and check that plant's virtual sensors are up-to-date.
create_variants(arg, allowed_type, default)Create list with sanitized inputs for algo strategies.
define_strategies([methods, formulae, use_wind])Returns list of all possible Power Check strategies in the order they will be executed.
Cycle through all algo strategies, return CoreMethodFeedback of all strategy problems.
run([on_strategy_error])Calculates algorithm using its defined strategies, stopping at the first successful strategy.
- check_interval(eval_start=None, eval_end=None)#
Make sure we have data in the specified interval, and check that plant’s virtual sensors are up-to-date.
- Return type:
- static create_variants(arg, allowed_type, default)#
Create list with sanitized inputs for algo strategies. Set default if needed.
:raises TypeError :
if `arg`ordefaultdoes not matchallowed_type.: :raises AlgorithmError :if no valid variants are found:
- define_strategies(methods=None, formulae=None, use_wind=None, **kwargs)#
Returns list of all possible Power Check strategies in the order they will be executed.
- Return type:
- get_config_feedback()#
Cycle through all algo strategies, return CoreMethodFeedback of all strategy problems. Stops at first successful strategy, copies problem slots from strategy.
- Return type:
CoreMethodFeedback
- run(on_strategy_error='skip')#
Calculates algorithm using its defined strategies, stopping at the first successful strategy.
- Parameters:
on_strategy_error (
str, optional) – If ‘raise’, exceptions that occur during a strategy.execute() are raised. If not, they are saved as own_feedback in self.problems. In any case, errors are logged.- Return type:
:raises AlgorithmError :
if algorithm has no strategies defined, orif getting some strategy problems fails.: