Skip to main content

MEGPy: Magnetic Equilibrium Geometry Python

MEGPy is a package for quick extraction of (local) equilibrium quantities and visualisation of 2D magnetic equilibria used in magnetic confinement fusion research. It offers both a command line interface (CLI) and Python API.

Getting started

To get MEGPy clone and install the latest version:

$ git clone https://github.com/gsnoep/megpy.git
$ cd megpy
$ pip install --user -e .

To use MEGPy call the CLI:

$ python -m megpy <file_path> <parameterization> <x_fs>

For details on the CLI options:

$ python -m megpy -h

Or use the Python API, of which some examples can be found in /examples/.

To contribute, open a pull request or raise an issue!

Supported equilibrium formats

  • EQDSK (g-file) from EFIT, ESCO, FreeGS, CHEASE or LIUQE
  • EX2GK pickle file
  • IMAS equilibrium IDS

To be added:

  • VMEC

Supported flux-surface geometries

  • Miller (doi)
  • Turnbull-Miller (doi)
  • Fourier / generalised Miller (doi)
  • Miller eXtended Harmonic (MXH) (doi)

Citation

If you use MEGPy in your research, please cite (bibtex):

G. Snoep, J.T.W. Koenders, C. Bourdelle, J. Citrin and JET contributors, "Improved flux-surface parameterization through constrained nonlinear optimization," Physics of Plasmas 30, 063906 (2023)

                .#&%%%-.
            <===#%%%%%%%%%%.
               ?==%%( )%%%%%%
                )%%%%%%%%%%%%%\
                (%%%%%%%%%%%..%%%
                (%%%%%%%%&..    .\%.
                 %%%%%%%% &\,.  ..\%%%.
                 M%%%%%%%...&&%\%%%%%%%%%-
                   %%%%%.       .\%%%%%%%%%%.
                    %%%..             .\%%%%%%%.
                     E...               .\%%%%%%%-.
                        &...              )%%%%(%%%.
                           G..   .&).     )GS\   \%%%%%%-.
                              \&))  \&(%^^          \&%%%%%&.
                               )%%    %%                 \%%%%%%%&.
                            .&&     .%                        \&\\%%%%\\&..
                         .%<       (\                               %    \
                  .::-P-..-&  &&-Y&--.

Metadata

Release files for megpy 2.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for megpy 2.0.9
File Size Uploaded Provenance Actions
megpy-2.0.9.tar.gz 54.0 kB Without provenance Details for megpy-2.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for megpy 2.0.9
File Interpreter ABI Platform Actions
megpy-2.0.9-py2.py3-none-any.whl Python 3, Python 2 none any Details for megpy-2.0.9-py2.py3-none-any.whl

Total release size: 109.4 kB

Release files / megpy-2.0.9.tar.gz

Download URL megpy-2.0.9.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2768ee92fbe347520333a96007b84e1e58c96483b59d3c04ffdda8b04b66fbe2
BLAKE2b-256 checksum
How to use checksums
5484b9fba84ee5dedf4e0d6abfab706e133520545b61c624f0687bc37d2263cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / megpy-2.0.9-py2.py3-none-any.whl

Download URL megpy-2.0.9-py2.py3-none-any.whl
Size 55.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8f53e921e987a4617142b27a5a76044e7e5d0ab03ef05a2c6e29eeb4df260164
BLAKE2b-256 checksum
How to use checksums
17c3414585394954bac0e695beb058e2a1b3bf678f55f3192822ef6785bb3ea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for megpy 2.0.9

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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