Skip to main content

An extra wrapper for the GMAT Python API to simplify setting up mission simulations.

Project description

gmatpyplus

An extra wrapper library for the GMAT Python API to simplify setting up mission simulations. The wrapper aims to align Python commands with GMAT script ones, greatly reducing the number of lines required to model a mission. To do this, it automatically creates relevant subclasses and sets default values, while still allowing the user full control over parameters if they need something specific. The aim is to reduce the time that the user needs to spend thinking about how the API works, so they can instead focus on the orbital mechanics and broader design of their particular mission.

Due to the library's extensive use of classes and methods rather than strings, it also supports full code completion. It has been designed to be as intuitive as possible for the user, while still closely matching GMAT's design philosophy.

Compatibility

The library itself should be compatible with Python 3.9 to 3.14. If you find any incompatibilities, please raise an issue. However, out of the box, GMAT R2025a supports only Python 3.9 to 3.12. This means that without adding extra plugins to your GMAT install, this library can only be used with Python 3.9 to 3.12. You can find the required plugins and instructions on how to install them in the plugins directory. Only plugins for Windows are currently provided, so for use on Linux/Mac with non-default Python versions, you will have to compile the plugins yourself. Plugins for Linux/Mac will be added in a future release.

Getting Started

You can install this library with pip install gmatpyplus.

Then in your Python scripts, import the library:

import gmatpyplus as gp

gp is the recommended abbreviation as is used throughout this documentation.

Specifying GMAT path

For this library to be able to communicate with GMAT, you will also need to specify the path that GMAT is installed in. You can do this either using an environment variable or in a configuration file. As an example, we'll assume that your path to GMAT is C:\Users\joebloggs\Desktop\GMAT\gmat-win-R2025a on Windows, or /home/joebloggs/Desktop/GMAT/gmat-win-R2025a on Linux or macOS.

Environment variable

Create an environment variable called "GMAT" with its value set to the path to the GMAT folder.

Windows You can set the environment variable as either a user variable or system variable - we recommend a user variable.

To set it, open the Start menu, start typing "environment" and click the option for Edit the system environment variables (shown below).

Edit the system environment variables option in Start menu

A window will appear: click the Environment Variables... button at the bottom. Then, either under the user variables section at the top, or system variables section at the bottom, click New... to specify a new variable. Then enter "GMAT" as the name and your path to GMAT's root folder as the value.

"Edit User Variable" window

Linux On Linux, to set the environment variable for just your current session, run the following in the command line:
export GMAT="/path/to/GMAT"

For our example path, this would be:

export GMAT="/home/joebloggs/Desktop/GMAT/gmat-win-R2025a"

To set the variable permanently, add the line above to your ~/.bash_profile or ~/.bashrc file.

Examples

The examples directory gives several example scripts that demonstrate the power of this library (and GMAT generally). GMAT has several tutorials built-in, supplied in its [GMAT root]/samples folder. The scripts in examples/tutorials have exactly the same functionality as these, but have been written using this library rather than GMAT's standard Python API or its scripting language. Tutorials 1 to 4 are currently implemented, with the rest planned to be added in future once the library has the required features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmatpyplus-0.10.2-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file gmatpyplus-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: gmatpyplus-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for gmatpyplus-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecf95bccc47fcd4b43cccc4f0b383e323f3e5feef3d0c3545f0dfaed40757f90
MD5 eeadd438e3c97dd3df70b115838bc9fa
BLAKE2b-256 47d4c18917b76e3050261ce3cae0b3bcf4edf983dea48c9b5720083a8a4c8af2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page