Skip to main content

Magboltz-GUI

A lightweight, cross-platform Qt6 GUI for Magboltz.


Documentation

Published documentation:

Project documentation sources live in docs/.

To build the HTML documentation locally:

./scripts/build_docs.sh

The generated site is written to:

docs/_build/html/index.html

Installation

With uv

Option A — bundled Qt (pip)

uv venv
source .venv/bin/activate
uv pip install -e ".[qt]"

Option B — system Qt (Linux/Debian/Ubuntu)

# Debian/Ubuntu: install system PyQt6
sudo apt install python3-pyqt6
# Recommended for proper theming on GNOME/Wayland:
#   sudo apt install adwaita-qt6

and then:

uv venv --system-site-packages
source .venv/bin/activate
uv pip install -e .

Without uv

Option A — bundled Qt (pip)

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[qt]"

Option B — system Qt (Linux/Debian/Ubuntu)

# Debian/Ubuntu: install system PyQt6
sudo apt install python3-pyqt6
# Recommended for proper theming on GNOME/Wayland:
#   sudo apt install adwaita-qt6

and then:

python3 -m venv .venv --system-site-packages
source .venv/bin/activate
pip install -e .

Quick start

magboltz-gui
# or
python -m magboltz_gui

magboltz-gui can prepare input cards without a local Magboltz executable. Running simulations from the GUI requires a local magboltz binary on PATH, or a custom executable path configured in the application. The current regression reference is based on MAGBOLTZ 2 VERSION 11.19.

Linux theming note

  • The app auto-detects platform themes on Linux and will log what it picks.
  • On Debian/GNOME, the app keeps Qt's Fusion style and applies an explicit readable palette. This avoids qt6ct diagnostics and Adwaita/GTK variants that can make enabled controls look disabled on some setups.
  • If you explicitly prefer qt6ct, you can force it:
    QT_QPA_PLATFORMTHEME=qt6ct magboltz-gui
    
    (assuming qt6ct is installed and configured)

Developer notes

Campaign sweep core

The first non-GUI campaign slice can generate reproducible parameter sweeps from an existing InputCards object and materialize one input card per run:

from magboltz_gui.campaign import CampaignPlan, ExplicitSweep, SerialCampaignRunner, SweepParameter

plan = CampaignPlan(
    base_cards=cards,
    parameters=[
        SweepParameter("electric_field", ExplicitSweep([100.0, 200.0, 500.0])),
    ],
)

SerialCampaignRunner().prepare(plan, output_dir)

Supported field paths include top-level fields such as electric_field and indexed gas-mixture fields such as gases[0].gas_frac. Execution is serial by design in this first slice.

The GUI includes an initial Campaign tab for this workflow. It can snapshot the current input card, define simple values, linear, and logspace sweeps, preview the generated run matrix, and generate one input.in file per run. Each sweep row can be part of the product grid or the single coupled-rows group. This supports patterns such as a product sweep over field values while Ar/CO2 fractions vary together. The GUI does not execute campaigns yet; execution remains a follow-up slice.

Regenerate Qt UI bindings

The .ui files in src/magboltz_gui/ui/ are the source of truth. The Python bindings in src/magboltz_gui/generated/ are generated artifacts.

To regenerate them (requires pyuic6 from PyQt6):

python -m magboltz_gui.tool.gen_ui

This will update both ui_*.py and ui_*.pyi files under src/magboltz_gui/generated/.

Development dependencies

With uv:

uv sync --group dev

Without uv:

pip install -e ".[dev]"

Both install the same dev tools (black/mypy/stubs); use whichever matches your workflow.

Run tests

Install the lightweight test dependencies:

pip install -e ".[test]"
python -m pytest -q

The test suite includes parser/export checks and an Ar/CO2 70/30 reference case. The reference test checks that the GUI input-card representation round-trips semantically and that selected native Magboltz 11.19 output values are preserved through CSV, JSON, and XML export.

Default tests intentionally avoid Qt and external Magboltz execution. Tests that require Qt should be marked gui and placed under tests/gui/; tests that execute a real Magboltz binary should be marked magboltz.

To run the Qt smoke tests locally:

pip install -e ".[test-gui]"
QT_QPA_PLATFORM=offscreen python -m pytest -q -m gui

The GUI tests cover main-window initialization, gas add/remove, parameter widget bindings, result-file loading, command-line clipboard copying, run-error paths, export-dialog state transitions, and export-dialog settings writing CSV/JSON/XML files through the core export layer.

To run the opt-in tests that execute a real Magboltz binary:

MAGBOLTZ_TEST_BIN=/path/to/magboltz python -m pytest -q -m magboltz

These tests are intentionally excluded from the default path because they run a local Fortran Magboltz executable. MAGBOLTZ_TEST_TIMEOUT controls the per-run timeout in seconds and defaults to 900.

Build the documentation

If you prefer to install the documentation stack in a virtual environment:

uv pip install -e ".[docs]"
./scripts/build_docs.sh

Academic & Research Use

This software is distributed in the spirit of open scientific collaboration.
If you use magboltz-gui in academic or research work, please cite:

  • S. F. Biagi, Nucl. Instrum. Met. A 421 (1999) 234–240.
  • M. Renda, D. A. Ciubotaru, magboltz-gui (year, version, DOI/URL) — (to be completed).

Citation is not legally required by the license but is encouraged to support reproducibility and credit the original authors.


Authors & Contact


License

Released under the MIT License.
See LICENSE for details.

Metadata

Release files for magboltz-gui 0.4.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 magboltz-gui 0.4.0
File Size Uploaded
magboltz_gui-0.4.0.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for magboltz-gui 0.4.0
File Interpreter ABI Platform
magboltz_gui-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.9 MB

Release files / magboltz_gui-0.4.0.tar.gz

Download URL magboltz_gui-0.4.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
900fbd52291c8cc3792007d4a35eeec571ed82e906ce62a3ec4f404d2e9c6d9a
BLAKE2b-256 checksum
How to use checksums
47a6964ef9516e1fe5ac02b4dc9c723ed50ad59e46c7d5a4e632153761deeba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / magboltz_gui-0.4.0-py3-none-any.whl

Download URL magboltz_gui-0.4.0-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0f46edfe81ee1599ed7d4c677d47309cb740735cab8201795d088782f1f0e80c
BLAKE2b-256 checksum
How to use checksums
c7f45b4f7ee48d5d39be3162c503037f3b1d96113ccc16b18c11a6f52d850982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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