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 CsvTable | Load (const std::string &path, bool has_header=true) |
| |
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).
◆ Load()
| static CsvTable pulsatrix::CsvReader::Load |
( |
const std::string & |
path, |
|
|
bool |
has_header = true |
|
) |
| |
|
static |
- Parameters
-
- Returns
- The parsed table.
- Exceptions
-
| std::runtime_error | if 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: