ctwrap Output

The output module defines defines a Output object and derived classes that handle file output for batch jobs of wrapped Simulation module runs.

Class Definitions

class ctwrap.output.Output(settings, file_name=None, file_path=None)[source]

Class handling file output

Parameters
  • settings (Dict[str, Any]) – Dictionary specifying output settings

  • file_name (Optional[str]) – filename (overrides settings enty)

  • file_path (Optional[str]) – output path (overrides settings entryl)

property output_name

Return output name

property settings

Output settings

classmethod from_dict(settings, file_name=None, file_path=None)[source]

Factory loader for Output objects

Parameters

settings (Dict[str, Any]) – Dictionary containing output settings

Return type

Output

save(data, entry, variation=None, mode='a', errored=False)[source]

Save output

Parameters
  • data (Any) – Data to be saved

  • entry (str) – Description of simulation task

  • variation (Optional[Dict]) – Parameter values

  • mode (Optional[str]) – Save mode

  • errored (Optional[bool]) – Boolean describing success of simulation task

Return type

bool

Returns

True if data are saved successfully

dir()[source]

List previously saved cases

Return type

List[str]

load_like(entry, other)[source]

Load previously saved output

Parameters
  • entry (str) – Label of entry to be loaded

  • other (Any) – Object of the same type as the one to be loaded

Return type

Any

finalize(metadata)[source]

Save metadata

Parameters

metadata (Dict[str, Any]) – Metadata to be appended to the output file

Return type

bool

Returns

True if metadata are saved successfully

class ctwrap.output.WriteCSV(settings, file_name=None, file_path=None)[source]

Class writing CSV output

class ctwrap.output.WriteHDF(settings, file_name=None, file_path=None)[source]

Class writing HDF output