el1xr_opt.Modules.oM_InputDuckDBSource#
el1xr_opt DuckDB backend — reads a single <case>.duckdb file.
The file is produced by oM_CsvToDuckDB and holds one table per input
table plus a small metadata table. Data tables store their (originally unnamed)
index levels in reserved __idx0, __idx1, … columns; on read those
columns are moved back into a nameless index so the DataFrame matches what the
CSV backend returns.
- class el1xr_opt.Modules.oM_InputDuckDBSource.DuckDBSource(db_path)[source]#
Bases:
InputSource- property dir_name: str#
- list_data_stems()[source]#
Stems of the data tables present (no
oM_Data_prefix, no_<case>.csvsuffix).- Return type:
set
- read_dict(stem)[source]#
Return the dimension dict for
stemas a plain DataFrame (no index).Returns an empty DataFrame if the dict is absent.
- Return type:
DataFrame- Parameters:
stem (str)
- read_data(stem)[source]#
Return a data table with its leading unnamed columns set as a nameless index.
This is the exact shape
oM_InputDataexpects: the same DataFrame the oldpd.read_csv+set_index(unnamed columns)code produced. RaisesFileNotFoundErrorif the stem is absent.- Return type:
DataFrame- Parameters:
stem (str)