topology_file_writer

A module for writing topology files containing bonded information for the PQ and QMCFC MD software packages. For more information about the topology file structure please visit the documentation page of PQ https://molarverse.github.io/PQ/.

Summary

Classes:

TopologyFileWriter

Class for writing topology files containing bonded information for the PQ and QMCFC MD software packages.

Reference

class TopologyFileWriter(
filename: str | None = None,
mode: str | FileWritingMode = 'w',
)[source]

Bases: BaseWriter

Class for writing topology files containing bonded information for the PQ and QMCFC MD software packages. For more information about the topology file structure please visit the documentation page of PQ https://molarverse.github.io/PQ/.

Parameters:
  • filename (str, optional) – The name of the topology file, Default is None, which means that the output is printed to stdout.

  • mode (str | FileWritingMode, optional) – The writing mode. Default is “w”. The writing mode can be either a string or a FileWritingMode enum value. Possible values are: - “w” or FileWritingMode.WRITE: write mode (default, no overwrite) - “a” or FileWritingMode.APPEND: append mode - “o” or FileWritingMode.OVERWRITE: overwrite mode

write(
bonded_topology: Topology | BondedTopology,
) None[source]

Writes the bonded topology to the file.

Parameters:

bonded_topology (Topology | BondedTopology) – The bonded topology to write to the file. If a Topology object is provided, the bonded topology will be extracted from it.

Raises:

ValueError – If the bonded topology is not a Topology or BondedTopology object.

logger = <CustomLogger PQAnalysis.TopologyFileWriter (INFO)>