legend-exp / legend-pygeom-hpges

Germanium detector geometries for radiation transport simulations
https://legend-pygeom-hpges.readthedocs.io
GNU General Public License v3.0
0 stars 4 forks source link

Initial copy-paste of ICPC construction code #1

Closed drbenmorgan closed 1 year ago

drbenmorgan commented 1 year ago

Import ICPC detector construction code from LegendGeom proof-of-principle project, adding placeholders for materials and tests:

This is very dumb PR that's more to check that CI and hooks to coverage etc works than anything else (I've had severe issues with pip installs and macOS pyg4ometry today...)

drbenmorgan commented 1 year ago

O.k., same errors as locally - appears py4gometry pip package is borked...

gipert commented 1 year ago

The CI jobs seem to fail because of a Numpy deprecation warning - let's ignore them for now.

gipert commented 1 year ago

Another idea: would it make sense to make HPGe inherit from pyg4ometry.geant4.LogicalVolume?

gipert commented 1 year ago

The docs build is also failing, and that's because there is a difference between project and package name. The project name here and here should be legend-geom-hpges.

drbenmorgan commented 1 year ago

Another idea: would it make sense to make HPGe inherit from pyg4ometry.geant4.LogicalVolume?

I'm not sure. Looking at the code as implemented and what has to be done in regards to constructing the solid and LV, do we even need classes here? Or to rephrase, what attributes would/should HPGe and its concrete classes hold that make it distinct, and what member functions would they provide? There's not much, if any, state or functionality in ICPC other than building the logical volume, i.e. that LV alone being the output.

drbenmorgan commented 1 year ago

NB: given the issues with pyg4ometry, we're flying rather blind on this - would it be possible to get fresh PyPy packages for it built?

gipert commented 1 year ago

Hi Ben, I refactored the code. There will be a new student working on adding the other L200 detector types etc. in the next weeks -- hopefully we can have soon a fully functional package.

Looking at the code as implemented and what has to be done in regards to constructing the solid and LV, do we even need classes here?

You are right, but I still think we should define a class for two reasons: 1) type checking in client code 2) attaching metadata (see code now).

NB: given the issues with pyg4ometry, we're flying rather blind on this - would it be possible to get fresh PyPy packages for it built?

I'm working on a repackaging of pyg4ometry at https://github.com/pyg4ometry/pyg4ometry, hope it's going to be fully functional soon!