el1xr_opt.Modules.oM_InputSchema

el1xr_opt.Modules.oM_InputSchema#

el1xr_opt input schema — the naming rules shared by every input backend.

A case is a set of CSV files (or one .duckdb file) that follow two simple naming rules:

  • oM_Dict_<Stem>_<Case>.csv — a dimension list. One column is a plain set (e.g. the list of periods); two or more columns are a relation / membership table (e.g. node-to-zone).

  • oM_Data_<Stem>_<Case>.csv — a data table. The first one or more columns are an unnamed index (period, scenario, load level, or an entity name) and the remaining columns carry the values.

The DuckDB backend stores each table with the same values but needs to remember which leading columns were the (unnamed) index. It does that by renaming those columns to a reserved prefix, __idx0, __idx1, … . On read, any column with that prefix is moved back into the index and its name is cleared again, so the DataFrame is identical to the one the CSV backend produces.

Because the index handling is generic, a new data table — including the heat sector tables listed below — is picked up automatically with no schema change. Adding a new set still needs one line in set_definitions inside oM_InputData.data_processing (that map is model-specific and stays there).

el1xr_opt.Modules.oM_InputSchema.dict_filename(stem, case)[source]#

CSV file name for a dimension dict.

Return type:

str

Parameters:
  • stem (str)

  • case (str)

el1xr_opt.Modules.oM_InputSchema.data_filename(stem, case)[source]#

CSV file name for a data table.

Return type:

str

Parameters:
  • stem (str)

  • case (str)

el1xr_opt.Modules.oM_InputSchema.idx_name(level)[source]#

Reserved DuckDB column name for index level level.

Return type:

str

Parameters:

level (int)

el1xr_opt.Modules.oM_InputSchema.is_idx_col(col)[source]#

True if col is a reserved index column written by the converter.

Return type:

bool

Parameters:

col (object)