get_backend_fn

ndmapper.io.get_backend_fn(funcname, filename)[source] [edit on github]

Given a filename string and the name of a loader function defined in ndmapper.io, return the implementation of the latter function from the sub-module appropriate for the file format.

Currently we use only the file extension names, rather than more foolproof magic or try-loader-except to determine file types, avoiding unnecessary I/O overheads & complication.

This function may be used either directly by applications wanting to cache look-ups when doing repeated I/O operations or, internally (when defining new generic functions in ndmapper.io), via the _get_loader decorator.