ch5mpy.H5List

class ch5mpy.H5List(file)[source]

Class for managing lists backed on h5 files.

Attributes

H5List.attributes

H5List.file

H5List.filename

H5List.is_closed

Is the file (this H5 object wraps) closed ?

H5List.mode

H5List.name

Methods

H5List.__init__

H5List.append

rtype:

None

H5List.close

Close the file this H5 object wraps.

H5List.copy

Build an in-memory copy of this H5 object.

H5List.read

Read an H5 object from a file.

H5List.to_dict

rtype:

H5Dict[TypeVar(_T)]

H5List.write

Write a list to a .h5 file as a H5List.

Parameters:

file (File | Group) –

Attributes

H5List.attributes
H5List.file
H5List.filename
H5List.is_closed

Is the file (this H5 object wraps) closed ?

H5List.mode
H5List.name

Methods

H5List.__init__(file)[source]
Parameters:

file (File | Group) –

H5List.append(value)[source]
Return type:

None

Parameters:

value (None) –

H5List.close()

Close the file this H5 object wraps.

Return type:

None

H5List.copy()[source]

Build an in-memory copy of this H5 object.

Return type:

Any

classmethod H5List.read(path, name='', mode=H5Mode.READ)[source]

Read an H5 object from a file.

Parameters:
  • path (str | Path | File | Group) – Either a path to the .h5 file or an open ch5mpy.File or ch5mpy.Group object.

  • name (str (default: '')) – The group member name inside the .h5 file to use.

  • mode (H5Mode (default: <H5Mode.READ: 'r'>)) – The mode for opening the .h5 file if not already open.

Return type:

H5List[Any]

H5List.to_dict()[source]
Return type:

H5Dict[TypeVar(_T)]

classmethod H5List.write(lst, path, name='')[source]

Write a list to a .h5 file as a H5List.

Parameters:
  • lst (list[Any]) – a list to write.

  • path (str | Path | File | Group) – Either a path to the .h5 file or an open ch5mpy.File or ch5mpy.Group object.

  • name (str (default: '')) – The group member name inside the .h5 file to use.

Return type:

None