{"id":49652392,"url":"https://github.com/astro-tools/gmat-sweep","last_synced_at":"2026-05-09T08:01:53.639Z","repository":{"id":355497896,"uuid":"1228295145","full_name":"astro-tools/gmat-sweep","owner":"astro-tools","description":"Run parameter sweeps and Monte Carlo dispersions over GMAT missions in parallel from Python.","archived":false,"fork":false,"pushed_at":"2026-05-03T22:06:29.000Z","size":301,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T00:14:54.111Z","etag":null,"topics":["aerospace","astrodynamics","dask","gmat","gmatpy","joblib","mission-analysis","monte-carlo","nasa-gmat","pandas","parallel","parameter-sweep","python","ray","reproducibility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astro-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-03T21:04:52.000Z","updated_at":"2026-05-03T22:06:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/astro-tools/gmat-sweep","commit_stats":null,"previous_names":["astro-tools/gmat-sweep"],"tags_count":null,"template":false,"template_full_name":"astro-tools/.repo-template","purl":"pkg:github/astro-tools/gmat-sweep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-tools%2Fgmat-sweep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-tools%2Fgmat-sweep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-tools%2Fgmat-sweep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-tools%2Fgmat-sweep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro-tools","download_url":"https://codeload.github.com/astro-tools/gmat-sweep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-tools%2Fgmat-sweep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32679444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aerospace","astrodynamics","dask","gmat","gmatpy","joblib","mission-analysis","monte-carlo","nasa-gmat","pandas","parallel","parameter-sweep","python","ray","reproducibility"],"created_at":"2026-05-06T05:01:00.701Z","updated_at":"2026-05-06T05:01:33.046Z","avatar_url":"https://github.com/astro-tools.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gmat-sweep\n\n[![CI](https://github.com/astro-tools/gmat-sweep/actions/workflows/ci.yml/badge.svg)](https://github.com/astro-tools/gmat-sweep/actions/workflows/ci.yml)\n[![Docs](https://github.com/astro-tools/gmat-sweep/actions/workflows/docs.yml/badge.svg)](https://astro-tools.github.io/gmat-sweep/)\n[![PyPI](https://img.shields.io/pypi/v/gmat-sweep.svg)](https://pypi.org/project/gmat-sweep/)\n[![Python versions](https://img.shields.io/pypi/pyversions/gmat-sweep.svg)](https://pypi.org/project/gmat-sweep/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nRun parameter sweeps and Monte Carlo dispersions over GMAT missions in parallel from Python.\n\n## What this is\n\nA parallel orchestrator on top of [`gmat-run`](https://github.com/astro-tools/gmat-run)'s\nsingle-run primitive. Point `gmat-sweep` at a working `.script` and either a parameter\ngrid, an explicit run table, or a perturbation distribution, and it fans the run set\nacross subprocess workers, aggregates each run's `ReportFile` (and any `EphemerisFile`\nor `ContactLocator` outputs) into multi-indexed pandas DataFrames, and writes a JSON\nLines manifest alongside the results so any sweep is reproducible bit-for-bit. Killed\nsweeps reload from the manifest and re-run only the missing or failed runs.\n\nThe four entry points cover the common shapes:\n\n- [`sweep(grid=...)`](https://astro-tools.github.io/gmat-sweep/parameter-spec/#full-factorial-expansion)\n  — full-factorial grid over one or more dotted-path fields.\n- [`sweep(samples=DataFrame)`](https://astro-tools.github.io/gmat-sweep/parameter-spec/#explicit-row-sweeps)\n  — explicit-row sweep where you pre-build the run set (Halton, Sobol, custom design).\n- [`monte_carlo(perturb=...)`](https://astro-tools.github.io/gmat-sweep/monte-carlo/)\n  — stochastic dispersion with named distributions and a deterministic seed contract.\n- [`latin_hypercube(perturb=...)`](https://astro-tools.github.io/gmat-sweep/parameter-spec/#monte-carlo-vs-latin-hypercube)\n  — stratified sampling for variance reduction at small `n`.\n\n## What this is not\n\n- **Not** a single-run runner — that's [`gmat-run`](https://github.com/astro-tools/gmat-run);\n  every `gmat-sweep` worker calls into it.\n- **Not** a way to build GMAT missions from scratch in Python — see\n  [`gmatpyplus`](https://github.com/weasdown/gmatpyplus).\n- **Not** a `.script` text generator — see [`pygmat`](https://pypi.org/project/pygmat/).\n- **Not** an optimiser. Gradient-, Bayesian-, and population-based optimisation\n  (CasADi, pagmo2, scikit-optimize) is a different problem; `gmat-sweep` may serve as the\n  parallel evaluator inside one, but it ships no optimiser of its own.\n- **Not** a distributed cluster runner yet. The default `LocalJoblibPool` saturates one\n  machine; `DaskPool` and `RayPool` for multi-machine sweeps are scoped for v0.3.\n\n## Requirements\n\n- Python 3.10, 3.11, or 3.12.\n- [`gmat-run`](https://github.com/astro-tools/gmat-run) ≥ 0.3 — installed as a transitive\n  dependency from PyPI. `gmat-sweep` never imports `gmatpy` directly; the import happens\n  inside each worker subprocess on first call.\n- A local GMAT install. `gmat-sweep` does not ship GMAT binaries; it relies on `gmat-run`'s\n  install discovery, which honours `$GMAT_ROOT` or finds a build under a conventional path.\n  Download GMAT from the\n  [SourceForge release page](https://sourceforge.net/projects/gmat/files/GMAT/) — see\n  [`gmat-run`'s install guide](https://astro-tools.github.io/gmat-run/install-gmat/) for the\n  unpack-and-discover steps.\n\n### Supported GMAT versions\n\n| GMAT release | Status | CI |\n|---|---|---|\n| R2026a | Primary development target | Exercised on every PR (Ubuntu + Windows + macOS, Python 3.10/3.11/3.12) |\n| R2025a | Supported | Exercised on every PR (Ubuntu + Windows + macOS, Python 3.10/3.11/3.12) |\n\nR2023a and R2024a were never released by the upstream GMAT project; R2025a and R2026a are\nthe only releases supported.\n\n## Installation\n\n```bash\npip install gmat-sweep\n```\n\nThe `[examples]` extra pulls in matplotlib for the example notebooks:\n\n```bash\npip install gmat-sweep[examples]\n```\n\n## Quick start\n\n```python\nfrom gmat_sweep import sweep\n\ndf = sweep(\n    \"mission.script\",\n    grid={\"Sat.SMA\": [7000, 7100, 7200]},\n    workers=8,\n)\nprint(df)\n```\n\nThat call runs `mission.script` three times — once per `Sat.SMA` value — each in a fresh\nsubprocess, and returns a `(run_id, time)`-MultiIndexed `pandas.DataFrame` containing\nthe rows from every run's `ReportFile` plus a `__status` column flagging\n`ok` / `failed` / `skipped`. A single failed run lands as a `failed` row with the captured\nGMAT stderr in the manifest — never as a silent zero-row DataFrame and never as an\nunhandled exception that aborts the whole sweep.\n\nFor a stochastic dispersion, swap [`sweep`](https://astro-tools.github.io/gmat-sweep/api/#gmat_sweep.sweep)\nfor [`monte_carlo`](https://astro-tools.github.io/gmat-sweep/monte-carlo/) and pass a\n`perturb` mapping of named distributions:\n\n```python\nfrom gmat_sweep import monte_carlo\n\ndf = monte_carlo(\n    \"mission.script\",\n    n=1000,\n    perturb={\"Sat.SMA\": (\"normal\", 7100.0, 50.0)},\n    workers=8,\n    seed=42,\n)\n```\n\nReturns the same DataFrame shape as `sweep()`. Per-run sub-seeds derive from `seed` via\n`numpy.random.SeedSequence.spawn`, so the draw is bit-reproducible and a resumed sweep\nsamples the same values for any given `run_id`. See the\n[Monte Carlo guide](https://astro-tools.github.io/gmat-sweep/monte-carlo/) for the full\ndeterminism contract and [`latin_hypercube`](https://astro-tools.github.io/gmat-sweep/parameter-spec/#monte-carlo-vs-latin-hypercube)\nfor the stratified-sampling variant.\n\nBy default the per-run Parquet files and the manifest land in a temporary directory\nwhose lifetime is tied to the returned DataFrame. Pass `out=Path(...)` to keep them —\nthat's also what enables [resuming a killed sweep](https://astro-tools.github.io/gmat-sweep/resume/)\nvia `Sweep.from_manifest(...).resume()` or `gmat-sweep resume \u003cmanifest\u003e`.\n\nA `gmat-sweep` console script is also installed for shell-script and CI use:\n\n```bash\ngmat-sweep run         --grid Sat.SMA=7000:7200:3 --workers 8 --out ./sweep mission.script\ngmat-sweep monte-carlo --n 1000 --perturb 'Sat.SMA=normal:7100:50' --seed 42 --out ./mc mission.script\ngmat-sweep resume      --script mission.script --workers 8 ./mc/manifest.jsonl\ngmat-sweep show        ./sweep/manifest.jsonl\n```\n\nSee the [CLI reference in the docs](https://astro-tools.github.io/gmat-sweep/cli/)\nfor every subcommand and the full mini-grammar.\n\n## Outputs\n\nEvery sweep emits two artefacts:\n\n- The returned **DataFrame** — `(run_id, time)`-MultiIndexed, one column per `ReportFile`\n  channel plus the `__status` column. Built lazily from per-run Parquet files via\n  pyarrow's dataset API, so a 10,000-run sweep does not have to fit in memory at once.\n- A **JSON Lines manifest** (`manifest.jsonl`) — append-only, fsync'd after every entry.\n  Records the canonical script SHA-256, software-version fingerprint, full parameter\n  spec, and per-run status, timing, output paths, and captured stderr. A `Ctrl-C`\n  mid-sweep leaves the manifest in a parseable state. See the\n  [manifest schema](https://astro-tools.github.io/gmat-sweep/manifest-schema/) for the\n  full contract.\n\n## Documentation\n\nFull docs at **\u003chttps://astro-tools.github.io/gmat-sweep/\u003e**, including a\n[getting-started guide](https://astro-tools.github.io/gmat-sweep/getting-started/),\nthe [parameter spec reference](https://astro-tools.github.io/gmat-sweep/parameter-spec/),\nthe [manifest schema](https://astro-tools.github.io/gmat-sweep/manifest-schema/),\nthe [supported-version matrix](https://astro-tools.github.io/gmat-sweep/supported-versions/),\nthe [FAQ](https://astro-tools.github.io/gmat-sweep/faq/),\nand the [API reference](https://astro-tools.github.io/gmat-sweep/api/).\n\nRunnable example notebooks:\n\n- [Single-axis SMA scan](https://astro-tools.github.io/gmat-sweep/examples/01_sma_scan/) —\n  fifty runs across `np.linspace(7000, 8000, 50)` of `Sat.SMA`, parallel-dispatched and\n  overlaid on a single altitude-vs-time plot.\n- [Two-axis epoch × time-of-flight grid](https://astro-tools.github.io/gmat-sweep/examples/02_epoch_arrival_grid/) —\n  cartesian product over `Sat.Epoch` and a script-level `Variable TOF`, contoured by\n  per-run miss distance.\n- [Surviving a kill](https://astro-tools.github.io/gmat-sweep/examples/03_killed_sweep_recovery/) —\n  launch a sweep, send `SIGINT` mid-run, walk through inspecting the partial manifest\n  with `gmat-sweep show`, then complete the sweep with `Sweep.from_manifest(...).resume()`.\n- [Monte Carlo dispersion](https://astro-tools.github.io/gmat-sweep/examples/04_monte_carlo_dispersion/) —\n  1000-run Monte Carlo around a nominal injection burn over a four-axis perturbation\n  cube, with arrival-miss histogram and a 3-σ covariance ellipse.\n- [Latin hypercube vs Monte Carlo](https://astro-tools.github.io/gmat-sweep/examples/05_latin_hypercube/) —\n  64-run Latin hypercube alongside a 64-run plain Monte Carlo on the same perturbation,\n  pair-plotting the unit-cube samples to make the stratification visible.\n\n## Roadmap\n\n| Release | Scope |\n|---|---|\n| **v0.2** *(current)* | `monte_carlo()` and `latin_hypercube()` plus explicit-row `samples=DataFrame` sweeps. Programmatic resume via `Sweep.from_manifest(...).resume()`. Ephemeris and contact aggregation across runs. CLI gains `monte-carlo`, `latin-hypercube`, `explicit`, and `resume` subcommands. Manifest frozen as a stable v1 schema with a documented compatibility policy. macOS added to CI. Coverage gate raised to 85%. |\n| **v0.3** *(next)* | `DaskPool` (extra `[dask]`) and `RayPool` (extra `[ray]`) for multi-machine sweeps. Cluster-recipe pages for Slurm `srun`, Kubernetes pod-per-worker, and Ray autoscaling. Benchmark page comparing backends on a 1000-run reference sweep. Throughput regression tests. `gmat-sweep show` gains a rich detail mode for inspecting per-run timing and stderr. |\n\nPast releases live in [`CHANGELOG.md`](CHANGELOG.md).\n\n## Development\n\nTo work on `gmat-sweep` itself:\n\n```bash\ngit clone https://github.com/astro-tools/gmat-sweep.git\ncd gmat-sweep\nuv sync --all-groups\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the full branch / PR / test workflow.\n\n## Licence\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro-tools%2Fgmat-sweep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro-tools%2Fgmat-sweep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro-tools%2Fgmat-sweep/lists"}