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
评论列表
文章目录