fastoad.openmdao.utils module

Utility functions for OpenMDAO classes/instances

fastoad.openmdao.utils.get_problem_after_setup(problem: T) → T[source]

Returns a copy of the provided problem, where setup() has been run on the copy.

Warning

problem.setup() must NOT have been run.

This method should be used when an operation is needed that requires setup() to be run, without having the problem being actually setup.

Parameters

problem

Returns

the problem itself if setup() has already been run, or a copy of the provided problem after setup() has been run

fastoad.openmdao.utils.get_unconnected_input_names(problem: openmdao.core.problem.Problem, promoted_names=False) → Tuple[List[str], List[str]][source]

For provided OpenMDAO problem, looks for inputs that are connected to no output.

Warning

problem.setup() must have been run.

Inputs that have numpy.nan as default value are considered as mandatory. Other ones are considered as optional.

Parameters
  • problem – OpenMDAO Problem or System instance to inspect

  • promoted_names – if True, promoted names will be returned instead of absolute ones

Returns

tuple(list of missing mandatory inputs, list of missing optional inputs)