Skip to main content

gemseo-gantry

CI PyPI Python GEMSEO License Ruff uv basedpyright

Generate GEMSEO glue code for MDAO problems from a TOML problem definition.

gemseo-gantry takes one diffable TOML file describing your problem and generates the GEMSEO boilerplate you'd otherwise write by hand: typed I/O dataclasses, grammars, a design space, a variables enum, discipline base classes and scenario construction. The TOML is the source of truth. When the problem changes you regenerate, and your type checker points at the hand-written code that needs updating.

Features

  • One source of truth. Variables, disciplines and scenarios all live in one TOML file. Variable roles such as design variable or coupling are inferred, so you don't declare them twice.
  • Safe regeneration. gantry build rebuilds a disposable lib/ package. gantry scaffold writes your discipline and executor files once and never touches them again.
  • The type checker does the reconciling. Rename or split a variable and rebuild. Code of yours that no longer matches shows up as a type or import error right where it needs changing.
  • Fast feedback. gantry validate --watch re-checks the problem every time you save. A generated JSON Schema gives you autocomplete and validation in TOML-aware editors.
  • Diagrams. N2 and XDSM views of the coupling topology, drawn straight from the TOML.
  • Scriptable. Every command takes --json for machine-readable output.

Installation

uv tool install gemseo-gantry

This puts the gantry command on your path.

Quickstart

To see the whole pipeline, generate the Sellar example. It's a classic benchmark, and you get a complete project you can run:

gantry example sellar      # add --explain to narrate each stage

Or start your own problem:

gantry init                # 1. write a starter problem.toml (plus its JSON Schema)
gantry validate --watch    # 2. edit problem.toml with live feedback (q/Esc to stop)
gantry build               # 3. generate the disposable lib/ package
gantry scaffold            # 4. write your discipline stubs and scenario executor, once

Then fill in the physics. A scaffolded discipline is a thin subclass of a generated base class and works with typed inputs and outputs:

from lib.Drag_base import DragBase
from lib.Drag_io import DragInputs, DragOutputs


class Drag(DragBase):
    def _run(self, input_data):
        inputs = DragInputs.from_dict(input_data)
        duty_cycle = ...  # your physics, using inputs.h, inputs.Cd, ...
        return DragOutputs(duty_cycle=duty_cycle)

Running the generated code

gantry writes files. It doesn't run your analysis. The generated execute_<Scenario>.py and your disciplines are plain Python that import GEMSEO, so run them in a project that has GEMSEO and whatever else your physics code needs:

uv add "gemseo>=6.3"
uv run execute_<Scenario>.py

You manage that environment yourself, and it's separate from the one gantry is installed in. The generated code needs GEMSEO 6.3 or later, not the exact version gantry happens to use.

How it works

gantry has two commands that generate code, and they treat existing files in opposite ways:

flowchart LR
    toml["problem.toml<br/>(source of truth)"]
    lib["lib/<br/>(regenerated on every build)"]
    yours["disciplines/, execute_*.py<br/>(yours, written once)"]
    toml -->|gantry build| lib
    toml -->|gantry scaffold| yours
    yours -.->|imports| lib
  • build wipes and rewrites lib/ every time. Nothing hand-written ever lives in lib/, so this is safe, and files left over from a rename get cleaned up.
  • scaffold writes starter files into your tree and won't overwrite them. Once they're written, they're yours.

When the TOML changes, re-run build. There's no three-way merge. Anything in your code that no longer matches the problem shows up as a type or import error.

Documentation

  • Concepts: how build and scaffold divide the work, the edit-and-rebuild loop, and what a generated project looks like.
  • Problem definition: the TOML format and how to get validation in your editor.
  • CLI reference: every command and its options.

Contributing

Contributions are welcome. See CONTRIBUTING.md for the development setup and conventions.

License

gemseo-gantry is released under the MIT License.

Metadata

Release files for gemseo-gantry 0.1.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 gemseo-gantry 0.1.0
File Size Uploaded Provenance Actions
gemseo_gantry-0.1.0.tar.gz 51.8 kB With provenance Details for gemseo_gantry-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gemseo-gantry 0.1.0
File Interpreter ABI Platform Actions
gemseo_gantry-0.1.0-py3-none-any.whl Python 3 none any Details for gemseo_gantry-0.1.0-py3-none-any.whl

Total release size: 127.9 kB

Release files / gemseo_gantry-0.1.0.tar.gz

Download URL gemseo_gantry-0.1.0.tar.gz
Size 51.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6c581bef3b7250fe1b096657ea99afcafde89885c9b6134e2494e25ae14f023e
BLAKE2b-256 checksum
How to use checksums
bafb4e265203ac033ace567abcc0f52b357ed79cb6281ffc9af7ee8d5f99ada9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / gemseo_gantry-0.1.0-py3-none-any.whl

Download URL gemseo_gantry-0.1.0-py3-none-any.whl
Size 76.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff3da6be33cca5a5549bd8b674ce70048ff9179e2bc3e866f5a5916b70f2be2b
BLAKE2b-256 checksum
How to use checksums
55f6c180c147e2fe522a3ac1726ccd9747c12a536d36b0793ecd0e68638a1c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for gemseo-gantry 0.1.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 gemseo_gantry-0.1.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 Nov 17, 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