Skip to content

decorators module

Class and function decorators.

attach_returns_acc_methods function


Class decorator to add returns accessor methods.

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

  • source_name: Name of the source method. Defaults to the target name.
  • docstring: Method docstring. Defaults to "See vectorbt.returns.accessors.ReturnsAccessor.{source_name}.".

The class should be a subclass of Portfolio.