paroto.viz.problem_graph#
Problem graph abstraction for OpenMDAO visualization.
This module provides a unified graph representation that can be consumed by different visualization backends (Mermaid, Cytoscape, NetworkX, etc.). Uses OpenMDAO’s connection model as the foundation.
Attributes#
Classes#
Unified graph abstraction for OpenMDAO Problem visualization. |
Module Contents#
- paroto.viz.problem_graph.DEFAULT_CONSTRAINT_MARKERS = ['margin', 'constraint', 'satisfied', 'error']#
- paroto.viz.problem_graph.UNCONNECTED_LEVEL = -1#
- paroto.viz.problem_graph.PRIMARY_LEVEL = 0#
- class paroto.viz.problem_graph.ProblemGraph(prob, primary_params=None, constraint_markers=None)#
Unified graph abstraction for OpenMDAO Problem visualization.
This class wraps an OpenMDAO Problem and provides a clean, unified interface for extracting graph structure that can be consumed by any visualization backend.
- Parameters:
prob (
openmdao.api.Problem) – OpenMDAO problem (must have setup() called)primary_params (
listofstr, optional) – List of primary parameter names (design variables). Can be partial names that will be matchedconstraint_markers (
listofstr, optional) – Keywords to identify constraint variables (e.g., [‘margin’, ‘constraint’])
- nodes#
Mapping of node_id -> node attributes (type, level, units, value, label, subsystem)
- Type:
- prob#
- model#
- get_nodes_by_level(max_level=None)#
Get nodes organized by hierarchy level.
- get_nodes_by_subsystem()#
Get nodes organized by subsystem.
- Returns:
Mapping of subsystem_name -> list of node_ids
- Return type:
- get_nodes_by_type()#
Get nodes organized by type.
- Returns:
Mapping of node_type -> list of node_ids
- Return type:
- filter_by_level(max_level)#
Get filtered view with nodes up to max_level.