Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::writers::ArrowWriter Class Reference

Manages the writing of distribution function data to Parquet files via Apache Arrow. More...

#include <ArrowWriter.hpp>

Inheritance diagram for correlation::writers::ArrowWriter:
Collaboration diagram for correlation::writers::ArrowWriter:

Public Member Functions

 ArrowWriter ()=default
std::string getName () const override
 Returns the display name of the format (e.g., "HDF5", "CSV").
std::vector< std::string > getExtensions () const override
 Returns a list of supported file extensions (e.g., {".h5"}, {".csv"}).
void write (const std::string &base_path, const correlation::analysis::DistributionFunctions &dists, bool smoothing) const override
 Writes the distribution function data to file(s).
Public Member Functions inherited from correlation::writers::BaseWriter
 BaseWriter ()=default
virtual ~BaseWriter ()=default
 BaseWriter (const BaseWriter &)=delete
BaseWriter & operator= (const BaseWriter &)=delete
 BaseWriter (BaseWriter &&)=delete
BaseWriter & operator= (BaseWriter &&)=delete

Static Public Member Functions

static void writeAllParquet (const std::string &base_path, const correlation::analysis::DistributionFunctions &dists, bool write_smoothed=false)
 Writes all available histograms to Parquet files.

Static Private Member Functions

static void writeHistogramToParquet (const std::string &filename, const correlation::analysis::Histogram &hist, const correlation::analysis::Histogram *raw_companion=nullptr)
 The core implementation for writing a single histogram and its smoothed histograms to a single Parquet file.

Detailed Description

Manages the writing of distribution function data to Parquet files via Apache Arrow.

This class takes a DistributionFunctions object and provides methods to write the calculated histograms to Parquet files.

Constructor & Destructor Documentation

◆ ArrowWriter()

correlation::writers::ArrowWriter::ArrowWriter ( )
default

Member Function Documentation

◆ getExtensions()

std::vector< std::string > correlation::writers::ArrowWriter::getExtensions ( ) const
inlineoverridevirtual

Returns a list of supported file extensions (e.g., {".h5"}, {".csv"}).

Returns
A vector of extension strings including the dot.

Implements correlation::writers::BaseWriter.

◆ getName()

std::string correlation::writers::ArrowWriter::getName ( ) const
inlineoverridevirtual

Returns the display name of the format (e.g., "HDF5", "CSV").

Returns
A human-readable name for the writer format.

Implements correlation::writers::BaseWriter.

◆ write()

void correlation::writers::ArrowWriter::write ( const std::string & base_path,
const correlation::analysis::DistributionFunctions & dists,
bool smoothing ) const
inlineoverridevirtual

Writes the distribution function data to file(s).

Parameters
base_pathThe base name for the output files.
distsThe DistributionFunctions object containing the data.
smoothingWhether to include smoothed data.

Implements correlation::writers::BaseWriter.

Here is the call graph for this function:

◆ writeAllParquet()

void correlation::writers::ArrowWriter::writeAllParquet ( const std::string & base_path,
const correlation::analysis::DistributionFunctions & dists,
bool write_smoothed = false )
static

Writes all available histograms to Parquet files.

For each histogram in the DistributionFunctions object (e.g., "g(r)"), this method will create a corresponding Parquet file (e.g., "base_path_g.parquet").

Parameters
base_pathThe base name for the output files (e.g., "output/my_sample").
distsThe DistributionFunctions object containing the data.
write_smoothedIf true, also writes smoothed data columns.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHistogramToParquet()

void correlation::writers::ArrowWriter::writeHistogramToParquet ( const std::string & filename,
const correlation::analysis::Histogram & hist,
const correlation::analysis::Histogram * raw_companion = nullptr )
staticprivate

The core implementation for writing a single histogram and its smoothed histograms to a single Parquet file.

Parameters
filenameThe full path of the file to write.
histThe Histogram data structure to write.
raw_companionOptional pointer to a raw-count companion histogram (e.g. PAD_raw for PAD). When non-null, its partials are prepended as {key}_raw columns before the normalized data.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: