cost_eco_model_linker.handlers.spreadsheet_interface ==================================================== .. py:module:: cost_eco_model_linker.handlers.spreadsheet_interface Functions --------- .. autoapisummary:: cost_eco_model_linker.handlers.spreadsheet_interface.get_industry_codes cost_eco_model_linker.handlers.spreadsheet_interface.find_table cost_eco_model_linker.handlers.spreadsheet_interface.find_cost_table cost_eco_model_linker.handlers.spreadsheet_interface.create_eia_template cost_eco_model_linker.handlers.spreadsheet_interface.find_or_fill_row cost_eco_model_linker.handlers.spreadsheet_interface.create_cost_filters cost_eco_model_linker.handlers.spreadsheet_interface.fill_industry_costs cost_eco_model_linker.handlers.spreadsheet_interface.fill_opex cost_eco_model_linker.handlers.spreadsheet_interface.fill_capex cost_eco_model_linker.handlers.spreadsheet_interface.fill_total_costs cost_eco_model_linker.handlers.spreadsheet_interface.fill_EIA_info Module Contents --------------- .. py:function:: get_industry_codes(ws: win32com.client.CDispatch) Retrieve industry classification codes found in the given worksheet. :param ws: Excel WorkSheet object :type ws: win32com.client.CDispatch :rtype: List of industry classification codes .. py:function:: 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. :param ws: Excel worksheet :type ws: w32client.CDispatch :param first_header: Header of first column :type first_header: str .. py:function:: 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. :param ws: Excel worksheet :type ws: w32client.CDispatch .. py:function:: create_eia_template(wb) .. py:function:: 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). .. py:function:: create_cost_filters(cost_type_df, attribution=None) Returns dict of common filter combinations .. py:function:: fill_industry_costs(eia_template, next_idx, df, ind_codes, unique_ind_codes, cost_filter) Single-pass update of industry costs in EIA template .. py:function:: fill_opex(it, year, dest, port, eia_template, wb, expense, attribution=None) attribution : One of ["COLLECT", "RETURN", None], see `Attribution` column in Excel worksheets. .. py:function:: fill_capex(it, year, dest, port, eia_template, wb, expense, attribution=None) attribution : One of ["COLLECT", "RETURN"], see `Attribution` column in Excel worksheets. .. py:function:: fill_total_costs(it, year, dest, port, eia_template, prefix) Create total row by summing CAPEX and OPEX rows. :param prefix: Prefix for expense names (e.g., "3.0_Production" or "4.0_Deployment") :type prefix: str .. py:function:: fill_EIA_info(prod_wb, deploy_wb, it: int, year: int, dest: str, port: str, eia_template: pandas.DataFrame)