Skip to content

Commit

Permalink
Rename GateObject.clone_user_info() to copy_user_info()
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrah committed Jan 14, 2024
1 parent 579edf1 commit 7139d64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion opengate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class GateObjectSingleton(metaclass=MetaUserInfoSingleton):
class GateObject(metaclass=MetaUserInfo):
user_info_defaults = {"name": (None, {"required": True})}

def clone_user_info(self, other_obj):
def copy_user_info(self, other_obj):
for k in self.user_info.keys():
if k not in ["name", "_name"]:
try:
Expand Down
2 changes: 1 addition & 1 deletion opengate/contrib/phantoms/nemaiec.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def add_iec_one_sphere(

# capillary outer shell
caps = sim.add_volume("Tubs", f"{name}_capillary_shell_{d}")
caps.clone_user_info(cap)
caps.copy_user_info(cap)
caps.material = iec_plastic
caps.rmax = cap_thick
caps.rmin = cap.rmax
Expand Down
2 changes: 1 addition & 1 deletion opengate/geometry/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __init__(self, *args, **kwargs):
# except for the name of course
if "template" in kwargs:
# FIXME: use from_dictionary()
self.clone_user_info(kwargs["template"])
self.copy_user_info(kwargs["template"])
# put back user infos which were explicitly passed as keyword argument
for k in self.user_info.keys():
if k != "name":
Expand Down
8 changes: 4 additions & 4 deletions opengate/tests/src/test059_tpsource_gantry_rot.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@
## ---- HBL Nozzle ---
# FIXME : will change after volumes are refactored
box_rot = sim.add_volume("Box", "box_rot")
box_rot.clone_user_info(box)
box_rot.copy_user_info(box)
box_rot.rotation = Rotation.from_euler("y", -90, degrees=True).as_matrix()
box_rot.translation = [1148.0, 0.0, 1000.0]

nozzle_rot = sim.add_volume("Box", "nozzle_rot")
nozzle_rot.clone_user_info(nozzle)
nozzle_rot.copy_user_info(nozzle)
nozzle_rot.mother = box_rot.name

rashi_rot = sim.add_volume("Box", "rashi_rot")
rashi_rot.clone_user_info(rashi)
rashi_rot.copy_user_info(rashi)
rashi_rot.mother = box_rot.name

# -----------------------------------
Expand All @@ -113,7 +113,7 @@

# target 2 HBL
phantom_rot = sim.add_volume("Box", "phantom_rot")
phantom_rot.clone_user_info(phantom)
phantom_rot.copy_user_info(phantom)
phantom_rot.rotation = Rotation.from_euler("z", 90, degrees=True).as_matrix()
phantom_rot.translation = [0.0, 0.0, 1000.0]

Expand Down

0 comments on commit 7139d64

Please sign in to comment.