File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
xcoll/scattering_routines/geant4 Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -24,25 +24,29 @@ def __init__(self):
2424 self ._geant4 = None
2525 self ._bdsim = None
2626 self ._in_constructor = False
27+ self ._geant4_sourced = False
28+ self ._bdsim_sourced = False
2729 cmd = run (['which' , 'geant4-config' ], capture_output = True )
2830 if cmd .returncode == 0 :
2931 path = FsPath (cmd .stdout .decode ().strip ())
3032 if path .exists ():
3133 self ._geant4 = path
34+ self ._geant4_sourced = True
3235 cmd = run (['which' , 'bdsim' ], capture_output = True )
3336 if cmd .returncode == 0 :
3437 path = FsPath (cmd .stdout .decode ().strip ())
3538 if path .exists ():
3639 self ._bdsim = path
40+ self ._bdsim_sourced = True
3741
3842 @property
3943 def compiled (self ):
4044 if self .geant4 is None or self .bdsim is None :
4145 return False
4246 so = list ((self .data_dir ).glob ('g4interface.*so' ))
43- if len (so ) == 1 and so [0 ].exists ():
44- return True
45- return False
47+ if len (so ) != 1 or not so [0 ].exists ():
48+ return False
49+ return self . _geant4_sourced and self . _bdsim_sourced
4650
4751 def compile (self , verbose = True ):
4852 # Check all dependencies
You can’t perform that action at this time.
0 commit comments