Skip to content

cycle_selection

CycleSelection

Class for selecting a cycle based on a parameter value (e.g. cycle length or cycle weight) It is possible to select either the cycle with the smallest, largest, median or average value. In case of average, the closest value to the average is taken.

cycles = cycles instance-attribute

method = None instance-attribute

methods = {'smallest': self.select_smallest, 'greatest': self.select_greatest, 'median': self.select_median, 'average': self.select_average} instance-attribute

mode = None instance-attribute

parameter = None instance-attribute

__init__(cycles)

select()

Select a cycle based on a parameter value and using a certain mode

Example

If parameter = 'cycle_lenght', mode = 'smallest',

The cycle with the smallest cycle length will be selected.

Returns:

Type Description
DataFrame

pd.DataFrame: datagrame of cycles

select_average(param_vals) staticmethod

select_greatest(param_vals) staticmethod

select_median(param_vals) staticmethod

select_smallest(param_vals) staticmethod

set_mode(mode)

Parameters:

Name Type Description Default
mode str

How to select a cycle based on the parameter value. Options: 'smallest', 'median', 'greatest', 'average'.

required

set_parameter(parameter)