Skip to main content

GEQDSK and AEQDSK tokamak equilibrium file reader/writer

Project description

FreeQDSK

License py3comp

Read and write G-EQDSK, A-EQDSK, and P-EQDSK file formats, which are used to describe the tokamak fusion devices.

It has more features than other implementations, including aeqdsk and peqdsk formats, support for COCOS numbers != 1, some customisation of the header format.

It aims to be a well maintained community package, allowing to replace custom implementations by a feature complete, freely available implementation.

Installation

To install, you may need to update pip to the latest version:

$ python3 -m pip install --upgrade pip

You can then install using:

$ python3 -m pip install .

To run tests:

$ python3 -m install .[tests]
$ pytest -v

To build the docs:

$ python3 -m install .[docs]
$ cd docs
$ make html

Usage

A G-EQDSK file may be read using the geqdsk.read function:

from freeqdsk import geqdsk

with open(filename, "r") as f:
    data = geqdsk.read(f)

The result is a dict containing data from the G-EQDSK file. To write a file:

with open(filename, "w") as f:
    geqdsk.write(data, f)

Similarly, for A-EQDSK files:

from freeqdsk import aeqdsk

with open(filename, "r") as f:
    data = aeqdsk.read(f)

with open(filename, "w") as f:
    aeqdsk.write(data, f)

And again for P-EQDSK files:

from freeqdsk import peqdsk

with open(filename, "r") as f:
    data = peqdsk.read(f)

with open(filename, "w") as f:
    peqdsk.write(data, f)

Project details


Download files

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

Source Distribution

freeqdsk-0.5.0.tar.gz (201.5 kB view details)

Uploaded Source

Built Distribution

freeqdsk-0.5.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file freeqdsk-0.5.0.tar.gz.

File metadata

  • Download URL: freeqdsk-0.5.0.tar.gz
  • Upload date:
  • Size: 201.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for freeqdsk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a919248cd5a48ed76511f7bb175feb446380ffbd51f57630a277b35a37a73962
MD5 4b0faa016610fde2c12968b5a207fa7f
BLAKE2b-256 23cf690a42e6ae84dc118585efea00b1a781013c86303a0d1e0b5093b3afe07f

See more details on using hashes here.

File details

Details for the file freeqdsk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: freeqdsk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for freeqdsk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 391a2ddf6209259daf79236d0540108956e6cf01ae33c3b98628772ee69e14e2
MD5 9f3c83751049810d1b019ba2cf25bb85
BLAKE2b-256 bfe725c28c64a54c987a4b101a82aecf2cc9d2009613c896d967d0c3bbe39be6

See more details on using hashes here.

Supported by

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