Skip to main content

Interactive tokamak shot dashboard

Project description

NiceShot!

An interactive dashboard for exploring tokamak plasma shot data. Point it at a shot-statistics file and get an instant browser UI for slicing, visualising, and comparing shots.

NiceShot! dashboard


Features

  • Projection — UMAP or PCA scatter of every shot, coloured by any column. Backed by a content-hash cache so reloads are instant.
  • Pairwise scatter — any two numeric columns plotted against each other, with linear/log axis toggles.
  • Data table — sortable, virtualized table with shot-ID search and cross-highlight with the scatter plots.
  • Time traces — per-shot signal plots loaded on click. Supports local parquet/CSV files, live UDA, and live SAL backends.
  • Filters — up to 6 simultaneous column filters combinable with AND / OR logic. All plots update live.
  • SHAP decision plots — per-shot feature attribution rendered inline (optional, requires --shap-data).
  • Reference graph — overlay the full reference-shot lineage on any scatter plot (optional, requires reference_shot_col in config).

Requirements

  • Python ≥ 3.12
  • uv

Install

git clone <repo>
cd nice_shot
uv sync                      # core dependencies
uv sync --extra shap         # + SHAP plots, xarray, matplotlib

Run

uv run nice-shot --shot-data path/to/shot_stats.parquet

Open http://localhost:8050 in a browser.

On first run, UMAP/PCA is computed and cached. Subsequent starts are instant unless the data file or umap_features config changes.

Common flags

Flag Default Description
--shot-data PATH outputs/shot_stats.parquet Shot statistics file (.csv or .parquet)
--config PATH nice_shot/config.yaml YAML config file
--data-dir PATH data/mastu/ Directory of per-shot files (parquet backend)
--projection PATH Pre-computed 2-D embedding; skips UMAP/PCA entirely
--shap-data PATH SHAP values NetCDF (.nc); enables the SHAP tab
--port PORT 8050 Port to listen on
--no-debug Disable Dash hot-reload

Configuration

Edit nice_shot/config.yaml (or pass --config to point elsewhere):

backend: parquet        # parquet | uda | sal

signals:                # columns shown in the time-trace panel
  - ip
  - ne
  - dalpha

time_window:
  min_time: 0.0
  max_time: 1.0

projection_method: umap # umap | pca

umap_features:          # omit to use all numeric columns
  - ip_max
  - ne_max
  - bt_max

reference_shot_col: reference__number   # omit to hide the feature

Data

Shot statistics file (--shot-data) — a flat .parquet or .csv with one row per shot. The shot ID column is detected automatically (shot_id, shot, pulse, number, …).

Per-shot traces (--data-dir) — one .parquet or .csv per shot, laid out as:

<data-dir>/<any-subdir>/<shot_id>.parquet

Each file needs a time column and one column per configured signal.

Pre-computed projection (--projection) — a .npy (shape (n,2) or (n,3)), .csv, or .parquet with shot ID and two coordinate columns.

SHAP values (--shap-data) — an xarray NetCDF file with shot_id and feature dimensions.

See docs/data-formats.md for full schema details.


Docs

uv run --dev zensical serve

Opens the full documentation at http://localhost:8000.

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

nice_shot-1.0.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

nice_shot-1.0.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file nice_shot-1.0.0.tar.gz.

File metadata

  • Download URL: nice_shot-1.0.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nice_shot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 563987054c8054ad322230aab06c21cfc7d43241ce374485f479a5fc23b63acb
MD5 6c571fad064b0fd4cba4e6ceb43bba4e
BLAKE2b-256 827802c28193e80eecd94fedc00cfbbc7b8852bdd91e2bfa0b38bed8b0697462

See more details on using hashes here.

Provenance

The following attestation bundles were made for nice_shot-1.0.0.tar.gz:

Publisher: publish.yml on samueljackson92/nice-shot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nice_shot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nice_shot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nice_shot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e48c99f4bc1772cef473446afe2394ddc441106697298e180ceb1db5a1dc9c2
MD5 8d618081de417c375cc82af09fe8ab15
BLAKE2b-256 923b548522aaed2cb1d429ebed319da3474048c1f5972f50054b07af1ab874e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nice_shot-1.0.0-py3-none-any.whl:

Publisher: publish.yml on samueljackson92/nice-shot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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