Utility functions


This module provides a class that wraps data into a callable object.

class livius.util.functor.Functor(data, transform=None)

Creates a callable object from the given data. The data must be indexable by the arguments that are provided when calling the object.

  • data (Anything with a specified __getitem__ method) – The data which is accessed by the arguments given when this object is called.
  • transform – An additional function that transforms the indexed item (e.g turns it into a np.array)

Index the stored data.

Parameters:args – One or more indices we want to access the data with.


The arguments when calling the object must be provided in order of indexing


list of weak references to the object (if defined)