Metadata-Version: 2.1
Name: freeqdsk
Version: 0.1.0
Summary: GEQDSK and AEQDSK tokamak equilibrium file reader/writer
Author: Ben Dudson, Peter Hill
License: Copyright 2016 Ben Dudson
        
        Permission is hereby granted, free of charge, to any person obtaining
        a copy of this software and associated documentation files (the
        "Software"), to deal in the Software without restriction, including
        without limitation the rights to use, copy, modify, merge, publish,
        distribute, sublicense, and/or sell copies of the Software, and to
        permit persons to whom the Software is furnished to do so, subject to
        the following conditions:
        
        The above copyright notice and this permission notice shall be
        included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
        LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
        OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
        WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Source, https://github.com/PlasmaFAIR/FreeQDSK
Project-URL: Tracker, https://github.com/PlasmaFAIR/FreeQDSK/issues
Keywords: GEQDSK,AEQDSK,plasma,equilibrium
Classifier: Programming Language :: Python
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: tests
Provides-Extra: dev
License-File: LICENSE

# FreeQDSK

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://img.shields.io/badge/license-MIT-blue.svg)
[![py3comp](https://img.shields.io/badge/py3-compatible-brightgreen.svg)](https://img.shields.io/badge/py3-compatible-brightgreen.svg)

Read and write the popular "geqdsk" and "aeqdsk" tokamak equilibrium
file formats.

## Installation

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

```bash
$ python3 -m pip install --upgrade pip
```

You can then install using:

```bash
$ python3 -m pip install .
```

To run tests:

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

## Usage

A GEQDSK file may be read using the `geqdsk.read` function:

```python
from freeqdsk import geqdsk
with open(filename, "r") as f:
    data = geqdsk.read(f)
```

The result is a dict containing data from the GEQDSK file. To write a file:

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

Similarly, for AEQDSK files:

```python
from freeqdsk import aeqdsk

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

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