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 (str, list or tuple of str) – Any of the supported forms by MolSysMT, or a list of them.
output_type ({'dictionary', 'list'}, default 'dictionary')
- 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. Ifoutput_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:mmtf') >>> dict_attributes['box'] True >>> dict_attributes['forcefield'] False >>> dict_attributes = msm.form.get_attributes(['file:mmtf','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.