Skip to content

Commit 0470478

Browse files
committed
Update invcryrep.py
1 parent 1ba802e commit 0470478

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

invcryrep/invcryrep/invcryrep.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def get_slices3(atom_symbols,edge_indices,to_jimages):
672672
if strategy==3:
673673
return get_slices3(atom_symbols,edge_indices,to_jimages)
674674

675-
def structure2SLICESAug(self,structure,strategy=3,num=40):
675+
def structure2SLICESAug(self,structure,strategy=3,num=200):
676676
"""
677677
(1) extract edge_indices, to_jimages and atom_types from a pymatgen structure object
678678
(2) encoding edge_indices, to_jimages and atom_types into multiple equalivent SLICES strings
@@ -743,7 +743,7 @@ def get_slices3(atom_symbols,edge_indices,to_jimages):
743743
if strategy==3:
744744
SLICES_list.append(get_slices3(atom_symbols,edge_indices,to_jimages))
745745
#calcualte how many element and edge permuatations needed. round((n/6)**(1/2))
746-
num_permutation=round((num/6)**(1/3))
746+
num_permutation=int(math.ceil((num/6)**(1/3)))
747747
# shuffle to get permu
748748
permu=[]
749749
for i in range(num):
@@ -817,7 +817,8 @@ def remove_duplicate_arrays(arrays):
817817
SLICES_list.append(get_slices2(atom_symbols_new,edge_indices_new_final_flip,to_jimages_shu_trans_per_trans_final_flip))
818818
if strategy==3:
819819
SLICES_list.append(get_slices3(atom_symbols_new,edge_indices_new_final_flip,to_jimages_shu_trans_per_trans_final_flip))
820-
return SLICES_list
820+
random.shuffle(SLICES_list)
821+
return SLICES_list[:num]
821822

822823
def get_dim(self,structure):
823824
"""

0 commit comments

Comments
 (0)