checks.py

Set of utilities for detecting and reporting connection errors.

exception openmdao.core.checks.ConnectError[source]

Bases: exceptions.Exception

Custom error that is raised when a connection is invalid.

classmethod invalid_target_error(src, target)[source]

Formats an error message for invalid target in a connection.

Args:

src : str

Name of source

target : str

Name of target

Returns:

str : error message

classmethod nonexistent_src_error(src, target)[source]

Formats an error message for non-existant source in a connection.

Args:

src : str

Name of source

target : str

Name of target

Returns:

str : error message

classmethod nonexistent_target_error(src, target)[source]

Formats an error message for non-existant target in a connection.

Args:

src : str

Name of source

target : str

Name of target

Returns:

str : error message

openmdao.core.checks.check_connections(connections, params_dict, unknowns_dict, to_prom_name)[source]

Checks the specified connections to make sure they are valid in OpenMDAO.

Args:

params_dict : dict

A dictionary mapping absolute var name to its metadata for every param in the model.

unknowns_dict : dict

A dictionary mapping absolute var name to its metadata for every unknown in the model.

to_prom_name : dict

A dictionary mapping absolute var name to promoted var name.

Raises:

ConnectError

Any invalidity in the connection raises an error.