topo.reporter package¶
Submodules¶
topo.reporter.topo_reporter module¶
- topo.reporter.topo_reporter.readOpenMMReporterFile(reporter_file)[source]¶
Read a fixed-width TOPO/OpenMM log into a
{column_name: [values...]}dict.The first line is the
#-commented header. Columns are separated by runs of two or more spaces (so multi-word headers likePotential Energy (kJ/mole)stay intact), and numeric data rows are split on whitespace.- Parameters:
reporter_file (str) – Path to the reporter output file.
- class topo.reporter.topo_reporter.topoReporter(file, reportInterval, sbmObject=None, precision=4, width=14, **kwargs)[source]¶
Bases:
StateDataReporterA
StateDataReporterthat writes a clean, fixed-width log.Compared with OpenMM’s reporter this adds:
precision– floating-point columns are written with a fixed number of decimals instead of fullreprprecision.width– every column is padded to a fixed width so the columns line up (each column usesmax(len(header), width), so long headers still fit).sbmObject– optionally append one energy column per force group of a TOPO system object.
The header line is written as a
#comment, and columns are separated by theseparatorstring (use two spaces for a readable, machine-parsable log; seereadOpenMMReporterFile()).For background on custom reporters see: http://docs.openmm.org/latest/userguide/application/04_advanced_sim_examples.html#extracting-and-reporting-forces-and-other-data
- _constructHeaders()[source]¶
Headers from the base reporter, plus one per force group when requested.
- _constructReportValues(simulation, state)[source]¶
Base report values, plus per-force-group energies when requested.
- _format_header(headers)[source]¶
Format the header line, marked as a comment.
- Parameters:
headers (list of str) – Column header names.
- Returns:
An OpenMM-style quoted, separator-joined comment line when no width is set; otherwise a right-justified fixed-width line whose leading space is replaced by
#.- Return type:
str
Module contents¶
reporter package of the TOPO package that contains the topoReporter class.
The topo.reporter package contains the topoReporter class.
topoReporter is a special class of the OpenMM StateDataReporter class, that additionally accepts a topo system object to print the force group energies.