Skip to content

Commit

Permalink
add copy fn
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Aug 15, 2024
1 parent c0ddf11 commit 7706e72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atomrdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ def repeat(self, repetitions):
new_system._structure_dict = {}
new_system._structure_dict["repetitions"] = repetitions
new_system.to_graph()
new_system.copy_defects(self.sample)
return new_system

def delete(self, ids=None, indices=None, condition=None, selection=False, copy_structure=False):
Expand Down Expand Up @@ -968,6 +969,7 @@ def delete(self, ids=None, indices=None, condition=None, selection=False, copy_s
sys = self.duplicate()
#and add this new structure to the graph
sys.to_graph()
sys.copy_defects(self.sample)
else:
sys = self

Expand Down Expand Up @@ -1184,6 +1186,7 @@ def substitute_atoms(
sys = self.duplicate()
#and add this new structure to the graph
sys.to_graph()
sys.copy_defects(self.sample)
else:
sys = self

Expand Down Expand Up @@ -1386,6 +1389,7 @@ def add_interstitial_impurities(
#sys = self.duplicate()
sys = System(source=sys.add_atoms({"positions": randpos, "species": element}))
sys.to_graph()
sys.copy_defects(self.sample)
else:
#sys = self.duplicate()
sys = System(source=self.add_atoms({"positions": randpos, "species": element}))
Expand Down Expand Up @@ -2410,6 +2414,7 @@ def rotate(self, rotation_vectors, graph=None, label=None):
else:
output_structure.label = self.label
output_structure.to_graph()
output_structure.copy_defects(self.sample)
if output_structure.graph is not None:
self.add_rotation_triples(rotation_vectors, output_structure.sample)
return output_structure
Expand Down Expand Up @@ -2467,6 +2472,7 @@ def translate(self, translation_vector,
sys = self.duplicate()
#and add this new structure to the graph
sys.to_graph()
sys.copy_defects(self.sample)
else:
sys = self

Expand Down Expand Up @@ -2518,6 +2524,7 @@ def shear(self, shear_vector,
sys = self.duplicate()
#and add this new structure to the graph
sys.to_graph()
sys.copy_defects(self.sample)
else:
sys = self

Expand Down

0 comments on commit 7706e72

Please sign in to comment.