I/O Module – cyclopts.cyclopts_io

This module provides I/O classes and routines for Cyclopts-related functionality.

author:Matthew Gidden <matthew.gidden _at_ gmail.com>
class cyclopts.cyclopts_io.ResultTable(h5file, path='/Results', chunksize=None)[source]

A Cyclopts Table for generic results.

Parameters:

h5file : PyTables File

the hdf5 file

path : string

the absolute path to the table

chunksize : int, optional

the table chunksize, Cyclopts will optimize for a 32Kb L1 cache by default

class cyclopts.cyclopts_io.Table(h5file=None, path=None, dt=None, chunksize=None, cachesize=None)[source]

A thin wrapper for a PyTables Table to be used by Cyclopts.

Parameters:

h5file : PyTables File

the hdf5 file

path : string

the absolute path to the table

dt : np.dtype, optional

the dtype for the table

chunksize : int, optional

the table chunksize, Cyclopts will optimize for a 32Kb L1 cache by default

cachesize : int, optional

the size of data to cache before writing, defaults to 100 times the chunksize

append_data(data)[source]

Appends data to the Table. If the cachesize limit is reached, data is written to disc.

Parameters:

data : array-like

data to append to the table

create()[source]

Creates a table in the h5file. This must be called before writing.

flush(data=None)[source]

Writes cached data to the table.

class cyclopts.cyclopts_io.TableManager(h5file, tables)[source]

A managing class that performs RAII for its tables by creating them if needed upon acquisition and flushing them upon deletion. Tables can be accessed through the manager by its tables member, which is a dictionary from table names to Table objects.

Parameters:

h5file : PyTables File

the hdf5 file

tables : list of Tables

the list of tables to manage

This Page