Skip to content

decorators module

Class decorators for generic accessors.


attach_nb_methods function

attach_nb_methods(
    config
)

Class decorator to attach Numba methods.

config must contain target method names (keys) and dictionaries (values) with the following keys:

  • func: Function that must be wrapped. The first argument must expect a 2-dim array.
  • is_reducing: Whether the function is reducing. Defaults to False.
  • disable_jitted: Whether to disable the jitted option.
  • disable_chunked: Whether to disable the chunked option.
  • replace_signature: Whether to replace the target signature with the source signature. Defaults to True.
  • wrap_kwargs: Default keyword arguments for wrapping. Will be merged with the dict supplied by the user. Defaults to dict(name_or_index=target_name) for reducing functions.

The class must be a subclass of Wrapping.


attach_transform_methods function

attach_transform_methods(
    config
)

Class decorator to add transformation methods.

config must contain target method names (keys) and dictionaries (values) with the following keys:

  • transformer: Transformer class/object.
  • docstring: Method docstring.
  • replace_signature: Whether to replace the target signature. Defaults to True.

The class must be a subclass of GenericAccessor.