Skip to main content

Python Interface for GUNDAM

User friendly Python interface for GUNDAM.

The package is published as gundam-interface and imported as gundam_interface.

Installation

pip install gundam-interface

For upgrading:

pip install --upgrade gundam-interface

For local development:

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[dev]"

Usage

import gundam_interface

print(gundam_interface.__version__)

Plot dial response density

Install the plotting dependency with pip install 'gundam-interface[plot]'. Use an initialized interface and pass the name of an enabled parameter.

from gundam_interface import DrawingTools

tools = DrawingTools(interface)
fig, ax = tools.drawDialResponseDensity("HFPW_toHFTwkDial_C_nu_0Graph")
fig.savefig("dial-response-density.png")

Modify event variables and rebin

Enable dynamic binning on the desired samples after configure() and before initialize(). GUNDAM then retains events outside the histogram and stores the variables needed to assign bins.

interface.configure()
model = interface.getModel()
sample = model.getSampleSet().getSampleList()[0]
sample.setUseDynamicBinning(True)
interface.initialize()

event = sample.getEventList()[0]
variables = event.getVariables()
variables["X"] = 1.2  # Access by variable name or integer index.

model.updateEventSampleBinning()  # Reuses the propagator's thread pool.
llh = interface.evaluateLlh()  # Refills histograms and evaluates the likelihood.

Assignments preserve the stored C++ numeric type and refresh its cached value. Assign integers to integer variables. Rebinning is explicit and updates only samples with dynamic binning enabled. Events outside all bins keep index -1 and remain available for later migrations. sample.getNbBinnedEvents() returns the number currently assigned to a bin.

sample.updateEventSampleBinning() updates a single sample. Use the propagator method for repeated updates to reuse its thread pool. evaluateLlh() refills the model histograms. Event-to-dial associations remain unchanged by these operations.

These methods require GUNDAM bindings exposing VariableHolder.setValue(), Sample.setUseDynamicBinning(), and updateEventSampleBinning() on samples and propagators.

Build

python -m build
python -m twine check dist/*

Publish a new PyPI version

Publishing is handled by the GitHub Actions workflow .github/workflows/publish.yml.

Before the first release, configure PyPI Trusted Publishing for this project:

  • PyPI project name: gundam-interface
  • Owner/repository: this GitHub repository
  • Workflow name: publish.yml
  • Environment name: pypi

To publish a release:

  1. Make sure the main branch is ready and CI is passing.
  2. Create a new GitHub Release with a semantic tag such as v0.2.1.
  3. Publishing starts automatically when the release is published.
  4. The workflow derives the package version from the tag, updates pyproject.toml, commits that version bump to main, builds the package, and uploads it to PyPI.

The workflow can also be started manually from the GitHub Actions page with a version input such as 0.2.1.

License

This project is distributed under the GNU Lesser General Public License v2.1 or later. See LICENCE for details.

Metadata

Release files for gundam-interface 0.13.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 gundam-interface 0.13.0
File Size Uploaded Provenance Actions
gundam_interface-0.13.0.tar.gz 40.6 kB With provenance Details for gundam_interface-0.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gundam-interface 0.13.0
File Interpreter ABI Platform Actions
gundam_interface-0.13.0-py3-none-any.whl Python 3 none any Details for gundam_interface-0.13.0-py3-none-any.whl

Total release size: 76.1 kB

Release files / gundam_interface-0.13.0.tar.gz

Download URL gundam_interface-0.13.0.tar.gz
Size 40.6 kB
Tags Source
SHA-256 checksum
How to use checksums
669ded0e66b090de25896344b6aa461cc35b92c106158da39e232d31606b6af5
BLAKE2b-256 checksum
How to use checksums
04ad44a8e5664645cb3cf91caa66ea9f02ef7c2354ad8f6c44351895dbd3addc
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 Nov 23, 2026.

Transparency log

Release files / gundam_interface-0.13.0-py3-none-any.whl

Download URL gundam_interface-0.13.0-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a47d7f199be8584ed92b243daade559740697ba0e32731896b705d3055f0daf
BLAKE2b-256 checksum
How to use checksums
4a8ad3fd20c0c41adf2a5b2fb9707f234e53e97e590b48b4261f314a415ca19d
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 Nov 23, 2026.

Transparency log

Security for gundam-interface 0.13.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 gundam_interface-0.13.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 Nov 23, 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