def _get_id_seq(pos, arr_num):
# from fractions import Fraction
# transfer the atom position into >=0 and <=1
pos = np.around(pos, decimals=10)
func_tofrac = np.vectorize(lambda x: round((x % 1), 3))
o_pos = func_tofrac(pos)
# round_o_pos = np.around(o_pos, decimals=3)
# z, y, x = round_o_pos[:, 2], round_o_pos[:, 1], round_o_pos[:, 0]
z, y, x = o_pos[:, 2], o_pos[:, 1], o_pos[:, 0]
ind_sort = np.lexsort((z, y, x))
id_seq = str(arr_num[ind_sort])
return id_seq
评论列表
文章目录