Skip to content

Modularisation of pyg4ometry and refactoring #263

@stewartboogert

Description

@stewartboogert

Split pyg4ometry into multiple packages will make maintenance easier. Different users have different requirements of pyg4ometry, separation will allow users to avoid heavy dependencies. Potential divisions (or packages) are

  • Core Geant4 (geant4, gdml) - pycgal
  • Visualisation (visualisation) - VTK
  • FLUKA (fluka) - pycgal
  • MCNP (mcnp) - none
  • Convert (convert) - fluka, mcnp, usd, root
  • USD (usd) - openusd
  • CAD (pyoce) - open cascade

Each new module can be reviewed for modern python usage

  • Logging
  • Update to f-strings terminal output
  • Type hints/checking
  • Context management (with)

Rather than copy pasting code, it would be better to create an empty package with all style checks enabled and slowly populating it.

Potential new packages

  • pyg4ometry-cgal
  • pyg4ometry-core (geant4, gdml, transforms, exceptions, compare, config, cli)
  • pyg4ometry-visualisation (vtk, usd etc)
  • pyg4ometry-cad (pyoce)
  • pyg4ometry-convert (fluka, mcnp)
  • pyg4ometry-extra (root, features, bdsim, misc, analysis, montecarlo)

The main issue is where to locate pycgal. This is baked into geant4.solids and it could be factored out up front.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions