Skip to main content

shape-plotters

Interactive matplotlib plotters for axially symmetric nuclear shapes. Move a slider and the shape, its derivative and its integral properties update. One shared engine draws the figure; each shape parameterization is a render module.

render parameterization sliders library
beta spherical-harmonic (Legendre) expansion β1–β8 beta-parameterization
fos Fourier-over-Spheroid c, a3–a8 fos-parameterization
tqs three quadratic surfaces (Nix) σ1, σ2, σ3, α2, α3 tqs-parameterization
cassini Cassini ovals (Pashkevich) α, α1–α4 cassini-parameterization
funnyhills Funny Hills (Brack et al.) c, h, α funnyhills-parameterization

The shapes are not re-implemented here. R(θ) and the analytic dR/dθ come from the compiled libraries, evaluated on a 2048-node Gauss-Legendre grid in cos θ. That is the dense grid of the WMMM macroscopic-microscopic energy model, so the plot shows exactly the shape the model evaluates.

What the figure shows

  • R(θ) and dR/dθ, and the cross-section ρ(z) with equal axes. The FoS render adds a ρ(z) panel with the library's dρ/dz.
  • Stats: volume, surface and centre of mass by Gauss-Legendre quadrature, the neck position, radius and depth, and the fragment volume and mass split at the neck.
  • Overlays (orange, dashed): for beta, the centre-of-mass corrected shape when its β1 differs from the slider value; for FoS, the R(θ) star-convex representation when its centre of mass is shifted.
  • Scission bands: the neck-radius range 1.2–1.5 fm, shaded.
  • Invalid shapes stay on screen, greyed, with the library's status as the panel title.

Controls: ± nudge buttons on every slider, an A slider for the mass number behind the fm / R₀ unit toggle (R₀ = 1.16 A^(1/3) fm), Reset, and Save (300 dpi PNG named after A and the parameters, written to the current directory). A Z box appears only when the optional WMMM energy overlay is installed; the energy is computed for the nucleus (Z, N = A − Z) and nothing else depends on Z. Red dotted marks on the FoS sliders are practical limits.

While a slider is dragged the axes hold still, so the shape visibly changes instead of the axes rescaling around it; they refit when the mouse is released. If the shape outgrows the view mid-drag, the view jumps out once.

Requirements

  • Linux x86-64. The parameterization libraries ship manylinux wheels only; WSL2 with WSLg works.
  • Python 3.10 or newer with a matplotlib GUI backend. Tk (python3-tk on Debian/Ubuntu) always works; matplotlib prefers Qt or GTK when it can import them. Force one with e.g. MPLBACKEND=TkAgg shape-plotters fos.

Install

pip install shape-plotters

or pipx install shape-plotters to get the command without touching another environment. The parameterization libraries come along as prebuilt wheels (Fortran shared library and libgfortran bundled), pinned to the exact versions each render is written against.

Under WSL, keep the virtual environment on the Linux filesystem, not under /mnt/c. The Windows drive is a 9P mount; a venv there makes matplotlib rendering sluggish (~5× slower).

Run

shape-plotters beta
shape-plotters fos
shape-plotters tqs
shape-plotters cassini
shape-plotters funnyhills

python -m shape_plotters beta does the same.

Energy button

An Energy button appears when a Python package named wmmm is importable. It prints the WMMM energies of the shape on screen. WMMM is not public yet and is not a dependency: without it the button is absent and nothing else changes. This repository contains the calling convention only, no model code, data or output.

Development

git clone https://github.com/AleksanderAugustyn/shape-plotters.git
cd shape-plotters
python3 -m venv ~/.venvs/shape-plotters
source ~/.venvs/shape-plotters/bin/activate
pip install -e ".[test]"
python -m pytest

The WMMM smoke tests skip when wmmm is not installed. The frame-time budgets in tests/test_perf.py assume a venv on the Linux filesystem.

shape_plotters/cli.py          entry point and render registry
shape_plotters/core/           engine, widgets, quadrature, neck and fragment helpers
shape_plotters/core/result.py  the render contract (what a render gives the engine)
shape_plotters/renders/        one module per parameterization
tests/                         pytest suite, including frame-time budgets

A new parameterization is a new module in shape_plotters/renders/ that implements the render contract, plus one registry entry in cli.py and a pinned library in pyproject.toml. The engine needs no change.

Releases are cut by pushing a version tag such as 0.1.0; the wheels workflow builds, tests and publishes to PyPI.

License

MIT, see LICENSE. Changes are recorded in CHANGELOG.md.

Metadata

Release files for shape-plotters 0.3.0

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

Source distribution (sdist)

Source distribution for shape-plotters 0.3.0
File Size Uploaded Provenance Actions
shape_plotters-0.3.0.tar.gz 63.9 kB With provenance Details for shape_plotters-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shape-plotters 0.3.0
File Interpreter ABI Platform Actions
shape_plotters-0.3.0-py3-none-any.whl Python 3 none any Details for shape_plotters-0.3.0-py3-none-any.whl

Total release size: 103.8 kB

Release files / shape_plotters-0.3.0.tar.gz

Download URL shape_plotters-0.3.0.tar.gz
Size 63.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ae3a6d8e388dc6f26b2ce81046be94d1ace2544a0945d1539125b290ef88f52b
BLAKE2b-256 checksum
How to use checksums
606010d5a0abd84feeef6eff70983a576a7cdaca6a3461613bcd32fa993ae488
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Release files / shape_plotters-0.3.0-py3-none-any.whl

Download URL shape_plotters-0.3.0-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
947430b517cee65655ab838cd79dc0004dbf79d8a48c8acd5c9f7dadc923def1
BLAKE2b-256 checksum
How to use checksums
a381d74bddebad9b9b99f88bfb477e3980e96c1a924f7baf27d58ca54c358798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Security for shape-plotters 0.3.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shape_plotters-0.3.0.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 28, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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