csv_recorder.py¶
Class definition for CsvRecorder, a recorder that saves the output into a csv file.
-
class
openmdao.recorders.csv_recorder.
CsvRecorder
(out=<open file '<stdout>', mode 'w'>)[source]¶ Bases:
openmdao.recorders.base_recorder.BaseRecorder
Recorder that saves cases into a CSV file. This recorder does not record metadata.
Args: out : stream
Output stream or file name to write the csv file.
Options: 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).
-
record_derivatives
(derivs, metadata)[source]¶ Writes the derivatives that were calculated for the driver.
Args: derivs : dict
Dictionary containing derivatives
metadata : dict, optional
Dictionary containing execution metadata (e.g. iteration coordinate).
-
record_iteration
(params, unknowns, resids, metadata)[source]¶ Record the current iteration.
Args: params : VecWrapper
VecWrapper containing parameters. (p)
unknowns : VecWrapper
VecWrapper containing outputs and states. (u)
resids : VecWrapper
VecWrapper containing residuals. (r)
metadata : dict
Dictionary containing execution metadata (e.g. iteration coordinate).
-
-
openmdao.recorders.csv_recorder.
serialize
(val)[source]¶ Turn every piece of data into a string; arrays are comma separated.
Args: val : object
Object to serialize
Returns: object : serialized object