Skip to main content

Python interface to the Global Linear Ideal Stability Solver

Project description

gliss

gliss is the Python interface to the Global Linear Ideal Stability Solver. Version 0.0.1 provides the Mercier stability diagnostic for GVEC/CAS3D NetCDF equilibrium exports. The Linux wheel contains the compiled Fortran library and uses a small, hand-written ISO C binding; no f90wrap dependency is required.

Installation

python -m pip install gliss

NumPy is the only required Python dependency. The binary wheel also contains the native libraries needed by GLISS. Installing from source requires CMake, Ninja, and a Fortran compiler. LAPACK, PkgConfig, and the NetCDF C library are also required.

Mercier profile

from pathlib import Path

import gliss

s, d_mercier = gliss.mercier_profile(
    Path("equilibrium_export.nc"),
    n_theta=64,
    n_zeta=64,
)
worst = gliss.mercier_objective("equilibrium_export.nc")

s and d_mercier are one-dimensional NumPy float64 arrays with one entry per retained radial surface. GLISS uses the D_Mercier convention: positive values are unstable. mercier_objective returns max(d_mercier), so a larger positive result is less stable.

The input must be a regular file in the GVEC/CAS3D export format. Angular quadrature sizes must be positive integers. Invalid Python arguments raise TypeError, ValueError, or FileNotFoundError; invalid exports and solver failures raise RuntimeError with the native status code.

SIMSOPT

Install the optional dependency and import the adapter explicitly:

python -m pip install "gliss[simsopt]"
from gliss.simsopt import MercierPenalty

penalty = MercierPenalty("equilibrium_export.nc")
value = penalty.J()

MercierPenalty is a leaf Optimizable. It has no equilibrium degrees of freedom and no analytic derivative in version 0.0.1. Update export_path after an external equilibrium solve before evaluating it again.

Native library and ABI

gliss.version() reports the loaded native version. The Python package checks ABI version 1 before every native call and rejects an incompatible library. Platform wheels load their bundled library automatically. Developers can test a local build explicitly:

cmake -S . -B build -G Ninja
cmake --build build --target gliss_c
GLISS_LIB=$PWD/build/libgliss_c.so python -c \
  'import gliss; print(gliss.version())'

GLISS_LIB deliberately overrides the bundled library. This is a development and debugging facility, not required for normal use.

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

gliss-0.0.1.tar.gz (198.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gliss-0.0.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (11.5 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file gliss-0.0.1.tar.gz.

File metadata

  • Download URL: gliss-0.0.1.tar.gz
  • Upload date:
  • Size: 198.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gliss-0.0.1.tar.gz
Algorithm Hash digest
SHA256 772fdff1a5ed7e1a434781c601d70c50d30b38f5a550249e0b3220aba3fb2202
MD5 f864b954498d031bc9be9fd034edad1c
BLAKE2b-256 8c1b91cd14fc009d760555807ad852e8efb6371d82b4ce27165d09895a8dad7c

See more details on using hashes here.

File details

Details for the file gliss-0.0.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: gliss-0.0.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.5 MB
  • Tags: Python 3, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gliss-0.0.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5cb4d8127dfaf2ab1970775a718be027f193c925cdcb26c1eb9fca1ddbffd2c5
MD5 62ce38a0f5521afa0ce30212903b55dd
BLAKE2b-256 8363de41efd799caee7556e92ec9558b1aa0e491228c98804b3c78e8b2530a4e

See more details on using hashes here.

Supported by

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