mario.Database.add_sectors#

Database.add_sectors(io='inventories', scenario='baseline', inplace=True, split=False, keep_all_split_steps=False, notes=None, ignore_warnings=True, cvxlab_path=None, input_data_files_type='xlsx', only_input_data_gen=False, solver=None, solver_parameters=None, parent_name=None, parent_names=None)#

Apply the add-sectors workbook to the selected scenario.

Parameters:
  • io – Either a workbook path or the special value "inventories". When a path is provided, MARIO reads workbook metadata and grouped inventory sheets from that file first. When "inventories" is used, the caller is expected to have already loaded workbook state with read_add_sectors_excel(...) / read_inventory_sheets(...).

  • scenario – Scenario to read the source coefficient blocks from.

  • inplace – When False, return a modified copy. When True, the method mutates the current database and returns None.

  • notes – Optional metadata notes appended to the database history.

  • ignore_warnings – Passed through to the engine for the handful of cases where the historical workflow intentionally muted warnings.

  • split – When True and the table is an IOT, run the split workflow after the standard coefficient-side insertion.

  • keep_all_split_steps – When False and split=True, keep only the final available split result as baseline and discard intermediate scenarios such as original, split_<scenario>, and split_cvxlab. When True, preserve all intermediate split scenarios.

  • cvxlab_path – Directory where MARIO should generate the CVXLab model directory.

  • input_data_files_type – Format for the generated CVXLab input files. "xlsx" is fully supported. "csv" is available only for input-data generation.

  • only_input_data_gen – When True, stop after generating the CVXLab model directory and input data. No optimization run is executed.

  • solver – Optional solver passed through to CVXLab.

  • solver_parameters – Optional solver keyword arguments passed to CVXLab. When provided, they are forwarded as mosek_params to preserve the historical MARIO split workflow.

  • parent_name – Optional new label for the residual parent sector when exactly one parent sector is being split.

  • parent_names – Optional mapping of split child sector or parent sector -> new parent label. This is useful when you want the residual parent sector to be renamed after the split, for example {"Non metallic minerals": "Other non metallic minerals"}.

Notes

The workbook-driven non-split insertion always runs first. If split=True for an IOT, MARIO then builds a deterministic split_<scenario> flow scenario and optionally hands it to CVXLab. By default, the final available split scenario is then promoted back to baseline.