reports_system.py

reports_system.py

Utility functions related to the reporting system which generates reports by default for all runs.

openmdao.utils.reports_system.clear_reports()[source]

Clear all of the reports from the registry.

openmdao.utils.reports_system.get_reports_dir(prob)[source]

Get the path to the directory where the report files should go.

Parameters
probOpenMDAO Problem object

The report will be run on this Problem.

Returns
str

The path to the directory where reports should be written.

openmdao.utils.reports_system.list_reports(out_stream=None)[source]

Write table of information about reports currently registered in the reporting system.

Parameters
out_streamfile-like object

Where to send report info.

openmdao.utils.reports_system.register_report(name, func, desc, class_name, method, pre_or_post, report_filename, inst_id=None)[source]

Register a report with the reporting system.

Parameters
namestr

Name of report. Report names must be unique across all reports.

funcfunction

A function to do the reporting. Expects the first argument to be an instance of class_name.

descstr

A description of the report.

class_namestr

The name of the class owning the method where the report will be run.

methodstr

In which method of class_name should this be run.

pre_or_poststr

Valid values are ‘pre’ and ‘post’. Indicates when to run the report in the method.

report_filenamestr

Name of file to use when saving the report.

inst_idstr or None

Either the instance ID of an OpenMDAO object (e.g. Problem, Driver) or None. If None, then this report will be run for all objects of type class_name.

openmdao.utils.reports_system.report_function()[source]

Decorate report functions. Handles getting the file path to where the report is written.

Returns
function

The wrapper function.

openmdao.utils.reports_system.run_n2_report(prob, report_filename=None)
openmdao.utils.reports_system.run_scaling_report(driver, report_filename=None)
openmdao.utils.reports_system.set_default_reports_dir(reports_dir_path)[source]

Set the path to where the reports should go. By default, they go into the current directory.

Parameters
reports_dir_pathstr

Path to where the report directories should go.

openmdao.utils.reports_system.setup_default_reports()[source]

Set up the default reports for all OpenMDAO runs.