Skip to main content

plasma-plots

Note: This library is 100% written by AI, I have literally not looked at a single line of code. So why should you trust it? You should trust it because of the following LEAN 4 PROOF.

Plots and diagnostics of labeled xarray data from plasma simulations: the output of Struphy, and of any code whose arrays follow the same conventions (dimensions t, eta1/eta2/eta3, mapped coordinates X/Y/Z, see Getting started). It also reads GVEC's equilibrium evaluations directly. It is a separate package, so it can evolve and release independently of the Struphy runtime.

Full documentation: https://max-models.github.io/plasma-plots

Installation

Python 3.10 or newer is required; CI tests Python 3.10 to 3.14. The base install plots in-memory xarray data. Install extras for file formats and optional renderers:

pip install plasma-plots
pip install "plasma-plots[netcdf]"
pip install "plasma-plots[netcdf,plotly]"
Extra Enables Dependencies
netcdf Read netCDF3/netCDF4 files through xarray and the CLI netCDF4
plotly Interactive browser plots and static Plotly exports plotly, kaleido
tikz TikZ/pgfplots versions of the plots for LaTeX (backend="tikz") maxplotlibx (and pdflatex to compile)
pyvista 3-D scenes and rendering pyvista, imageio
profiling Timing summaries and profiling plots scope-profiler[pproc]
desc Evaluate DESC equilibria desc-opt
gallery Export Struphy example-gallery figures and profiling plotly, kaleido, scope-profiler[pproc]>=0.6.1
dev Tests, linting and documentation tooling pytest, ruff, h5py, griffe, struphy>=3.4.0

Struphy is installed by the dev extra; otherwise install it separately as described below. GVEC and Zarr are separate installations. Install gvec for GVEC evaluation or zarr to open Zarr stores. MP4 export requires system ffmpeg; Matplotlib windows require a working GUI/display, and static Plotly exports through Kaleido require a compatible Chrome installation.

For development, install with pip install -e ".[dev]".

Docker

The Ubuntu image includes Struphy with compiled kernels, MPI, LaTeX and plasma-plots. Pushes to main publish latest; pushes to devel publish devel.

docker run --rm -it -v "$PWD:/work" ghcr.io/max-models/plasma-plots:latest

See the Dockerfile for build and usage notes.

Struphy compatibility

Struphy integration requires Struphy 3.4.0 or newer from PyPI:

pip install "struphy>=3.4.0"

Struphy is optional when working with ordinary xarray data.

Usage

Creating a Struphy Output loads plasma-plots, which registers out.plot, out.analysis and the .plasma accessor on every product:

from struphy.post_processing.output import Output

out = Output("path/to/run")
out.evaluate("em_fields/phi").plasma.plot.slice(x="eta1", y="eta2", t=-1)

In Python, import plasma_plots; help(plasma_plots) (or plasma-plots guide in a terminal) gives an overview, printing an accessor lists its methods (print(phi.plasma.plot)), and help() on a method shows every parameter. For language models and coding agents, the documentation is available as plain text at https://max-models.github.io/plasma-plots/llms.txt. API.md (or plasma-plots api) is a one-page index of every accessor method and function, and AGENTS.md explains the code for agents working on it.

From the shell, the plasma-plots command saves figures of a Struphy run folder or a netCDF file without any Python: plasma-plots info sim_1, plasma-plots plot sim_1 em_fields/phi slice t=-1 eta3=0 -o phi.png, plasma-plots quicklook sim_1 -o figures/ (see the command-line guide).

Direct plotting functions are available from plasma_plots.plotting; analysis functions are in plasma_plots.analysis.

The accessor provides time-series, lineout, slice, panel, vector, comparison, animation, and marker-trajectory plots. For three-dimensional scalar fields, install the optional PyVista dependency (pip install plasma-plots[pyvista]) and use field.plasma.plot.volume(t=-1), then call show() on the returned plotter.

Every Matplotlib plot can also be an interactive Plotly figure, with hover values, zoom and, for animations, a slider: pip install plasma-plots[plotly] and pass backend="plotly" (field.plasma.plot.slice(t=-1, backend="plotly")), or call plasma_plots.set_backend("plotly") once.

For a paper, every still plot can also be TikZ/pgfplots code with LaTeX text, converted by maxplotlib: pip install plasma-plots[tikz] and pass backend="tikz", then result.save("phi.tikz") (or .tex, .pdf); see the LaTeX figures guide.

Metadata

Release files for plasma-plots 0.2.2

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

Source distribution (sdist)

Source distribution for plasma-plots 0.2.2
File Size Uploaded Provenance
plasma_plots-0.2.2.tar.gz 454.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for plasma-plots 0.2.2
File Interpreter ABI Platform
plasma_plots-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 809.9 kB

Release files / plasma_plots-0.2.2.tar.gz

Download URL plasma_plots-0.2.2.tar.gz
Size 454.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4ed98cc5d853d26385c80fd2594ae0fff1fe9b4d7795c5c8cf7df4c43c1f8dd9
BLAKE2b-256 checksum
How to use checksums
d5910dc83df9a01eabdcd275ae3b2412bae047254894313f70b8a3ec69825689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / plasma_plots-0.2.2-py3-none-any.whl

Download URL plasma_plots-0.2.2-py3-none-any.whl
Size 355.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e60194f06c7b1f1f2781c73eb0c2c5525c870b930b393ffd1f1e44703bf89a4f
BLAKE2b-256 checksum
How to use checksums
0d252d5387d30f543f4cd849e1b9c6ac75afbff093fb46b240ced5a8a84cf2be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for plasma-plots 0.2.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plasma_plots-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

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.

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