pliers.stimuli.CompoundStim

class pliers.stimuli.CompoundStim(elements)[source]

Bases: object

A container for an arbitrary set of Stim elements.

Parameters

elements (Stim or list) – a single Stim (of any type) or a list of elements.

__init__(elements)[source]
get_stim(type_, return_all=False)[source]

Returns component elements of the specified type.

Parameters
  • type (str or Stim class) – the desired Stim subclass to return.

  • return_all (bool) – when True, returns all elements that matched the specified type as a list. When False (default), returns only the first matching Stim.

Returns

If return_all is True, a list of matching elements (or an empty list if no elements match). If return_all is False, returns the first matching Stim, or None if no elements match.

get_types()[source]

Return tuple of types of all available Stims.

has_types(types, all_=True)[source]

Check whether the current component list matches all Stim types in the types argument.

Parameters
  • types (Stim, list) – a Stim class or iterable of Stim classes.

  • all (bool) – if True, all input types must match; if False, at least one input type must match.

Returns

True if all passed types match at least one Stim in the component list, otherwise False.