Skip to main content

A library for creating scripts to automate MESA and GYRE runs.

Project description

Megyr Build Status Documentation Status

Megyr is a Python library for creating scripts to automate MESA and GYRE runs over grids of parameter values. It provides a main function that you can run with a set of configuration settings to determine how to run MESA and GYRE and what values to use for the different models.

import megyr

def main():{
        "input": {
            "mesa_configs": ["inlist.mustache"],
            "gyre_config": ""
        "output": {
            "gyre_oscillations_ad_summary_file": "oscillations_ad.csv"
        "settings": {
            "mesa_star_location": "star",
            "gyre_location": "$GYRE_DIR/bin/gyre",
        "stages": {
            "mesa_params": mesa_params,
            "gyre_params": calc_gyre_params,

mesa_params = {
    "initial_mass": [1, 1.1, 1.5],
    "y": [0.25, 0.27, 0.32]

def calc_gyre_params(mesa_params, mesa_data):
    return {
        "l": [0, 1, 2],

        # Look at all the profiles that are at least 1 Gyr in age
        "profile": mesa_data[mesa_data["star_age"] > 1000000000]["profile"]

if __name__ == "__main__":

Project details

Download files

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

Files for megyr, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size megyr-0.2.1-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size megyr-0.2.1.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page