Skip to main content

GraphMDO: Dynamic Multi-Fidelity MDO Framework

Python Version PyPI version Quality Checks Security Scan Deploy Documentation codecov

GraphMDO bridges data engineering and MDO. It extracts topological data (solvers, variables, fidelity levels) to form an oriented graph, specifically utilizing GEMSEO for semantic formulation and execution. Execution is handled natively by GEMSEO and the Surrogate Modeling Toolbox (SMT), with optimization workflows currently centered on constrained Bayesian optimization (ax-platform) and DOE exploration through GEMSEO. The framework supports single- and multi-objective optimization over graph-derived design variables with explicit inequality constraints.

Key Features

  • Native Graph Formulation: Uses FalkorDB to store problem definitions (variables, tools, dependencies) as a property graph.
  • Dynamic Problem Construction: Automatically translates the graph topology into an executable GEMSEO MDO formulation.
  • Typed Study Contract: A Pydantic StudySchema (with a published JSON Schema) describes the study, and validate_study() reports every problem with a stable code before any tool runs.
  • Multi-Fidelity Surrogates: Integrates SMT for Co-Kriging and other surrogate models.
  • Constrained Bayesian Optimization: Leverages Ax Platform for robust optimization, supporting GEMSEO objectives, inequality constraints, and mixed discrete/continuous parameters.

Project Architecture

The framework is divided into four sequential phases, each corresponding to a layer of abstraction:

  1. Graph Layer — FalkorDB stores the Fundamental Problem Graph (FPG): typed variables, tools, and directed connections.
  2. Core Layer — Python modules read the graph as a typed StudySchema, validate it, and translate it into executable GEMSEO constructs (disciplines, design space, topology).
  3. Execution Service — A FastAPI microservice that manages a pool of GEMSEO OptimizationProblem instances and exposes an HTTP evaluation endpoint.
  4. Optimization Layer — Bayesian (Ax Platform) or DOE (GEMSEO Sobol) drivers run over the GEMSEO MDO scenario.

The StudySchema (mdo_framework.schema) is the contract between the layers: variables are RangeVar, ChoiceVar, FixedParam or StateVar, and invalid studies are reported by validate_study() before any tool runs. See the Study Schema reference.

flowchart TD
    subgraph USER["👤 User"]
        U1["Define Variables\n& Tools"]
        U2["Provide Tool\nCallables / Registry"]
        U3["Read Results"]
    end

    subgraph GRAPH["🗄️ Graph Layer — FalkorDB"]
        G1["GraphManager\n(graph_manager.py)"]
        G2[("FalkorDB\nProperty Graph\nFPG")]
        G3["FalkorDB Client\n(client.py)"]
        G1 -- "add_variable / add_tool\nconnect_input_to_tool" --> G2
        G3 -- "Cypher queries" --> G2
        G1 -- uses --> G3
    end

    subgraph CORE["⚙️ Core Layer — mdo_framework.core"]
        C1["TopologicalAnalyzer\n(topology.py)\nresolve_dependencies()"]
        C2["GraphProblemBuilder\n(translator.py)\nbuild_problem()"]
        C3["GemseoComponent\n(components.py)\nGEMSEO Discipline wrapper"]
        C4["SurrogateComponent\n(surrogates.py)\nSMT Co-Kriging"]
        C5["LocalEvaluator\n(evaluators.py)"]
        C6["StudySchema + validate_study()\n(schema.py, validation.py)"]
        C6 --> C1
        C6 --> C2
        C2 --> C3
        C2 --> C4
        C3 --> C5
    end

    subgraph GEMSEO["📐 GEMSEO MDO Engine"]
        GS1["DesignSpace"]
        GS2["MDOScenario / DOEScenario"]
        GS3["OptimizationProblem"]
        GS2 --> GS3
        GS1 --> GS2
    end

    subgraph OPT["🔬 Optimization Layer — mdo_framework.optimization"]
        O1["BayesianOptimizer\n(optimizer.py)"]
        O2["AxOptimizationLibrary\n(ax_algo_lib.py)\nCustom GEMSEO Algorithm"]
        O3["Ax Client\n(ax-platform)"]
        O4["DOE Explore\nSobol sampler"]
        O1 --> O2
        O1 --> O4
        O2 --> O3
        O3 -- "suggest_next_trials()" --> O2
        O2 -- "complete_trial() / mark_failed()" --> O3
    end

    subgraph SVC["🌐 Execution Service — services.execution"]
        S1["FastAPI App\n(main.py)"]
        S2["SchemaProvider\n(schema cache + TTL)"]
        S3["ProblemPool\n(GEMSEO problem pool)"]
        S4["/evaluate endpoint"]
        S5["/health endpoint"]
        S1 --> S2
        S1 --> S3
        S1 --> S4
        S1 --> S5
        S4 --> S3
    end

    %% Cross-layer data flow
    U1 --> G1
    U2 --> C2
    G2 -- "get_study_schema()" --> C6
    C1 -- "design parameters\n& bounds" --> O1
    C5 --> GS3
    GS1 --> O1
    GS3 --> O2
    O2 -- "evaluate_functions(x)" --> GS3
    O3 -- "best_parameterization" --> O1
    O1 --> U3

    %% Remote path
    O1 -. "RemoteEvaluator\n(HTTP /evaluate)" .-> S4
    S3 -. "GEMSEO problem\ninstance" .-> S4

    style USER fill:#1e293b,stroke:#64748b,color:#f1f5f9
    style GRAPH fill:#0f172a,stroke:#3b82f6,color:#bfdbfe
    style CORE fill:#0f172a,stroke:#8b5cf6,color:#ddd6fe
    style GEMSEO fill:#0f172a,stroke:#06b6d4,color:#a5f3fc
    style OPT fill:#0f172a,stroke:#f59e0b,color:#fef3c7
    style SVC fill:#0f172a,stroke:#10b981,color:#a7f3d0

Installation

This project uses uv for dependency management.

  1. Install uv (if not installed): See astral.sh/uv.

  2. Clone and Install:

    git clone https://github.com/jultou-raa/GraphMDO.git
    cd GraphMDO
    uv sync
    
  3. FalkorDB: Ensure you have a running FalkorDB instance (e.g., via Docker):

    docker run -p 6379:6379 -it falkordb/falkordb
    

Usage

1. Defining a Problem (Python API)

You can programmatically build your MDO problem graph. Variables are typed models from mdo_framework.schema: RangeVar (bounded design variable), ChoiceVar, FixedParam and StateVar (a value computed by a tool).

from mdo_framework.db.graph_manager import GraphManager
from mdo_framework.schema import RangeVar, StateVar, ToolNode

gm = GraphManager()
gm.clear_graph()

# Define Variables
gm.add_variable(RangeVar(name="x", lower=0.0, upper=10.0))
gm.add_variable(RangeVar(name="y", lower=0.0, upper=10.0))
gm.add_variable(StateVar(name="z"))

# Define Tool
gm.add_tool(ToolNode(name="MyTool"))

# Define Connections
gm.connect_input_to_tool("x", "MyTool")
gm.connect_input_to_tool("y", "MyTool")
gm.connect_tool_to_output("MyTool", "z")

Nodes stored without a kind by earlier versions are rejected with a LEGACY_NODE error: delete and recreate them with the typed API.

2. Running Optimization

Once the graph is populated, you can run the optimization workflow. You need to provide the actual Python functions corresponding to the tool names in the graph.

from mdo_framework.core.translator import GraphProblemBuilder
from mdo_framework.optimization.optimizer import BayesianOptimizer
from mdo_framework.core.evaluators import LocalEvaluator
from mdo_framework.core.topology import TopologicalAnalyzer
from mdo_framework.schema import ObjectiveSpec
from mdo_framework.validation import validate_study

# Define tool implementation
def my_tool_func(x, y):
    return x + y  # Simple example

# Registry maps graph tool names to Python callables
tool_registry = {
    "MyTool": my_tool_func
}

# Read the graph as a typed StudySchema and check it before running
schema = gm.get_study_schema()
report = validate_study(
    schema, objectives=[ObjectiveSpec(name="z")], registry=tool_registry
)
assert report.valid, report.errors

# Build GEMSEO Problem from the schema
builder = GraphProblemBuilder(schema)
prob = builder.build_problem(tool_registry)

# Resolve Topology mapping design variables automatically from the schema
analyzer = TopologicalAnalyzer(schema)
resolved = analyzer.resolve_dependencies(["z"])

# Run Optimization
evaluator = LocalEvaluator(prob, builder.variable_specs)
optimizer = BayesianOptimizer(
    evaluator,
    resolved.design_variables,
    [ObjectiveSpec(name="z")],
)

# 5 Sobol trials (n_init) + 10 Bayesian iterations (n_steps) = 15 evaluations,
# plus the start point x0 when evaluate_x0=True
result = optimizer.optimize(n_steps=10, n_init=5)
print(f"Best Result: {result['best_objectives']} at {result['best_parameters']}")
print(f"Stopped because: {result['stop_reason']}, feasible: {result['feasible']}")
print(f"Trial History: {result['history']}")

3. Running Tests

uv run pytest tests/                           # everything
uv run pytest -m "not e2e" tests/              # fast unit tests
OMP_NUM_THREADS=1 uv run pytest -m e2e tests/  # real Ax + GEMSEO runs (tests/e2e/)

Tests that pin an open bug are marked xfail(strict=True) with the issue number in the reason. The PR that fixes the bug removes the marker.

Contributing

  1. Follow PEP 8 guidelines.
  2. Ensure 100% test coverage for new features.
  3. Use uv run pre-commit run --all-files before committing.

License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0). See the LICENSE file for details.

Metadata

Release files for graphmdo 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphmdo 2.0.0
File Size Uploaded
graphmdo-2.0.0.tar.gz 341.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphmdo 2.0.0
File Interpreter ABI Platform
graphmdo-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 447.0 kB

Release files / graphmdo-2.0.0.tar.gz

Download URL graphmdo-2.0.0.tar.gz
Size 341.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c2831d1822d7fd0cfafff83428c1284d38e1515c98f10b984b127894ce6a1594
BLAKE2b-256 checksum
How to use checksums
b29f8e8d756cfd68b283aa97e0e923413909a0224a252c1acddae7f41eed5b9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / graphmdo-2.0.0-py3-none-any.whl

Download URL graphmdo-2.0.0-py3-none-any.whl
Size 106.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd77833e9cfee71fd17e23df9a31c29d739855a6ea509f6adbe36c16daf2318b
BLAKE2b-256 checksum
How to use checksums
e0c9d7fce16ecc5ee8bbf8f96f7d8e95d78c3def15048b39d236043bece8bb47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page