momentum_output_file_writer

A module containing the writer for the data of a Momentum analysis.

Summary

Classes:

MomentumDataWriter

Class for writing the data of a Momentum analysis to a file.

Reference

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

Bases: BaseWriter

Class for writing the data of a Momentum analysis to a file.

Each row contains the one-based frame index and the scaled norm of the total linear momentum of that frame, reproducing the legacy equipartition.jl output layout.

Parameters:
  • filename (str | None, optional) – The filename to write to. If None, the output is printed to stdout, by default None.

  • mode (str | FileWritingMode, optional) – The writing mode, by default “w”.

write(
data: Np1DNumberArray,
) None[source]

Writes the momentum norms to the file.

Parameters:

data (Np1DNumberArray) – The scaled momentum norms as returned by the run() method.