Metadata-Version: 2.4
Name: eqdsk
Version: 0.8.0
Summary: A reader, writer and converter for the eqdsk format
Project-URL: Source, https://github.com/Fusion-Power-Plant-Framework/eqdsk
Project-URL: Documentation, https://github.com/Fusion-Power-Plant-Framework/eqdsk#readme
Project-URL: Issues, https://github.com/Fusion-Power-Plant-Framework/eqdsk/issues
Author: The Bluemira Developers
License-Expression: LGPL-2.1-or-later
License-File: LICENSE
Keywords: GEQDSK,cocos,eqdsk,tokamak
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: click
Requires-Dist: fortranformat
Requires-Dist: numpy
Provides-Extra: cli
Requires-Dist: matplotlib; extra == 'cli'
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-gen-files; extra == 'docs'
Requires-Dist: mkdocs-literate-nav; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Requires-Dist: mkdocs-section-index; extra == 'docs'
Requires-Dist: mkdocstrings[python]; extra == 'docs'
Provides-Extra: imas
Requires-Dist: imas-python[netcdf]>=2.2.0; extra == 'imas'
Provides-Extra: lint
Requires-Dist: mypy; extra == 'lint'
Requires-Dist: ruff; extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-html; extra == 'test'
Requires-Dist: pytest-json-report; extra == 'test'
Requires-Dist: pytest-metadata; extra == 'test'
Description-Content-Type: text/markdown

# Eqdsk

[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![Downloads](https://img.shields.io/pypi/dm/eqdsk?color=blue)
[![Actions status](https://github.com/Fusion-Power-Plant-Framework/eqdsk/actions/workflows/main_and_pr.yml/badge.svg)](https://github.com//Fusion-Power-Plant-Framework/eqdsk/actions)

An EQDSK reader and writer for GEQDSK (more soon), with COCOS identification and conversion.

There is support for writing an eqdsk to a JSON format (which is now preferred) and an IMAS database integration.

We have extended the EQDSK standard to optionally allow for the definition of a CoilSet.

## Setup

We are pip installable therefore for the most recent release:

```bash
pip install eqdsk
```

or for the most recent commit

```bash
pip install git+https://github.com/Fusion-Power-Plant-Framework/eqdsk.git
```

For a developer setup please see [CONTRIBUTING.md](CONTRIBUTING.md#setup-with-hatch)

## Basic Usage

To read in an eqdsk (json or eqdsk) in its raw state:

```python
from eqdsk import EQDSKInterface

EQDSKInterface.from_file('file.json', no_cocos=True)
```

To read in an eqdsk file with a known cocos format and convert it to a given cocos format:

```python
EQDSKInterface.from_file('file.eqdsk', from_cocos=11, to_cocos=17)
```

Alternatively if the direction (clockwise or anticlockwise) and the units of phi (V.s or V.s/rad) are known,
the cocos standard will be calculated for you:

```python
EQDSKInterface.from_file('file.eqdsk', clockwise_phi=True, volt_seconds_per_radian=True)
```

## CLI

This package includes a CLI tool for eqdsk exploration.

This can be accessed by running `eqdsk` in the terminal after installing the package (or in the Hatch `cli` environment, see [CONTRIBUTING.md](CONTRIBUTING.md#setup-with-hatch)).

For more information on the CLI tool, run `eqdsk --help`.
