molsysmt.form.has_attribute#

molsysmt.form.has_attribute(form, attribute, skip_digestion=False)[source]#

Checking if a molecular systems’form has a certain attribute.

The function returns True if the attribute is found in the molecular system’s form, and False otherwise.

Parameters:
  • form (str, list or tuple of str) – Any of the supported forms by MolSysMT, or a list of them.

  • attribute (str) – The attribute name to be checked in the molecular system.

Returns:

The function returns a boolean value reporting whether or not the attribute is found in the molecular system.

Return type:

bool

Added in version 0.8.3.

Notes

The list of supported molecular systems’ forms is detailed in the documentation section User Guide > Introduction > Molecular systems > Forms.

See also

molsysmt.form.get_attributes()

Getting the list of attributes of a molecular system’s for’s form.

molsysmt.basic.get_attributes()

Getting the list of attributes of a molecular system.

molsysmt.basic.has_attribute()

Checking if a molecular system has a certain attribute.

Examples

The following example illustrates the use of the function.

>>> import molsysmt as msm
>>> msm.form.has_attribute('file:mmtf', 'box')
True
>>> msm.form.has_attribute('file:mmtf', 'forcefield')
False
>>> msm.form.has_attribute(['file:mmtf','molsysmt.MoleculeMechanicsDict'], 'forcefield')
True

User guide

Follow this link for a tutorial on how to work with this function: User Guide > Tools > Form > Has attribute.