LoaderProtocol#

class movement.io.load.LoaderProtocol(*args, **kwargs)[source]#

Bases: Protocol

Protocol for loader functions to be registered via register_loader.

All loader functions registered via register_loader() must conform to this protocol. Loaders must accept a file path or a pynwb.file.NWBFile object as their first argument and return an xarray.Dataset containing pose tracks or bounding box tracks. Additional positional and keyword arguments are allowed.

See also

register_loader

Decorator for registering loader functions.

__call__(file, *args, **kwargs)[source]#

Load data from a file.

Parameters:
  • file (Path | str | NWBFile) – Path to the file or a pynwb.file.NWBFile object.

  • *args – Additional positional arguments for the loader.

  • **kwargs – Additional keyword arguments for the loader.

Returns:

The loaded dataset.

Return type:

Dataset