mlrun.package.packagers.numpy_packagers.NumPySupportedFormat#

class mlrun.package.packagers.numpy_packagers.NumPySupportedFormat[source]#

Bases: SupportedFormat[_Formatter]

Library of numpy formats (file extensions) supported by the NumPy packagers.

Attributes

CSV

GZ

NPY

NPZ

TXT

CSV = 'csv'#
GZ = 'gz'#
NPY = 'npy'#
NPZ = 'npz'#
TXT = 'txt'#

Methods

__init__()

get_all_formats()

Get all supported formats.

get_format_handler(fmt)

Get the format handler to the provided format (file extension):

get_multi_array_formats()

Get the supported formats for saving a collection (multiple) numpy arrays - e.g.

get_single_array_formats()

Get the supported formats for saving one numpy array.

match_format(path)

Try to match one of the available formats this class holds to a given path.

__init__()#
classmethod get_all_formats() List[str]#

Get all supported formats.

Returns:

A list of all the supported formats.

classmethod get_format_handler(fmt: str) Type[FileHandlerType]#

Get the format handler to the provided format (file extension):

Parameters:

fmt -- The file extension to get the corresponding handler.

Returns:

The handler class.

classmethod get_multi_array_formats() List[str][source]#

Get the supported formats for saving a collection (multiple) numpy arrays - e.g. list of arrays or dictionary of arrays.

Returns:

A list of all the supported formats for saving multiple numpy arrays.

classmethod get_single_array_formats() List[str][source]#

Get the supported formats for saving one numpy array.

Returns:

A list of all the supported formats for saving one numpy array.

classmethod match_format(path: str) str | None#

Try to match one of the available formats this class holds to a given path.

Parameters:

path -- The path to match the format to.

Returns:

The matched format if found and None otherwise.