Dash and VS Code tooling for inspecting VMEC wout NetCDF equilibria
Project description
VMECdash
An interactive Dash application for exploring VMEC wout_*.nc stellarator equilibria.
It reconstructs magnetic surfaces with JAX, renders 1‑D/2‑D/3‑D plots and so on, motivated by the original MATLAB tool VMECplot.m.
Motivation: Quickly inspect the VMEC equilibrium quantities of interest without relying on difficult-for-starter-to-compile programs (such as libstell) or memory-heavy commercial software (such as MATLAB).
Features
- File upload for standard VMEC
woutNetCDF output. - Summary dashboard with key scalar diagnostics and highlighted metadata (free/fixed boundary, mgrid file, etc.).
- 1‑D profiles for rotational transform, safety factor, pressure, volume derivative, beta metrics, and more.
- 2‑D visualisations:
- R‑Z cross sections with geometry or interpolated scalar fields.
- θ‑ζ flux-surface contours across a field period.
- 3‑D flux surfaces with optional coordinate‑free background shading.
- Field lines viewer for $\alpha-\zeta$ coordinates on selected flux
- A nice choice for visualising magnetic ripple
- 2D plots of $|B|(\alpha, \zeta)$
- 1D plots of single period field line traces with different initial $\alpha$ values
- Single field line transistions.
- JAX acceleration for geometry reconstruction.
Requirements
Python 3.10+ is recommended. Install dependencies with conda:(optional)
conda activate your_env_name
pip install -r requirements.txt
Note for JAX: If you don't have a GPU/TPU or your gpu is not supported for FP64(like metal), then simply running
pip install jax[cpu]to install the CPU-only version is good enough. GPU/TPU wheels require platform-specific instructions from the JAX documentation.
Running the App
python VMECdash.py
Dash defaults to http://127.0.0.1:8050/. The layout is responsive, so you can resize the browser to focus on plots or the control sidebar.
The packaged entry point is also available after installation:
pip install -e ".[dash]"
vmecdash serve
VS Code Native Preview
VMECdash now includes the first native VS Code integration surface:
- a Dash-free Python backend at
python -m vmecdash.vscode_backend --stdio; - a workspace VS Code extension under
extension/; - a Custom Readonly Editor for
wout*.ncfiles; - a Webview UI that renders backend Plotly figures with bundled
plotly.min.js.
For local development, install the Python package in the interpreter VS Code should use:
pip install -e .
Then open extension/ as a VS Code extension development project or package it as a VSIX. In Remote-SSH, install vmecdash in the remote Python environment and set vmecdash.pythonPath if VS Code does not pick the desired interpreter.
Usage Tips
- Upload a VMEC NetCDF file (
wout_*.nc) via the drag‑and‑drop area in the sidebar. - Use Visualization Mode to switch between:
- Summary Dashboard (shows statistics + multi-panel plots),
- 1D Profiles, 2D Cross Sections, 2D Flux Surfaces, and 3D Geometry.
- Adjust sliders for toroidal angle (
phi), flux surface index (s), and choose different physical quantities from the dropdowns. - Toggle Coordinate-free background in 3‑D mode for clean screenshots.
- Click Download Plot to export the currently visible figure as a PNG.
The app caches equilibrium metadata, so switching modes or variables is fast.
For heavy 2‑D physics overlays, a pre-computation step runs on the server while keeping the UI responsive.
Repository Layout
| Path | Description |
|---|---|
VMECdash.py |
Main Dash entry point (layout + callbacks). |
vmec_jax.py |
JAX-powered data processor for VMEC equilibria. |
views/ |
Modular UI components (overview, profiles, 2D/3D, fieldlines). |
ui/ |
Shared UI helper components. |
requirements.txt |
Python dependencies. |
example/wout_PO.nc |
Example VMEC equilibrium (use your own files for new cases). |
TroubleShooting
Feel free to open issues or pull requests to add new physical quantities, UI tweaks, or performance optimisations. Enjoy exploring your VMEC equilibria!
Next step
- Add jax-based boozer coordinate transformation.
- Fast evaulation of EffetiveRipple, GammaC, maybe slow without gpu.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vmecdash-0.1.1.tar.gz.
File metadata
- Download URL: vmecdash-0.1.1.tar.gz
- Upload date:
- Size: 705.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aff4ed84f251e3202873bb17e4f30780a2e282f78234a6edc6c8dea2d4d5a0a4
|
|
| MD5 |
a0183858784a07dd0d479303bda467c7
|
|
| BLAKE2b-256 |
6ba7cf956ac8fffe80ff600d4953461d2a255d81b0e5fd86abb550b5f94a1b49
|
File details
Details for the file vmecdash-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vmecdash-0.1.1-py3-none-any.whl
- Upload date:
- Size: 703.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adbd1ac13d53ae7994d4ec611623884426d2215ca111b7c94f3487718bbccbec
|
|
| MD5 |
b90715ae1e3af85b8ed23a572c018d6d
|
|
| BLAKE2b-256 |
cad225725c48ff651c0834beadfc6d6761d36a7c1bb207e5a74a8bbac245a0e3
|