fast_forward.itp_parser_sub module¶
- class fast_forward.itp_parser_sub.FastForwardITPParser(*args, **kwargs)[source]¶
Bases:
ITPDirectorSame as the ITP parser but allows stashing of comments with interactions.
- METH_DICT = {('macros',): (<function SectionLineParser._macros>, {}), ('moleculetype',): (<function ITPDirector._block>, {}), ('moleculetype', 'angle_restraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'angle_restraints_z'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'angles'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'atoms'): (<function ITPDirector._block_atoms>, {}), ('moleculetype', 'bonds'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'cmap'): (<function ITPDirector._skip>, {}), ('moleculetype', 'constraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'dihedral_restraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'dihedrals'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'distance_restraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'exclusions'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'impropers'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'orientation_restraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'pairs'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'pairs_nb'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'position_restraints'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'settles'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'virtual_sites1'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'virtual_sites2'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'virtual_sites3'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'virtual_sites4'): (<function ITPDirector._interactions>, {}), ('moleculetype', 'virtual_sitesn'): (<function ITPDirector._interactions>, {})}¶
A dict of all known parser methods, mapping section names to the function to be called and the associated keyword arguments.
- parse(file_handle)[source]¶
Reads lines from file_handle, and calls
dispatch()to find which method to call to do the actual parsing. Yields the result of that call, if it’s not None. At the end, callsfinalize()., and yields its results, iff it’s not None. :param file_handle: The data to parse. Should produce lines of data. :type file_handle: collections.abc.Iterable[str]- Yields:
object – The results of dispatching to parsing methods, and of
finalize().
- fast_forward.itp_parser_sub.guess_interactions(block)[source]¶
From the bonds described in a block’s interactions, generate all possible angles and dihedrals.
block:
vermouth.molecule.Block