diff --git a/epc_data/attributes/attribute_utils.py b/epc_data/attributes/attribute_utils.py index 0aa6d6ac..71f9ab6a 100644 --- a/epc_data/attributes/attribute_utils.py +++ b/epc_data/attributes/attribute_utils.py @@ -29,28 +29,6 @@ def extract_thermal_transmittence(result: dict, description: str) -> Tuple[ return result, description -def search_split_description(desc: str) -> str: - """ - Searches split descriptions and looks for key words, determining a description about the roof's/floor's insulation. - - :param desc: Description to be searched. - :return: Result of the search. - """ - outputs = { - "insulated": "average", - "limited": "below average", - "no insulation": "none", - "limited insulation": "below average", - } - - out = outputs.get(desc, None) - - if out: - return out - - raise NotImplementedError("Handle me") - - def extract_component_types(result: dict, description: str, list_of_components: list) -> Tuple[ Dict[str, Union[None, str, float]], str ]: @@ -63,7 +41,7 @@ def extract_component_types(result: dict, description: str, list_of_components: """ for component in list_of_components: result[f'is_{component.replace(" ", "_")}'] = component in description - # Remove the roof type from the description + # Remove the component from the description description = description.replace(component, "") return result, description diff --git a/epc_data/tests/test_attribute_utils.py b/epc_data/tests/test_attribute_utils.py index 7aeee042..639bbeb1 100644 --- a/epc_data/tests/test_attribute_utils.py +++ b/epc_data/tests/test_attribute_utils.py @@ -1,17 +1,7 @@ -import pytest -from epc_data.attributes.attribute_utils import extract_thermal_transmittence, search_split_description +from epc_data.attributes.attribute_utils import extract_thermal_transmittence -def test__extract_thermal_transmittence(): - description = "U-value of 2.3 w/m-¦k" - assert extract_thermal_transmittence(description) == (2.3, "w/m-¦k") - - -def test__search_split_roof_description(): - assert search_split_description("insulated") == "average" - assert search_split_description("limited") == "below average" - assert search_split_description("no insulation") == "none" - assert search_split_description("limited insulation") == "below average" - - with pytest.raises(NotImplementedError): - search_split_description("unknown") +def test_extract_thermal_transmittance(): + description = "average thermal transmittance 2.3 w/m-¦k" + assert extract_thermal_transmittence({}, description) == ( + {'thermal_transmittance': 2.3, 'thermal_transmittance_unit': 'w/m-¦k'}, '')