Package lib :: Package structure :: Package internal :: Module molecules :: Class MolList
[hide private]
[frames] | no frames]

Class MolList

source code


List type data container for holding the different molecules of one model.

Instance Methods [hide private]
 
__repr__(self)
The string representation of the object.
source code
MolContainer instance
add_item(self, mol_name=None, mol_cont=None)
Append the given MolContainer instance to the MolList.
source code
bool
is_empty(self)
Method for testing if this MolList object is empty.
source code
 
from_xml(self, mol_nodes, file_version=1)
Recreate a molecule list data structure from the XML molecule nodes.
source code
MolContainer instance
merge_item(self, mol_name=None, mol_cont=None)
Mege the given MolContainer instance into a pre-existing molecule container.
source code
 
to_xml(self, doc, element)
Create XML elements for each molecule.
source code

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __init__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__repr__(self)
(Representation operator)

source code 

The string representation of the object.

Rather than using the standard Python conventions (either the string representation of the value or the "<...desc...>" notation), a rich-formatted description of the object is given.

Overrides: object.__repr__

add_item(self, mol_name=None, mol_cont=None)

source code 

Append the given MolContainer instance to the MolList.

Parameters:
  • mol_name (int) - The molecule number.
  • mol_cont (MolContainer instance) - The data structure for the molecule.
Returns: MolContainer instance
The new molecule container.

is_empty(self)

source code 

Method for testing if this MolList object is empty.

Returns: bool
True if this list only has one MolContainer and the molecule name has not been set, False otherwise.

from_xml(self, mol_nodes, file_version=1)

source code 

Recreate a molecule list data structure from the XML molecule nodes.

Parameters:
  • mol_nodes (xml.dom.minicompat.NodeList instance) - The molecule XML nodes.
  • file_version (int) - The relax XML version of the XML file.

merge_item(self, mol_name=None, mol_cont=None)

source code 

Mege the given MolContainer instance into a pre-existing molecule container.

Parameters:
  • mol_name (int) - The molecule number.
  • mol_cont (MolContainer instance) - The data structure for the molecule.
Returns: MolContainer instance
The new molecule container.

to_xml(self, doc, element)

source code 

Create XML elements for each molecule.

Parameters:
  • doc (xml.dom.minidom.Document instance) - The XML document object.
  • element (XML element object) - The element to add the molecule XML elements to.