paroto.viz.hierarchy#
Hierarchy extraction from OpenMDAO problems.
This module extracts parameter hierarchy by analyzing the data flow through an OpenMDAO Problem. It assigns hierarchy levels automatically based on dependencies.
Functions#
|
Extract parameter hierarchy from an OpenMDAO Problem. |
|
Simplify hierarchy by removing intermediate variables and grouping by subsystems. |
Module Contents#
- paroto.viz.hierarchy.extract_hierarchy(prob, primary_params, constraint_names=None)#
Extract parameter hierarchy from an OpenMDAO Problem.
Analyzes the connection structure of an OpenMDAO problem to determine which parameters are primary (design variables), secondary (outputs of models consuming primary parameters), and so on.
- Parameters:
prob (
openmdao.api.Problem) – Configured OpenMDAO problem (should call setup() called)primary_params (
listofstr) – List of primary parameter names (design variables) These can be partial names that will be matchedconstraint_names (
listofstr, optional) – List of constraint output names. If None, attempts to detect constraints
- Returns:
Graph abstraction with nodes, edges, and hierarchy levels
- Return type:
ProblemGraph
Notes
Hierarchy levels: - Level 0: Primary parameters (user-specified design variables) - Level N: Parameters/outputs that depend only on levels 0 through N-1 - Constraints are assigned their own level based on dependencies
- paroto.viz.hierarchy.simplify_hierarchy(graph, include_constraints=True, max_level=None)#
Simplify hierarchy by removing intermediate variables and grouping by subsystems.
- Parameters:
- Returns:
Simplified hierarchy with: - ‘parameters’: list of primary parameter names - ‘models’: list of model/subsystem names - ‘constraints’: list of constraint names - ‘connections’: list of (source, target) tuples
- Return type: