repESP.resp_charges_format module

Parsing and writing charges to format handled by the resp program

This is the file expected and created by the resp program (qin and qout arguments). It is specified with the following Fortran formatting: “8F10.6” i.e. eight floating point numbers per line, with 10 characters per number and 6 digits after the decimal point.

Example

The following file describes the charges of a molecule with 14 atoms:

-0.383354  0.192503  0.192503  0.192503 -0.383354  0.192503  0.192503  0.192503
-0.383354  0.192503  0.192503  0.192503  0.129430  0.288107
parse_resp_charges(f: TextIO) → List[repESP.charges.Charge][source]

Parse a file in the resp charges format

Parameters:f (TextIO) – File object opened in read mode containing charges in the resp format.
Raises:InputFormatError – Raised when the file does not follow the expected format.
Returns:List of charges described in the given input file.
Return type:typing.List[Charge]
write_resp_charges(f: TextIO, charges: List[repESP.charges.Charge]) → None[source]

Write given charges to a file in the resp charges format.

Parameters:
  • f (TextIO) – File object to which the supplied charges is to be saved. Must be opened in write mode.
  • charges (typing.List[Charge]) – List of charges to be written to the file.