cost_eco_model_linker.handlers.spreadsheet_interface¶
Functions¶
Retrieve industry classification codes found in the given worksheet. |
|
|
Identifies and retrieves table in a given worksheet identified by its first header. |
|
Identifies and retrieves cost table based on initial header "Amount". |
|
Attempts to identify the matching row. If none found, adds a new row. |
|
Returns dict of common filter combinations. |
|
Single-pass update of industry costs in EIA template. Accumulates into existing values. |
|
attribution : One of ["COLLECT", "RETURN", None], see Attribution column in Excel worksheets. |
|
attribution : One of ["COLLECT", "RETURN"], see Attribution column in Excel worksheets. |
|
Fill EIA template with cost data. |
Module Contents¶
- cost_eco_model_linker.handlers.spreadsheet_interface.get_industry_codes(ws: win32com.client.CDispatch)¶
Retrieve industry classification codes found in the given worksheet.
- Parameters:
ws (win32com.client.CDispatch) – Excel WorkSheet object
- Return type:
List of industry classification codes
- cost_eco_model_linker.handlers.spreadsheet_interface.find_table(ws: win32com.client.CDispatch, first_header: str) pandas.DataFrame¶
Identifies and retrieves table in a given worksheet identified by its first header. Selects contiguous data regions.
Note: Drops NA rows.
- Parameters:
ws (w32client.CDispatch) – Excel worksheet
first_header (str) – Header of first column
- cost_eco_model_linker.handlers.spreadsheet_interface.find_cost_table(ws: win32com.client.CDispatch) pandas.DataFrame¶
Identifies and retrieves cost table based on initial header “Amount”. Selects contiguous data regions.
Note: Drops NA rows.
- Parameters:
ws (w32client.CDispatch) – Excel worksheet
- cost_eco_model_linker.handlers.spreadsheet_interface.create_eia_template(wb)¶
- cost_eco_model_linker.handlers.spreadsheet_interface.find_or_fill_row(eia_template, it, year, dest, port, expense)¶
Attempts to identify the matching row. If none found, adds a new row. Returns the row ID (of the existing row, or the new row).
- cost_eco_model_linker.handlers.spreadsheet_interface.create_cost_filters(cost_type_df, attribution=None)¶
Returns dict of common filter combinations.
Filters based on entries in the Type column in CAPEX and OPEX spreadsheets of the cost models.
- cost_eco_model_linker.handlers.spreadsheet_interface.fill_industry_costs(eia_template, next_idx, df, ind_codes, unique_ind_codes, cost_filter)¶
Single-pass update of industry costs in EIA template. Accumulates into existing values.
- cost_eco_model_linker.handlers.spreadsheet_interface.fill_opex(it, _, year, dest, port, eia_template, wb, attribution=None)¶
attribution : One of [“COLLECT”, “RETURN”, None], see Attribution column in Excel worksheets.
- cost_eco_model_linker.handlers.spreadsheet_interface.fill_capex(it, _, year, dest, port, eia_template, wb, attribution=None)¶
attribution : One of [“COLLECT”, “RETURN”], see Attribution column in Excel worksheets.
- cost_eco_model_linker.handlers.spreadsheet_interface.fill_EIA_info(prod_wb, deploy_wb, it: int, iv_start_year: int, year: int, dest: str, port: str, eia_template: pandas.DataFrame)¶
Fill EIA template with cost data.
- Parameters:
prod_wb – Production model
deploy_wb – Deployment model
it (int) – ReefMod Engine Iteration ID
iv_start_year (int) – Year interventions begin
year (int) – Simulation year
dest (str) – Deployment destination
port (str) – Port where deployments launched from
eia_template (pd.DataFrame) – Template to fill