arraylias.Alias.register_function#

Alias.register_function(func: Callable | None = None, lib: str | None = None, path: str | None = None) Callable | None[source]#

Register an array function for aliasing.

Note

This method makes a copy of the function being registered, so if the definition is modified you must re-register the function.

Parameters:
  • func – The function to dispatch to for the specified array library. If None this will return a decorator to apply to a function.

  • lib – Optional, a name string to identify the array library. If None this will be set as the base module name of the arrays module.

  • path – Optional, the path for dispatching to this function. If None the name of the input function will be used.

Returns:

If func is None returns a decorator for registering a function. Otherwise returns None.