sknano.core.atoms.TypeAtoms.assign_unique_types

TypeAtoms.assign_unique_types(from_attr='element')[source][source]

Assign unique TypeAtom.types to each TypeAtom in TypeAtoms from an existing unique atom attribute.

Changed in version 0.3.11: Now accepts a keyword argument from_attr.

The assignment of unique TypeAtom.types is performed by mapping an existing atom attribute (default: element) to a unique integer, starting at 1.

Parameters:

from_attr : str

An existing atom attribute used to generate an attribute mapping that maps the attribute to a unique atom type.