SmartMDAO
Coupled pipelines of plain Python functions — converged, and checked before they run.
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.
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
- Notebooks — one concept each, committed with their outputs so GitHub shows what every cell printed. Start here.
- Cookbook — task by task, every snippet executed by the test suite.
- Testing guide — try everything yourself, step by step.
- Scripts — runnable demos, including the full Sellar optimization.
- All documentation — architecture, roadmap, known issues and design records.
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.27.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smartmdao-1.27.0.tar.gz | 907.8 kB | With provenance | Details for smartmdao-1.27.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smartmdao-1.27.0-py3-none-any.whl | Python 3 | none | any | Details for smartmdao-1.27.0-py3-none-any.whl |
Total release size: 1.0 MB
Release files / smartmdao-1.27.0.tar.gz
| Download URL | smartmdao-1.27.0.tar.gz |
|---|---|
| Size | 907.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
334ed43f87e31719cc1ea66118d9cdf23af0377ae30b1463cbbcd64f5e9eb92b
|
|
BLAKE2b-256 checksum How to use checksums |
6000cd254d2428bdefadba239431ca34f62c56c4f82903984dc4d806b7dacf81
|
| 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 26, 2026.
Transparency logRelease files / smartmdao-1.27.0-py3-none-any.whl
| Download URL | smartmdao-1.27.0-py3-none-any.whl |
|---|---|
| Size | 123.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0bd9644c35801600e6907251791d4cb7592555e69bbe93a916a9fe97876d7266
|
|
BLAKE2b-256 checksum How to use checksums |
4662e640f6708fc811da707ef796ab3b03778754c5046a3bcdfb5738f1646348
|
| 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 26, 2026.
Transparency logSecurity for SmartMDAO 1.27.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.
Attestation for smartmdao-1.27.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 26, 2026.
Transparency logA 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.