synthesis.py 文件源码

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

项目:smhr 作者: andycasey 项目源码 文件源码
def _verify_species(self, elements):
        # Format the elements and then check that all are real.
        if isinstance(elements, string_types):
            elements = [elements]

        elements = [str(element).title() for element in elements]
        species = []
        transitions = self.transitions
        for element in elements:
            # Get the species associated with this element
            ii = np.logical_or(
                transitions["elem1"] == element,
                transitions["elem2"] == element)

            # Note plurality/singularity of specie/species.
            # APJ modified to remove isotopes in species
            specie = transitions[ii]["species"]
            specie = (specie*10).astype(int)/10.0
            specie = list(np.unique(specie))
            species.append(specie)

        return species
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号