pulsatrix
Loading...
Searching...
No Matches
pulsatrix::CsvReader Class Reference

Minimal RFC-4180-ish CSV parser: comma-delimited, double-quote-quoted fields, "" as an escaped quote,
or \r
line endings. Whole file loaded into memory at once – no streaming/chunked reading in this phase, matching MnistIdxLoader's own whole-file-at-once precedent. More...

#include <csv_reader.hpp>

Static Public Member Functions

static CsvTable Load (const std::string &path, bool has_header=true)
 

Detailed Description

Minimal RFC-4180-ish CSV parser: comma-delimited, double-quote-quoted fields, "" as an escaped quote,
or \r
line endings. Whole file loaded into memory at once – no streaming/chunked reading in this phase, matching MnistIdxLoader's own whole-file-at-once precedent.

Note
Chosen over fetching Arrow C++ (campaign_exai_dl_library_data_pipeline Decision Point 1): Arrow's columnar/zero-copy value proposition doesn't apply to this row-oriented, float32-only, small-scale use case, and would break this project's minimal-FetchContent discipline (GoogleTest + optional pybind11 only, today).

Member Function Documentation

◆ Load()

static CsvTable pulsatrix::CsvReader::Load ( const std::string &  path,
bool  has_header = true 
)
static
Parameters
pathPath to the CSV file.
has_headerWhether row 0 is a header (excluded from CsvTable::rows, stored in CsvTable::header instead).
Returns
The parsed table.
Exceptions
std::runtime_errorif the file can't be opened, a quoted field is never closed, has_header is true but the file has no rows at all, or any data row's field count doesn't match the header's (or, with no header, the first row's) field count – external boundary: malformed file content, not an internal invariant.

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