def get_primitives(name=None, primitive_type=None, primitive_subtype=None): """Get a list of the available primitives. Optionally filter by primitive type: ``transformation`` or ``aggregation``. Args: primitive_type (str): Filter by primitive type. ``transformation`` or ``aggregation``. Returns: list: List of the names of the available primitives. """ filters = {} if primitive_type: if primitive_type not in ('transformation', 'aggregation'): raise ValueError( 'primitive_type must be `transformation` or `aggregation`.') filters['classifiers.type'] = primitive_type if primitive_subtype: if primitive_subtype not in ('amplitude', 'frequency', 'frequency_time'): raise ValueError( 'primitive_subtype must be `amplitude`, `frequency` or `frequency_time`.' ) filters['classifiers.subtype'] = primitive_subtype return discovery.find_primitives(name or 'sigpro', filters)
def test_find_primitives(gpp_mock, fa_mock): primitives = discovery.find_primitives('pattern') fa_mock.assert_called_once_with(gpp_mock.return_value, discovery.load_primitive, 'pattern', dict()) assert primitives == fa_mock.return_value
def get_primitives(): """Get a list of the available datatracer primitives. Returns: list: List of the names of the available datatracer primitives. """ return discovery.find_primitives('datatracer')