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.1

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.1
File Size Uploaded Provenance Actions
gemseo_gantry-0.1.1.tar.gz 52.2 kB With provenance Details for gemseo_gantry-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 128.8 kB

Release files / gemseo_gantry-0.1.1.tar.gz

Download URL gemseo_gantry-0.1.1.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
06ff43c5ab0ec4d0fd8e940e7a919480c9c8e6119b445bfbaee79d68e8c43ebf
BLAKE2b-256 checksum
How to use checksums
78266e5643091c8a052b7d8b73aef90605992db7462cfc46c77beb5f0082c0fa
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 18, 2026.

Transparency log

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

Download URL gemseo_gantry-0.1.1-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa6ed8a9c3b60b77679d5ea7330f5505f6f0553c72c7feb5281cea5b266b6bb
BLAKE2b-256 checksum
How to use checksums
be376a2c4e23b974fdd6b415f3a54952d71b85593673641b8396abd511dfd0f8
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 18, 2026.

Transparency log

Security for gemseo-gantry 0.1.1

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.1.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 18, 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