Is item#
Validating whether an object is a recognized molecular system item of any supported form.
The function molsysmt.form.is_item() inspects a Python object and checks if it conforms to any registered form in MolSysMT.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.form.is_item().
Basic usage#
Let’s test objects against recognized item forms:
import molsysmt as msm
molsys = msm.convert(msm.systems['Barnase-Barstar']['barnase_barstar.h5msm'])
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
print('Is molsys instance an item?:', msm.form.is_item(molsys))
print('Is file path an item?:', msm.form.is_item(msm.systems['Barnase-Barstar']['barnase_barstar.h5msm']))
print('Is plain integer an item?:', msm.form.is_item(42))
print('Is arbitrary dictionary an item?:', msm.form.is_item({'foo': 'bar'}))
Is molsys instance an item?: True
Is file path an item?: True
Is plain integer an item?: False
Is arbitrary dictionary an item?: False
See also
Related Tools & References
Is file: Check file form status with
molsysmt.form.is_file().Is string: Check string form status with
molsysmt.form.is_string().