From ffa2a29ba8f0c2a5db1ea61dcd9c31d2c6f166f0 Mon Sep 17 00:00:00 2001 From: Olexandr Balyk Date: Wed, 13 Mar 2024 16:48:34 -0500 Subject: [PATCH] Remove duplicated code --- xl2times/transforms.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/xl2times/transforms.py b/xl2times/transforms.py index 11edc0a..8afa2ba 100644 --- a/xl2times/transforms.py +++ b/xl2times/transforms.py @@ -403,32 +403,6 @@ def merge_tables( return result -def apply_composite_tag(table: datatypes.EmbeddedXlTable) -> datatypes.EmbeddedXlTable: - """ - Handles table level declarations. Declarations can be included in the table - tag and will apply to all data that doesn't have a different value for that - index specified. For example, ~FI_T: DEMAND would assign DEMAND as the - attribute for all values in the table that don't have an attribute specification - at the column or row level. After applying the declaration this function will - return the modified table with the simplified table tag (e.g. ~FI_T). - - See page 15 of https://iea-etsap.org/docs/Documentation_for_the_TIMES_Model-Part-IV.pdf - for more context. - - :param table: Table in EmbeddedXlTable format. - :return: Table in EmbeddedXlTable format with declarations applied - and table tag simplified. - """ - if ":" in table.tag: - (newtag, varname) = table.tag.split(":") - varname = varname.strip() - df = table.dataframe.copy() - df["attribute"] = df["attribute"].fillna(varname) - return replace(table, tag=newtag, dataframe=df) - else: - return table - - def apply_tag_specified_defaults( config: datatypes.Config, tables: List[datatypes.EmbeddedXlTable],