Alias#

class Alias[source]#

Bases: object

Library aliasing class.

This class enables aliasing of multiple libraries and uses a single-dispatch mechanism to dispatch to the correct library function based on the type of the first function argument.

Full library sub-module paths are supported, and libraries can be extended by registering custom modules, and modules can be extended by registering custom functions.

See the Arraylias User Guide for details on building and using an Alias.

Methods

cache_clear

Clear cached dispatched calls.

infer_libs

Infer the registered library name for an object.

register_default

Register a default function alias for un-registered types.

register_fallback

Register a fallback array function for aliasing.

register_function

Register an array function for aliasing.

register_module

Register a module for looking up array functions.

register_type

Register an array type for dispatching array functions.

registered_libs

Return all registered library names for dispatching.

registered_types

Return all registered types for dispatching.