Skip to content

Commit

Permalink
Merge pull request OpenGATE#309 from nkrah/restructure_engines
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarrut authored Dec 6, 2023
2 parents 895af95 + 2093e1b commit 4373449
Show file tree
Hide file tree
Showing 36 changed files with 573 additions and 368 deletions.
2 changes: 1 addition & 1 deletion opengate/actors/miscactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def sps(self):
@property
def nb_thread(self):
if self.simulation is not None:
thread = self.simulation.user_info.number_of_threads
thread = self.simulation.number_of_threads
else:
thread = "?"
return thread
Expand Down
8 changes: 6 additions & 2 deletions opengate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import sys

from .exception import fatal, warning
from .definitions import __gate_list_objects__, __gate_dictionary_objects__
from .definitions import (
__gate_list_objects__,
__gate_dictionary_objects__,
__one_indent__,
)


# META CLASSES
Expand Down Expand Up @@ -272,7 +276,7 @@ def __str__(self):
)
for k, v in self.user_info.items():
if k != "name":
ret_string += f" {k}: {v}\n"
ret_string += f"{__one_indent__}{k}:\n{2*__one_indent__}{v}\n"
ret_string += "***\n"
return ret_string

Expand Down
4 changes: 2 additions & 2 deletions opengate/bin/opengate_visu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def go(input, vrml, gdml):
print("pip install pyvista")
return
pl = pyvista.Plotter()
pl.import_vrml(input) # self.simulation.user_info.visu_filename)
pl.import_vrml(input) # self.simulation.visu_filename)
pl.add_axes(line_width=5)
pl.show()

Expand All @@ -44,7 +44,7 @@ def go(input, vrml, gdml):
)
print("pip install pyg4ometry")
return
r = pyg4ometry.gdml.Reader(input) # self.simulation.user_info.visu_filename)
r = pyg4ometry.gdml.Reader(input) # self.simulation.visu_filename)
l = r.getRegistry().getWorldVolume()
v = pyg4ometry.visualisation.VtkViewerColouredMaterial()
v.addLogicalVolume(l)
Expand Down
1 change: 1 addition & 0 deletions opengate/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

__gate_dictionary_objects__ = (Box, collections.abc.Mapping)
__gate_list_objects__ = (list, tuple, BoxList)
__one_indent__ = " "

sigma_to_fwhm = 2 * np.sqrt(2 * np.log(2))
fwhm_to_sigma = 1.0 / sigma_to_fwhm
Expand Down
Loading

0 comments on commit 4373449

Please sign in to comment.