molsysmt.element.atom.is_atom_type#

molsysmt.element.atom.is_atom_type(atom_type, skip_digestion=False)[source]#

Checking whether strings are canonical chemical element atom types.

Parameters:
  • atom_type (str, list of str, tuple of str or numpy.ndarray) – Chemical element symbol or one-dimensional collection of symbols. Capitalization is significant: 'Ca' is calcium; 'CA' is not.

  • skip_digestion (bool, default=False) – Whether to skip argument digestion. Default is False.

Returns:

A boolean for a scalar string, or a one-dimensional boolean array in input order. An empty collection returns an array of shape (0,).

Return type:

bool or numpy.ndarray

Raises:

ArgumentError – If input is not a string or a one-dimensional collection of strings.

Notes

Checks the 118 chemical element symbols. Atom names, force-field types, dummy particles (Du, X), unknown markers and isotope aliases (D, T) are not canonical chemical atom types. Use normalize_atom_types() for the two hydrogen isotope aliases.

See also

normalize_atom_types

Normalize explicit isotope aliases.

get_atom_type_from_atom_name

Infer elements from standard atom names.

Examples

>>> import molsysmt as msm
>>> msm.element.atom.is_atom_type('Ca')
True
>>> msm.element.atom.is_atom_type(['C', 'CA', 'OA', 'D']).tolist()
[True, False, False, False]

Tutorial with more examples

See Checking and normalizing atom types for element and isotope conventions.

Added in version 1.0.0.