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

Facade class that manages writing data to various file formats. More...

#include <FileWriter.hpp>

Collaboration diagram for correlation::writers::FileWriter:

Public Member Functions

 FileWriter (const correlation::analysis::DistributionFunctions &dists)
 Constructs a FileWriter linked to a DistributionFunctions object.
void write (const std::string &base_path, bool use_csv, bool use_hdf5, bool use_parquet, bool smoothing) const
 Writes the available histograms using specified formats.
std::expected< void, std::string > writeBundle (const std::string &zip_path, bool use_csv=true, bool use_hdf5=false, bool use_parquet=false, bool include_svg=true, bool smoothing=true, const std::vector< std::string > &selected_algorithms={}) const
 Writes a consolidated ZIP bundle containing plots, tables, and summary.
std::expected< void, std::string > writeFolder (const std::string &dest_dir, bool use_csv=true, bool use_hdf5=false, bool use_parquet=false, bool include_svg=true, bool smoothing=true, const std::vector< std::string > &selected_algorithms={}) const
 Writes analysis outputs into categorized subfolders within a destination folder.

Private Member Functions

void writeSummaryFile (const std::string &base_path) const

Private Attributes

const correlation::analysis::DistributionFunctions * df_ = nullptr
 Pointer to the analysis data structure.

Detailed Description

Facade class that manages writing data to various file formats.

This class orchestrates the usage of specific writers (CSV, HDF5, Parquet) based on provided options.

Constructor & Destructor Documentation

◆ FileWriter()

correlation::writers::FileWriter::FileWriter ( const correlation::analysis::DistributionFunctions & dists)
explicit

Constructs a FileWriter linked to a DistributionFunctions object.

Parameters
distsThe DistributionFunctions object containing the data to be written.

Member Function Documentation

◆ write()

void correlation::writers::FileWriter::write ( const std::string & base_path,
bool use_csv,
bool use_hdf5,
bool use_parquet,
bool smoothing ) const

Writes the available histograms using specified formats.

Parameters
base_pathThe base name for the output files (e.g., "output/my_sample").
use_csvWhether to write CSV files.
use_hdf5Whether to write an HDF5 file.
use_parquetWhether to write Parquet files.
smoothingWhether to include smoothed data.
Here is the call graph for this function:

◆ writeBundle()

std::expected< void, std::string > correlation::writers::FileWriter::writeBundle ( const std::string & zip_path,
bool use_csv = true,
bool use_hdf5 = false,
bool use_parquet = false,
bool include_svg = true,
bool smoothing = true,
const std::vector< std::string > & selected_algorithms = {} ) const

Writes a consolidated ZIP bundle containing plots, tables, and summary.

Parameters
zip_pathThe target path for the zip file (e.g., "output/bundle.zip").
use_csvWhether to include CSV tables.
use_hdf5Whether to include HDF5 data.
use_parquetWhether to include Parquet data.
include_svgWhether to include SVG plots.
smoothingWhether to include smoothed curves.
Returns
std::expected<void, std::string> Success or error message.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeFolder()

std::expected< void, std::string > correlation::writers::FileWriter::writeFolder ( const std::string & dest_dir,
bool use_csv = true,
bool use_hdf5 = false,
bool use_parquet = false,
bool include_svg = true,
bool smoothing = true,
const std::vector< std::string > & selected_algorithms = {} ) const

Writes analysis outputs into categorized subfolders within a destination folder.

Parameters
dest_dirDestination directory path.
use_csvWhether to include CSV tables in csv/.
use_hdf5Whether to include HDF5 data in hdf5/.
use_parquetWhether to include Parquet data in arrow/.
include_svgWhether to include SVG plots in plots/.
smoothingWhether to include smoothed curves.
selected_algorithmsOptional filter list of algorithms to export (empty for all).
Returns
std::expected<void, std::string> Success or error message.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeSummaryFile()

void correlation::writers::FileWriter::writeSummaryFile ( const std::string & base_path) const
private
Here is the caller graph for this function:

Member Data Documentation

◆ df_

const correlation::analysis::DistributionFunctions* correlation::writers::FileWriter::df_ = nullptr
private

Pointer to the analysis data structure.


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