Skip to main content

SmartMDAO

Coupled pipelines of plain Python functions — converged, and checked before they run.

CI PyPI version Python versions License: MIT

Write each discipline as a function. SmartMDAO wires them by parameter name, finds the feedback loops, converges them, and tells you what a run would do — and what is wrong with it — without running anything. Built for multidisciplinary design analysis and optimization (MDAO), and for any workflow whose steps feed each other.

Sellar coupling workflow

In one example

Without SmartMDAO, you write the convergence loop and track the state yourself:

y2 = 1.0  # initial guess
for _ in range(100):
    y1 = z1 ** 2 + z2 + x1 - 0.2 * y2
    y2_next = math.sqrt(abs(y1)) + z1 + z2
    if abs(y2_next - y2) < 1e-6:
        break
    y2 = y2_next

With SmartMDAO, you declare each discipline once; the y1 ↔ y2 loop is found and converged:

import math
from smartmdao import Pipeline, HybridSolver

pipeline = Pipeline(solver=HybridSolver())

@pipeline.step(outputs=["y1"])
def discipline_1(z1, z2, x1, y2): return z1 ** 2 + z2 + x1 - 0.2 * y2

@pipeline.step(outputs=["y2"])
def discipline_2(z1, z2, y1): return math.sqrt(abs(y1)) + z1 + z2

result = pipeline.run(z1=1.0, z2=1.0, x1=1.0, y2=1.0)
result["convergence_reports"][0].status      # 'converged'

And before running it, ask what it would do:

from smartmdao import analyze, validate

analyze(pipeline, inputs=["z1", "z2", "x1"]).cycles[0].feedback_variables   # ('y1', 'y2')
validate(pipeline, inputs=["z1", "z2", "x1"])
# ERROR: 'discipline_1' consumes 'y2' before anything produces it ... Pass y2=... to run().

No discipline was called to find that out.

What makes it different

Checked before it runs analyze() and validate() read signatures and the graph: order, loops, the variable that needs a starting value, every structural problem at once. Free, because nothing executes.
Converges on more than numbers A coupling variable can be a set, a dataclass or a whole architecture; anything with == converges on structural equality.
Disciplines can be rules A reviewed .lp file becomes a discipline. "No feasible design" becomes a proof, with the minimal set of conflicting requirements.
Says what a run will cost One sweep proves the model runs and measures the unit cost, so you are quoted a number before a long run.
Knows when a step touches the world A step that writes a file or calls an API is declared; repeating it inside a loop is refused before anything runs.
Reports what happened Every loop returns a report — converged, exhausted, or abandoned — with the reason and the residual trace.
No ceremony No component classes, no problem description files. A discipline is a function.

The principle behind all of it: surface the consequences before you commit to them, and never let a default quietly decide the answer (design record 003).

Install

pip install smartmdao              # or: uv add smartmdao
pip install "smartmdao[mcp]"       # the MCP server, for coding agents
pip install "smartmdao[asp]"       # rule-backed disciplines (clingo)
pip install "smartmdao[openturns]" # the OpenTURNS optimizer backend

Diagrams are drawn with matplotlib; no system packages are needed.

For coding agents

smartmdao-mcp is an MCP server. It lets an agent check the pipelines it writes instead of guessing: analyze_pipeline, validate_pipeline, explain_pipeline and render_pipeline_diagram read the code without executing it. run_pipeline runs it in a child process under a wall clock, one sweep by default. compare_runs proves a refactor did not change the answer. Each file is handled in its own project's environment, so one server serves projects with different dependencies. smartmdao_cookbook gives the agent the real API before it writes a line. Setup: testing guide, step 6.

Learn more

Contributing

Contributions are welcome. Read docs/handoff.md first: it defines what "done" means here — docs updated, 100% coverage, something that teaches the change, and every script green. MIT licensed; see LICENSE.

Metadata

Release files for SmartMDAO 1.28.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 SmartMDAO 1.28.0
File Size Uploaded Provenance Actions
smartmdao-1.28.0.tar.gz 927.3 kB With provenance Details for smartmdao-1.28.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SmartMDAO 1.28.0
File Interpreter ABI Platform Actions
smartmdao-1.28.0-py3-none-any.whl Python 3 none any Details for smartmdao-1.28.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / smartmdao-1.28.0.tar.gz

Download URL smartmdao-1.28.0.tar.gz
Size 927.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e32bb46b01f63e0114a6e2e5879827e6605e58454cf7942318b83c615f9451c5
BLAKE2b-256 checksum
How to use checksums
41ba9d4b2acea7bb578532f359669b72940a43d7ddff661d1c1bc3a4e65aeb5c
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 Sep 27, 2026.

Transparency log

Release files / smartmdao-1.28.0-py3-none-any.whl

Download URL smartmdao-1.28.0-py3-none-any.whl
Size 129.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12c3388cf47cb71fb194ebb3e751f144b2569c9aa8f740a55aae1f827d512c63
BLAKE2b-256 checksum
How to use checksums
f3f88707c14ca6a60e09812a5af1586b550ce3304fbd139ed33b4c7bf6f15299
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 Sep 27, 2026.

Transparency log

Security for SmartMDAO 1.28.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for smartmdao-1.28.0.tar.gz

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 Sep 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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