TypeAtoms¶
-
class
sknano.core.atoms.type_atoms.
TypeAtoms
(atoms=None, **kwargs)[source] [edit on github][source]¶ Bases:
sknano.core.atoms.atoms.Atoms
An
Atoms
sub-class forTypeAtom
s.A container class for
TypeAtom
objects.Parameters: atoms ({None, sequence, TypeAtoms
}, optional) – if notNone
, then a list ofTypeAtom
instance objects or an existingTypeAtoms
instance object.Attributes
M
Total mass of Atoms
.Natoms
Number of atoms in Atoms
.Ntypes
Number of unique types
.atomtypes
Alias for types
.elements
ndarray
ofAtom.element
s.fmtstr
Format string. masses
ndarray
ofAtom.mass
s.symbols
ndarray
ofAtom.symbol
s.typemap
dict
ofTypeAtom.type
s.types
ndarray
ofTypeAtom.type
s.Methods
add_atomtype
(atom)Alias for add_type
.add_atomtypes
([atoms])Alias for add_types
.add_type
(atom)Add atom type to typemap
.add_types
([atoms])Add atom type for each atom in atoms to TypeAtom.typemap
dictionary.append
(atom)assign_unique_types
([from_attr])Assign unique TypeAtom.type
s to eachTypeAtom
inTypeAtoms
from an existing unique atom attribute.clear
()copy
()count
(item)extend
(other)filter
(condition[, invert])Filter Atoms
bycondition
.filtered
(condition[, invert])Return new list of Atoms
filtered bycondition
.get_atoms
([asarray, aslist])Return Atoms
either as list (default) or numpy array or self.get_atomtypes
([asdict])Alias for get_types
.get_types
([asdict])Return list of TypeAtom
TypeAtom.type
s.getattr
(attr[, default, recursive])Get ndarray
of atom attributesattr
.index
(item, *args)insert
(i, atom)mapatomattr
([from_attr, to_attr, attrmap])Set/update atom attribute from another atom attribute with dict. pop
([i])remove
(item)reset_attrs
(**kwargs)Call corresponding reset_attrs
method on each atomreverse
()rezero
([epsilon])Set values with absolute value less than epsilon
to zero.select
([selstr, selstrlist, verbose])Return Atom
orAtoms
from selection command.sort
([key, reverse])todict
()Return dict
of constructor parameters.update_attrs
(**kwargs)Call update_attrs
method on each atom.