pyg4ometry

Geometry package for high energy physics (Geant4, Fluka)


Keywords
cad, fluka, gdml, geant4
License
Other
Install
pip install pyg4ometry==1.2.1

Documentation

pyg4ometry

Python code for rapid creation and conversion of radiation transport Monte Carlo (Geant4 and Fluka) geometries.

PyPI GitHub tag (latest by date) GitHub Workflow Status pre-commit Code style: black Codecov GitHub issues GitHub pull requests License DOI Read the Docs

Installing from PyPI

> pip install pyg4ometry

Note

Most dependencies are available from pip but you will need to install OpenCASCADE cgal, mpfr, gmp, ROOT. Find here installers for Ubuntu and MacOS.

Building

> git clone https://github.com/g4edge/pyg4ometry.git
> cd pyg4ometry
> pip install . # add --editable for a version which you can edit

Note

If you update your Git clone and the pybind11 C++ has changes you will need to reinstall and thus trigger a rebuild.

Manual

Online manual available at https://pyg4ometry.readthedocs.io

Developer commands (for detailed developer notes see readthedocs)

  • Building the manual
    • pip install '.[docs]' to install docs building dependencies
    • cd pyg4ometry/docs
    • make
    • <your browser> build/html/index.html to view the docs
  • Running tests
    • pip install '.[test]' to install test running dependencies
    • pytest
  • Git commit
    • pre-commit
      • pre-commit install to setup pre-commit in source dir (only once)
      • pre-commit run --all-files run pre-commit locally
      • pre-commit run --all-files black run only black
    • messages
      • Start commit message with submodule : (type of change) detailed notes
      • e.g pycgal : (extra functionality) more 2d mesh processing
  • Pull requests
    • PR messages should just explain the change in a concise way as they will form part of the change log
      • e.g FLUKA region viewer
    • Update the CHANGELOG.md file for generating the release notes