Skip to content

Developer guide: cover wheels, data files, Geant4 11.4.3 and contributing - #105

Merged
kavyawadhwa134 merged 9 commits into
mainfrom
developer-guide-updates
Oct 17, 2026
Merged

kavyawadhwa134 merged 9 commits into
mainfrom
developer-guide-updates

Conversation

@kavyawadhwa134

@kavyawadhwa134 kavyawadhwa134 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Brings PYTHON_DEVELOPER_GUIDE.md up to date with the changes since #98, and greatly expands it.

Updated sections

  • Installation: fresh venv first, PyPI wheels with/without [gui], installation check, Geant4 data files (download, reuse across versions, using an installed Geant4's datasets).
  • Visualization, event output, reproducibility across Geant4 versions, primaries outside the world, common failure modes.

New parts

  • Part VI – How the package works: the worker-process architecture, the application lifecycle, what a run records, and the event data model with units.
  • Part VII – Five worked detector simulations, each run for the guide and checked against reference values, with figures in docs/images/: Rutherford gold foil (angular distribution vs Rutherford), a Pb/LAr sampling calorimeter (sampling fraction, 20%/√E resolution), proton Bragg peaks (R80 within 1% of NIST PSTAR), a magnetic spectrometer (momentum from curvature), and gamma radiography (transmission matches attenuation coefficients).
  • Part VIII – Example catalogue and Part IX – API reference.
  • Part X – Working on the package: layout, source builds, tests, CI, upgrading Geant4, the conda recipe, releases.

Corrections found by running the guide's code

  • Scripts must create the Application under if __name__ == "__main__": (macOS starts the worker with spawn).
  • detector.sensitive_volumes takes logical volume names (boxVolume, not box).
  • Volume queries and check_overlaps() need initialize() first.
  • Primary arrays take energy in keV and position in cm.
  • With n_threads > 0, app.generator is unavailable; initialize first and use /gun/ commands.

PDF

  • docs/geant4-python-developer-guide.pdf: the guide typeset with LaTeX (81 pages), linked from the README. tools/build_guide_pdf.py rebuilds it from the Markdown with tectonic (section 86). check-added-large-files now allows up to 1 MB for it.

Note: section 84 describes conda-recipe/, which is on the conda-forge-recipe branch and not yet on main.

🤖 Generated with Claude Code

…ting

Installation now starts from a fresh virtual environment and the PyPI wheels,
with the [gui] extra, installation checks and how the Geant4 data files are
downloaded, reused and found in an installed Geant4. Visualization, output
fields, reproducibility, primaries outside the world and common failures are
updated for Geant4 11.4. A new Part VI covers the repository layout, example
ports, source builds, tests, CI, upgrading Geant4, the conda recipe and
releases.
@kavyawadhwa134
kavyawadhwa134 requested a review from lobis as a code owner October 17, 2026 10:07
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c895faeb-a378-484c-92de-d35816c38229
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

pre-commit-ci Bot and others added 5 commits October 17, 2026 10:07
…API reference

New parts: how the package works (the worker process, the application
lifecycle, what a run records, the event data model with units); five
worked detector simulations, each run and checked against reference data
(Rutherford gold foil, a Pb/LAr sampling calorimeter, a proton Bragg peak
against NIST PSTAR, a magnetic spectrometer, gamma radiography), with
figures in docs/images; a catalogue of the repository's examples; and an
API reference. The contributor part becomes Part X.

Fixes found by running the guide's code: scripts need an
if __name__ == "__main__" guard; sensitive volumes take logical volume
names; volume queries and check_overlaps need initialize(); primary arrays
take keV and cm; multithreaded runs must initialize before configuring the
source with /gun/ commands.
KAVYA WADHWA and others added 3 commits October 17, 2026 17:57
docs/geant4-python-developer-guide.pdf is the guide typeset with LaTeX,
built from PYTHON_DEVELOPER_GUIDE.md by tools/build_guide_pdf.py (Markdown
to LaTeX, compiled with tectonic). The README links it, and section 86
explains how to rebuild it. check-added-large-files now allows up to 1 MB
for the PDF.
@kavyawadhwa134
kavyawadhwa134 merged commit 2f71b15 into main Oct 17, 2026
20 checks passed
@kavyawadhwa134
kavyawadhwa134 deleted the developer-guide-updates branch October 17, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant