pydft_qmmm.utils.logging

Utilities for logging energies and positions and related types.

Functions

make_csv_handler(output_directory[, ...])

Create a handler for logging to CSV files.

make_dcd_handler(output_directory[, ...])

Create a handler for logging to DCD files.

make_file_handler(output_directory, suffix, ...)

Create a handler for logging to files.

make_log_handler(output_directory[, ...])

Create a handler for logging to log files.

pydft_qmmm.utils.logging.make_csv_handler(output_directory, decimal_places=3, interval=1)[source]

Create a handler for logging to CSV files.

Parameters:
  • output_directory (str) – A directory where records are written.

  • decimal_places (int, default: 3) – The number of decimal places to include when logging to a CSV file.

  • interval (int, default: 1) – The interval at which to write logs in terms of simulation steps.

Return type:

Handler

Returns:

A CSV file handler.

pydft_qmmm.utils.logging.make_dcd_handler(output_directory, interval=1, timestep=1)[source]

Create a handler for logging to DCD files.

Parameters:
  • output_directory (str) – A directory where records are written.

  • interval (int, default: 1) – The interval at which to write logs in terms of simulation steps.

  • timestep (int | float, default: 1) – The timestep (\(\mathrm{fs}\)) of the simulation.

Return type:

Handler

Returns:

A DCD file handler.

pydft_qmmm.utils.logging.make_file_handler(output_directory, suffix, formatter, filter_)[source]

Create a handler for logging to files.

Parameters:
  • output_directory (str) – A directory where records are written.

  • suffix (str) – A file extension.

  • formatter (Formatter) – A formatter to apply to records.

  • filter – A filter to apply to records.

  • filter_ (Filter)

Return type:

Handler

Returns:

The file handler applying the specified filters and formatters.

pydft_qmmm.utils.logging.make_log_handler(output_directory, decimal_places=3, interval=1)[source]

Create a handler for logging to log files.

Parameters:
  • output_directory (str) – A directory where records are written.

  • decimal_places (int, default: 3) – The number of decimal places to include when logging to a log file.

  • interval (int, default: 1) – The interval at which to write logs in terms of simulation steps.

Return type:

Handler

Returns:

A log file handler.

Classes

DCDHandler(filename, interval, timestep[, mode])

Handler for writing position data to a DCD file.

EnergyRecord(name, level, pathname, lineno, ...)

A log record with an energy data.

FrameRecord(name, level, pathname, lineno, ...)

A log record with a frame data.

Loggable([output_directory, log_write, ...])

A mix-in for generating logging handlers.

PositionRecord(name, level, pathname, ...[, ...])

A log record with an position data.

PyDFTQMMMCSVFormatter([fmt, datefmt, style, ...])

Logging formatter that formats energy outputs to CSV files.

PyDFTQMMMEnergyFilter(interval)

Logging filter that grabs logs with an energy attribute.

PyDFTQMMMIntervalFilter(interval)

Logging filter that grabs logs at a given interval.

PyDFTQMMMLogFormatter([fmt, datefmt, style, ...])

Logging formatter that formats energy outputs to log files.

PyDFTQMMMPositionFilter(interval)

Logging filter that grab logs with position data.