sqlite_recorder.py

Class definition for SqliteRecorder, which provides dictionary backed by SQLite

class openmdao.recorders.sqlite_recorder.SqliteRecorder(out, **sqlite_dict_args)[source]

Bases: openmdao.recorders.base_recorder.BaseRecorder

Recorder that saves cases in an SQLite dictionary.

Args:

sqlite_dict_args : dict

Dictionary lf any additional arguments for the SQL db.

Options:

options[‘record_metadata’] : bool(True)

Tells recorder whether to record variable attribute metadata.

options[‘record_unknowns’] : bool(True)

Tells recorder whether to record the unknowns vector.

options[‘record_params’] : bool(False)

Tells recorder whether to record the params vector.

options[‘record_resids’] : bool(False)

Tells recorder whether to record the ressiduals vector.

options[‘record_derivs’] : bool(True)

Tells recorder whether to record derivatives that are requested by a Driver.

options[‘includes’] : list of strings

Patterns for variables to include in recording.

options[‘excludes’] : list of strings

Patterns for variables to exclude in recording (processed after includes).

close()[source]

Closes out

record_derivatives(derivs, metadata)[source]

Writes the derivatives that were calculated for the driver.

Args:

derivs : dict or ndarray depending on the optimizer

Dictionary containing derivatives

metadata : dict, optional

Dictionary containing execution metadata (e.g. iteration coordinate).

record_iteration(params, unknowns, resids, metadata)[source]

Stores the provided data in the sqlite file using the iteration coordinate for the key.

Args:

params : dict

Dictionary containing parameters. (p)

unknowns : dict

Dictionary containing outputs and states. (u)

resids : dict

Dictionary containing residuals. (r)

metadata : dict, optional

Dictionary containing execution metadata (e.g. iteration coordinate).

record_metadata(group)[source]

Stores the metadata of the given group in a sqlite file using the variable name for the key.

Args:

group : System

System containing vectors

startup(group)[source]