yaml.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:ababe 作者: unkcpz 项目源码 文件源码
def __init__(self, gcell):
        self.lattice = np.around(gcell.lattice, decimals=6)
        self.positions = np.around(gcell.positions, decimals=6)
        self.numbers = gcell.numbers

        atoms_name_list = list(map(lambda x: Specie.to_name(x),
                                   list(self.numbers)))
        d = Counter(atoms_name_list)
        ordered_atoms = OrderedDict(sorted(d.items(),
                                           key=lambda x: Specie(x[0]).Z))
        # remove Ghostatoms
        if 'G' in ordered_atoms:
            del ordered_atoms['G']

        self.comment = ''.join(['{}{}'.format(k, v)
                               for k, v in ordered_atoms.items()])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号