Is element#

Validating whether a given identifier represents a recognized topological element type in MolSysMT.

The function molsysmt.element.is_element() checks if a string or symbol corresponds to a valid structural element tier (atom, group, component, molecule, chain, entity, bond, system).

Added in version 1.0.0.

Basic usage#

Let’s test standard element names against the recognized topological tiers:

import molsysmt as msm
print('Is "atom" an element?:', msm.element.is_element('atom'))
print('Is "group" an element?:', msm.element.is_element('group'))
print('Is "residue" recognized?:', msm.element.is_element('residue'))
print('Is "custom_tier" an element?:', msm.element.is_element('custom_tier'))
Is "atom" an element?: True
Is "group" an element?: True
Is "residue" recognized?: True
Is "custom_tier" an element?: False