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#
close()[source]#
Return type:

None

list_data_stems()[source]#

Stems of the data tables present (no oM_Data_ prefix, no _<case>.csv suffix).

Return type:

set

read_dict(stem)[source]#

Return the dimension dict for stem as 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_InputData expects: the same DataFrame the old pd.read_csv + set_index(unnamed columns) code produced. Raises FileNotFoundError if the stem is absent.

Return type:

DataFrame

Parameters:

stem (str)