molsysmt.form.get_attributes#

molsysmt.form.get_attributes(form, output_type='dictionary', skip_digestion=False)[source]#

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

The function returns a dictionary with all attribute names as keys and True or False as values reporting whether or not the attribute is in the molecular system’s form.

Parameters:
  • form (object) – Argument form.

  • output_type (object, default='dictionary') – Argument output_type.

  • skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.

Returns:

If output_type=='dictionary' a dictionary is returned with all attribute names as keys and booleans as values: True if the attribute is in the input molecular system’s form, False otherwise. If output_type=='list' a list is returned with all attribute names in the molecular system’s form.

Return type:

dict, list

Raises:

NotSupportedFormError – The function raises a NotSupportedFormError in case a molecular system is introduced with a not supported form.

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.

Examples

The following example illustrates the use of the function.

>>> import molsysmt as msm
>>> dict_attributes = msm.form.get_attributes('file:pdb')
>>> dict_attributes['box']
True
>>> dict_attributes['forcefield']
False
>>> dict_attributes = msm.form.get_attributes(['file:pdb','molsysmt.MolecularMechanicsDict'])
>>> dict_attributes['box']
True
>>> dict_attributes['forcefield']
True

User guide

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