Skip to content

Media Utilities

This section documents media-related utilities in ReaxKit. These helpers handle visualization, plotting metadata, and presentation-layer glue used across workflows, without embedding scientific or file-format–specific logic.

The goal of the media utilities is to keep plotting and visual output consistent across the entire toolkit.


Scope of utils/media

Utilities in this folder typically deal with:

  • Plot configuration and defaults
  • Axis labeling and units
  • Figure saving and export conventions
  • Lightweight visualization helpers shared across workflows

They are intentionally analysis-agnostic and file-agnostic.


Typical responsibilities

Plot configuration

Media utilities often centralize:

  • Figure size and DPI defaults
  • Font sizes and label styles
  • Consistent axis labeling rules
  • Legend placement conventions

This ensures that plots generated by different workflows look coherent and publication-ready by default.


Axis and label helpers

Common helpers include:

  • Mapping internal column names β†’ human-readable labels
  • Appending units to axis labels
  • Normalizing time / frame / iteration labels

These are frequently used together with: - utils.convert


Save and export helpers

Media utilities may also handle:

  • Safe figure saving (respecting user-provided paths)
  • File format selection (png, pdf, svg)
  • Avoiding overwriting existing figures
  • Printing clear messages about saved outputs

Movie generation (make_movie)

In addition to static figures, the media utilities also support movie generation via a helper commonly exposed as make_movie.

This utility is used to convert a sequence of rendered frames (images or matplotlib figures) into a video file.


How media utilities fit in the stack

Typical workflow flow:

  1. Workflow parses CLI arguments (--plot, --save)
  2. Analysis computes numerical results
  3. Media utilities:
  4. configure the figure
  5. label axes
  6. render plots
  7. save or display output

This separation keeps workflows thin and avoids duplicated plotting logic.


What media utilities should not do

Media utilities should not:

  • Load or parse ReaxFF files
  • Perform scientific calculations
  • Encode assumptions about specific file formats
  • Contain workflow-specific branching logic

Those responsibilities belong elsewhere.