PYME.IO.ragged module

class PYME.IO.ragged.RaggedBase(mdh=None)

Bases: object

Base class for ragged or free-form objects in recipes. Looks like a read-only list of arbitrary objects. Objects should be json serializable (ie simple combinations of base types).

to_hdf(filename, tablename, mode='w', metadata=None)
to_json()
class PYME.IO.ragged.RaggedCache(iterable=None, mdh=None)

Bases: RaggedBase

class PYME.IO.ragged.RaggedJSON(filename, mdh=None)

Bases: RaggedCache

class PYME.IO.ragged.RaggedVLArray(h5f, tablename, mdh=None, copy=False)

Bases: RaggedBase

Ragged type which wraps an HDF table variable-length array

Parameters
h5fHDF table or str

Either an open HDF table instance, or a str of the filepath to open one

tablenamestr

Name of the table to open and wrap (beyond root, i.e. h5f.root.tablename

mdhPYME.MetaDataHandler.MDHandlerBase or derived class

Metadata to initialize RaggedVLArray with. If None, will be initialized with blank metadata

copy: load entire data into memory so we can close the original file