def dummy_molecule(): """ A virtually empty molecule. """ molecule = vermouth.Molecule() molecule.add_nodes_from(( (0, { 'atype': 'A', 'resid': 1, 'resname': 'X', 'atomname': 'A', 'charge_group': 1, 'charge': 0, 'mass': 72 }), (1, { 'atype': 'A', 'resid': 1, 'resname': 'X', 'atomname': 'A', 'charge_group': 1, 'charge': 0, 'mass': 72 }), )) molecule.moltype = 'TEST' molecule.nrexcl = 1 return molecule
def basic_molecule(node_data, edge_data=None): """ Construct a simple Molecule based with specified nodes and edges. """ if edge_data is None: edge_data = {} mol = vermouth.Molecule() for idx, node in enumerate(node_data): mol.add_node(idx, **node) for (idx, jdx), data in edge_data.items(): mol.add_edge(idx, jdx, **data) return mol