v0.1.0
Initial release of pygemc — the Python API for GEMC geometry definition and output analysis.
Release notes
pygemc provides a pure-Python interface to define Geant4 detector geometries, materials, and
simulation configurations without writing C++ code. Output files produced by the gemc binary
can be read back and analysed entirely from Python.
Geometry API
GVolume— define Geant4 solids, placements, sensitive detectors, and mirrorsGMaterial— define materials by composition, density, and optical propertiesGConfiguration— configure and run a full geometry export (ASCII, SQLite)GColors— named color palette for volume visualizationautogeometry— decorator that wires a geometry function into the gemc plugin system- G4 unit converters:
convert_length,convert_angle,convert_time,convert_energy,convert_list g4_unitsmodule with the complete Geant4 unit table- PyVista-based 3D visualization (
pyvista_api) - SVG and HTML solid previews
Output formats
- ASCII flat-file geometry database
- SQLite geometry database
Analyzer
GemcOutput— read and inspect gemc simulation outputread_output— convenience loader for multiple output formatsplot_variable— quick histogram/scatter plots from simulation datagemc-analyzerCLI entry point
CLI tools
gemc-system-template— scaffold a new detector system from a Geant4 solid template
Tests
test_cli.py— CLI smoke tests for all supported solid typestest_geometry.py— geometry creation and database export for ASCII and SQLite formats
CI
- GitHub Actions workflow with automated install and test on push
Supported platforms
- Linux (amd64 and arm64)
- macOS
Dependencies
- Python 3.10 or higher
- numpy, pandas, matplotlib, pyyaml (installed automatically)
- vtk, pyvista, pyvistaqt, pyqt6 (visualization, installed at deploy time)