open_file

ketos.data_handling.database_interface.open_file(path, mode, create_dir=True)[source]

Open an HDF5 database file.

Wrapper function around tables.open_file: https://www.pytables.org/usersguide/libref/top_level.html

Args:
path: str

The file’s full path.

mode: str
The mode to open the file. It can be one of the following:
  • r: Read-only; no data can be modified.

  • w: Write; a new file is created (an existing file with the same name would be deleted).

  • a: Append; an existing file is opened for reading and writing, and if the file does not exist it is created.

  • r+: It is similar to a, but the file must already exist.

create_dir: bool

If the directory does not exist, it will be automatically created. Default is True. Only applies if the mode is w or a,

Returns:
: table.File object

The h5file.