diff --git a/.coveragerc b/.coveragerc index f1ad13c2..16c2fdbf 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,7 @@ [run] omit = - epc_data/tests/* - epc_data/temp_inputs.py - epc_data/config.py - epc_data/__init__.py - epc_data/app.py \ No newline at end of file + model_data/tests/* + model_data/temp_inputs.py + model_data/config.py + model_data/__init__.py + model_data/app.py \ No newline at end of file diff --git a/README.md b/README.md index 492c9b31..bf5675ff 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ part of a larger application # Folders -### epc_data/ +### model_data/ This folder contains related to the reading and preparation of -epc data +assessment model data, including pulling out epc attributes # Testing @@ -26,10 +26,10 @@ pytest This will run the complete panel of tests and report on coverage in the locations specified by the pytest.ini file. -To run tests in a specific service, e.g. inside of epc_data, simple run +To run tests in a specific service, e.g. inside of model_data, simple run ```commandline -pytest epc_data +pytest model_data ``` This will produce the test results and coverage reports \ No newline at end of file diff --git a/epc_data/EpcClean.py b/model_data/EpcClean.py similarity index 92% rename from epc_data/EpcClean.py rename to model_data/EpcClean.py index d0d54095..5d35aa94 100644 --- a/epc_data/EpcClean.py +++ b/model_data/EpcClean.py @@ -1,8 +1,8 @@ from typing import List, Dict, Any from collections import Counter -from epc_data.attributes.RoofAttributes import RoofAttributes -from epc_data.attributes.FloorAttributes import FloorAttributes +from model_data.attributes.RoofAttributes import RoofAttributes +from model_data.attributes.FloorAttributes import FloorAttributes class EpcClean: diff --git a/epc_data/Property.py b/model_data/Property.py similarity index 96% rename from epc_data/Property.py rename to model_data/Property.py index 6706fce8..6ac017a1 100644 --- a/epc_data/Property.py +++ b/model_data/Property.py @@ -1,5 +1,5 @@ from epc_api.client import EpcClient -from epc_data.config import EPC_AUTH_TOKEN +from model_data.config import EPC_AUTH_TOKEN class Property: diff --git a/epc_data/README.md b/model_data/README.md similarity index 93% rename from epc_data/README.md rename to model_data/README.md index 87553ad7..32fb29d1 100644 --- a/epc_data/README.md +++ b/model_data/README.md @@ -28,7 +28,7 @@ and click OK, or select the conda environment from the dropdown. You may need to restart Pycharm for the new interpreter to be recognised. -To install project dependencies navigate to /epc_data and run +To install project dependencies navigate to /model_data and run ```commandline pip install -r requirements.txt diff --git a/epc_data/__init__.py b/model_data/__init__.py similarity index 100% rename from epc_data/__init__.py rename to model_data/__init__.py diff --git a/epc_data/app.py b/model_data/app.py similarity index 87% rename from epc_data/app.py rename to model_data/app.py index 3cbbbf37..936de358 100644 --- a/epc_data/app.py +++ b/model_data/app.py @@ -1,12 +1,12 @@ import pandas as pd from tqdm import tqdm -from epc_data.temp_inputs import input_data -from epc_data.Property import Property -from epc_data.config import EPC_AUTH_TOKEN +from model_data.temp_inputs import input_data +from model_data.Property import Property +from model_data.config import EPC_AUTH_TOKEN from epc_api.client import EpcClient -from epc_data.downloader import pagenated_epc_download -from epc_data.EpcClean import EpcClean +from model_data.downloader import pagenated_epc_download +from model_data.EpcClean import EpcClean def handler(): @@ -40,7 +40,7 @@ def handler(): cleaner.clean() # For testing: - from epc_data.attributes.HotWaterAttributes import HotWaterAttributes + from model_data.attributes.HotWaterAttributes import HotWaterAttributes from collections import Counter count = Counter([x["main-fuel"] for x in data]) descriptions = {x["hotwater-description"] for x in data} diff --git a/epc_data/attributes/FloorAttributes.py b/model_data/attributes/FloorAttributes.py similarity index 93% rename from epc_data/attributes/FloorAttributes.py rename to model_data/attributes/FloorAttributes.py index e1b7639d..36bb0783 100644 --- a/epc_data/attributes/FloorAttributes.py +++ b/model_data/attributes/FloorAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union, Optional -from epc_data.attributes.attribute_utils import extract_thermal_transmittance, extract_component_types +from model_data.attributes.attribute_utils import extract_thermal_transmittance, extract_component_types class FloorAttributes: diff --git a/epc_data/attributes/HotWaterAttributes.py b/model_data/attributes/HotWaterAttributes.py similarity index 98% rename from epc_data/attributes/HotWaterAttributes.py rename to model_data/attributes/HotWaterAttributes.py index 56f3036e..494bab1f 100644 --- a/epc_data/attributes/HotWaterAttributes.py +++ b/model_data/attributes/HotWaterAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union -from epc_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword +from model_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword class HotWaterAttributes: diff --git a/epc_data/attributes/MainFuelAttributes.py b/model_data/attributes/MainFuelAttributes.py similarity index 96% rename from epc_data/attributes/MainFuelAttributes.py rename to model_data/attributes/MainFuelAttributes.py index 59de55b9..32ed191a 100644 --- a/epc_data/attributes/MainFuelAttributes.py +++ b/model_data/attributes/MainFuelAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union -from epc_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword +from model_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword class MainFuelAttributes: diff --git a/epc_data/attributes/MainheatAttributes.py b/model_data/attributes/MainheatAttributes.py similarity index 96% rename from epc_data/attributes/MainheatAttributes.py rename to model_data/attributes/MainheatAttributes.py index 5e8029c9..ccd132fa 100644 --- a/epc_data/attributes/MainheatAttributes.py +++ b/model_data/attributes/MainheatAttributes.py @@ -1,4 +1,4 @@ -from epc_data.attributes.attribute_utils import clean_description, process_part +from model_data.attributes.attribute_utils import clean_description, process_part from typing import Dict, Union diff --git a/epc_data/attributes/MainheatControlAttributes.py b/model_data/attributes/MainheatControlAttributes.py similarity index 97% rename from epc_data/attributes/MainheatControlAttributes.py rename to model_data/attributes/MainheatControlAttributes.py index 622d6e05..5a1b92fb 100644 --- a/epc_data/attributes/MainheatControlAttributes.py +++ b/model_data/attributes/MainheatControlAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union -from epc_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword +from model_data.attributes.attribute_utils import clean_description, remove_punctuation, find_keyword class MainheatControlAttributes: diff --git a/epc_data/attributes/RoofAttributes.py b/model_data/attributes/RoofAttributes.py similarity index 95% rename from epc_data/attributes/RoofAttributes.py rename to model_data/attributes/RoofAttributes.py index 84afdc16..f23d946f 100644 --- a/epc_data/attributes/RoofAttributes.py +++ b/model_data/attributes/RoofAttributes.py @@ -1,6 +1,6 @@ import re from typing import Dict, Union -from epc_data.attributes.attribute_utils import extract_component_types, extract_thermal_transmittance +from model_data.attributes.attribute_utils import extract_component_types, extract_thermal_transmittance class RoofAttributes: diff --git a/epc_data/attributes/WallAttributes.py b/model_data/attributes/WallAttributes.py similarity index 94% rename from epc_data/attributes/WallAttributes.py rename to model_data/attributes/WallAttributes.py index f07afb28..f3c2df70 100644 --- a/epc_data/attributes/WallAttributes.py +++ b/model_data/attributes/WallAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union -from epc_data.attributes.attribute_utils import extract_component_types, extract_thermal_transmittance +from model_data.attributes.attribute_utils import extract_component_types, extract_thermal_transmittance class WallAttributes: diff --git a/epc_data/attributes/WindowAttributes.py b/model_data/attributes/WindowAttributes.py similarity index 97% rename from epc_data/attributes/WindowAttributes.py rename to model_data/attributes/WindowAttributes.py index e3177ce8..a6bf7e4b 100644 --- a/epc_data/attributes/WindowAttributes.py +++ b/model_data/attributes/WindowAttributes.py @@ -1,5 +1,5 @@ from typing import Dict, Union -from epc_data.attributes.attribute_utils import clean_description +from model_data.attributes.attribute_utils import clean_description class WindowAttributes: diff --git a/epc_data/attributes/attribute_utils.py b/model_data/attributes/attribute_utils.py similarity index 100% rename from epc_data/attributes/attribute_utils.py rename to model_data/attributes/attribute_utils.py diff --git a/epc_data/config.py b/model_data/config.py similarity index 68% rename from epc_data/config.py rename to model_data/config.py index b4c8db13..14150d88 100644 --- a/epc_data/config.py +++ b/model_data/config.py @@ -1,6 +1,6 @@ import os from dotenv import load_dotenv -load_dotenv(dotenv_path='epc_data/.env') +load_dotenv(dotenv_path='model_data/.env') EPC_AUTH_TOKEN = os.environ.get('EPC_AUTH_TOKEN') diff --git a/epc_data/downloader.py b/model_data/downloader.py similarity index 100% rename from epc_data/downloader.py rename to model_data/downloader.py diff --git a/epc_data/requirements.txt b/model_data/requirements.txt similarity index 100% rename from epc_data/requirements.txt rename to model_data/requirements.txt diff --git a/epc_data/temp_inputs.py b/model_data/temp_inputs.py similarity index 100% rename from epc_data/temp_inputs.py rename to model_data/temp_inputs.py diff --git a/epc_data/tests/__init__.py b/model_data/tests/__init__.py similarity index 100% rename from epc_data/tests/__init__.py rename to model_data/tests/__init__.py diff --git a/epc_data/tests/test_attribute_utils.py b/model_data/tests/test_attribute_utils.py similarity index 97% rename from epc_data/tests/test_attribute_utils.py rename to model_data/tests/test_attribute_utils.py index 8e38f8b8..64bfbd4c 100644 --- a/epc_data/tests/test_attribute_utils.py +++ b/model_data/tests/test_attribute_utils.py @@ -1,5 +1,5 @@ import pytest -import epc_data.attributes.attribute_utils as attribute_utils +import model_data.attributes.attribute_utils as attribute_utils def test_extract_thermal_transmittance(): diff --git a/epc_data/tests/test_data/EpcClean_inputs.obj b/model_data/tests/test_data/EpcClean_inputs.obj similarity index 100% rename from epc_data/tests/test_data/EpcClean_inputs.obj rename to model_data/tests/test_data/EpcClean_inputs.obj diff --git a/epc_data/tests/test_data/test_floor_attributes_cases.py b/model_data/tests/test_data/test_floor_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_floor_attributes_cases.py rename to model_data/tests/test_data/test_floor_attributes_cases.py diff --git a/epc_data/tests/test_data/test_hot_water_attributes_cases.py b/model_data/tests/test_data/test_hot_water_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_hot_water_attributes_cases.py rename to model_data/tests/test_data/test_hot_water_attributes_cases.py diff --git a/epc_data/tests/test_data/test_main_fuel_attributes_cases.py b/model_data/tests/test_data/test_main_fuel_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_main_fuel_attributes_cases.py rename to model_data/tests/test_data/test_main_fuel_attributes_cases.py diff --git a/epc_data/tests/test_data/test_mainheat_attributes_cases.py b/model_data/tests/test_data/test_mainheat_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_mainheat_attributes_cases.py rename to model_data/tests/test_data/test_mainheat_attributes_cases.py diff --git a/epc_data/tests/test_data/test_mainheat_control_attributes_cases.py b/model_data/tests/test_data/test_mainheat_control_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_mainheat_control_attributes_cases.py rename to model_data/tests/test_data/test_mainheat_control_attributes_cases.py diff --git a/epc_data/tests/test_data/test_roof_attributes_cases.py b/model_data/tests/test_data/test_roof_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_roof_attributes_cases.py rename to model_data/tests/test_data/test_roof_attributes_cases.py diff --git a/epc_data/tests/test_data/test_wall_attributes_cases.py b/model_data/tests/test_data/test_wall_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_wall_attributes_cases.py rename to model_data/tests/test_data/test_wall_attributes_cases.py diff --git a/epc_data/tests/test_data/test_window_attributes_cases.py b/model_data/tests/test_data/test_window_attributes_cases.py similarity index 100% rename from epc_data/tests/test_data/test_window_attributes_cases.py rename to model_data/tests/test_data/test_window_attributes_cases.py diff --git a/epc_data/tests/test_downloader.py b/model_data/tests/test_downloader.py similarity index 97% rename from epc_data/tests/test_downloader.py rename to model_data/tests/test_downloader.py index a30f017c..644f1caa 100644 --- a/epc_data/tests/test_downloader.py +++ b/model_data/tests/test_downloader.py @@ -1,6 +1,6 @@ import pytest from epc_api.client import EpcClient -from epc_data.downloader import pagenated_epc_download +from model_data.downloader import pagenated_epc_download # Mock EPC search response mock_epc_response = { diff --git a/epc_data/tests/test_epc_clean.py b/model_data/tests/test_epc_clean.py similarity index 87% rename from epc_data/tests/test_epc_clean.py rename to model_data/tests/test_epc_clean.py index 5b552c0d..eaa51cb1 100644 --- a/epc_data/tests/test_epc_clean.py +++ b/model_data/tests/test_epc_clean.py @@ -1,11 +1,11 @@ import pytest import pickle -from epc_data.EpcClean import EpcClean +from model_data.EpcClean import EpcClean from pathlib import Path # For local testing if __file__ == "": - input_data_path = Path("./epc_data/tests/test_data/EpcClean_inputs.obj") + input_data_path = Path("./model_data/tests/test_data/EpcClean_inputs.obj") else: current_file_path = Path(__file__) input_data_path = current_file_path.parent / 'test_data' / 'EpcClean_inputs.obj' diff --git a/epc_data/tests/test_floor_attributes.py b/model_data/tests/test_floor_attributes.py similarity index 92% rename from epc_data/tests/test_floor_attributes.py rename to model_data/tests/test_floor_attributes.py index 7e8f5b4c..1030b5f5 100644 --- a/epc_data/tests/test_floor_attributes.py +++ b/model_data/tests/test_floor_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.tests.test_data.test_floor_attributes_cases import clean_floor_cases -from epc_data.attributes.FloorAttributes import FloorAttributes +from model_data.tests.test_data.test_floor_attributes_cases import clean_floor_cases +from model_data.attributes.FloorAttributes import FloorAttributes class TestCleanFloor: diff --git a/epc_data/tests/test_hotwater_attributes.py b/model_data/tests/test_hotwater_attributes.py similarity index 89% rename from epc_data/tests/test_hotwater_attributes.py rename to model_data/tests/test_hotwater_attributes.py index d0a6453a..24b26775 100644 --- a/epc_data/tests/test_hotwater_attributes.py +++ b/model_data/tests/test_hotwater_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.HotWaterAttributes import HotWaterAttributes -from epc_data.tests.test_data.test_hot_water_attributes_cases import hotwater_cases +from model_data.attributes.HotWaterAttributes import HotWaterAttributes +from model_data.tests.test_data.test_hot_water_attributes_cases import hotwater_cases class TestHotWaterAttributes: diff --git a/epc_data/tests/test_mainfuel_attributes.py b/model_data/tests/test_mainfuel_attributes.py similarity index 88% rename from epc_data/tests/test_mainfuel_attributes.py rename to model_data/tests/test_mainfuel_attributes.py index c6400950..c7f98e86 100644 --- a/epc_data/tests/test_mainfuel_attributes.py +++ b/model_data/tests/test_mainfuel_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.MainFuelAttributes import MainFuelAttributes -from epc_data.tests.test_data.test_main_fuel_attributes_cases import mainfuel_cases +from model_data.attributes.MainFuelAttributes import MainFuelAttributes +from model_data.tests.test_data.test_main_fuel_attributes_cases import mainfuel_cases class TestMainHeatControlAttributes: diff --git a/epc_data/tests/test_mainheat_attributes.py b/model_data/tests/test_mainheat_attributes.py similarity index 90% rename from epc_data/tests/test_mainheat_attributes.py rename to model_data/tests/test_mainheat_attributes.py index e6039b00..ed28ac97 100644 --- a/epc_data/tests/test_mainheat_attributes.py +++ b/model_data/tests/test_mainheat_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.MainheatAttributes import MainHeatAttributes -from epc_data.tests.test_data.test_mainheat_attributes_cases import mainheat_cases +from model_data.attributes.MainheatAttributes import MainHeatAttributes +from model_data.tests.test_data.test_mainheat_attributes_cases import mainheat_cases class TestMainHeatAttributes: diff --git a/epc_data/tests/test_mainheat_controls_attributes.py b/model_data/tests/test_mainheat_controls_attributes.py similarity index 88% rename from epc_data/tests/test_mainheat_controls_attributes.py rename to model_data/tests/test_mainheat_controls_attributes.py index 6a0def34..6ffd52e1 100644 --- a/epc_data/tests/test_mainheat_controls_attributes.py +++ b/model_data/tests/test_mainheat_controls_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.MainheatControlAttributes import MainheatControlAttributes -from epc_data.tests.test_data.test_mainheat_control_attributes_cases import mainheat_control_cases +from model_data.attributes.MainheatControlAttributes import MainheatControlAttributes +from model_data.tests.test_data.test_mainheat_control_attributes_cases import mainheat_control_cases class TestMainHeatControlAttributes: diff --git a/epc_data/tests/test_property.py b/model_data/tests/test_property.py similarity index 97% rename from epc_data/tests/test_property.py rename to model_data/tests/test_property.py index 5f5ef524..20b78963 100644 --- a/epc_data/tests/test_property.py +++ b/model_data/tests/test_property.py @@ -1,7 +1,7 @@ import pytest from unittest.mock import Mock from epc_api.client import EpcClient -from epc_data.Property import Property +from model_data.Property import Property # Define some test data mock_epc_response = { diff --git a/epc_data/tests/test_roof_attributes.py b/model_data/tests/test_roof_attributes.py similarity index 93% rename from epc_data/tests/test_roof_attributes.py rename to model_data/tests/test_roof_attributes.py index 246e40a2..eee020e0 100644 --- a/epc_data/tests/test_roof_attributes.py +++ b/model_data/tests/test_roof_attributes.py @@ -1,13 +1,13 @@ import pytest import pickle -from epc_data.EpcClean import EpcClean +from model_data.EpcClean import EpcClean from pathlib import Path -from epc_data.tests.test_data.test_roof_attributes_cases import clean_roof_test_cases -from epc_data.attributes.RoofAttributes import RoofAttributes +from model_data.tests.test_data.test_roof_attributes_cases import clean_roof_test_cases +from model_data.attributes.RoofAttributes import RoofAttributes # For local testing if __file__ == "": - input_data_path = Path("./epc_data/tests/test_data/EpcClean_inputs.obj") + input_data_path = Path("./model_data/tests/test_data/EpcClean_inputs.obj") else: current_file_path = Path(__file__) input_data_path = current_file_path.parent / 'test_data' / 'EpcClean_inputs.obj' diff --git a/epc_data/tests/test_wall_attributes.py b/model_data/tests/test_wall_attributes.py similarity index 92% rename from epc_data/tests/test_wall_attributes.py rename to model_data/tests/test_wall_attributes.py index edfae17c..946e245a 100644 --- a/epc_data/tests/test_wall_attributes.py +++ b/model_data/tests/test_wall_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.WallAttributes import WallAttributes -from epc_data.tests.test_data.test_wall_attributes_cases import wall_cases +from model_data.attributes.WallAttributes import WallAttributes +from model_data.tests.test_data.test_wall_attributes_cases import wall_cases class TestWallAttributes: diff --git a/epc_data/tests/test_window_attributes.py b/model_data/tests/test_window_attributes.py similarity index 86% rename from epc_data/tests/test_window_attributes.py rename to model_data/tests/test_window_attributes.py index 6c21b86b..24758ce0 100644 --- a/epc_data/tests/test_window_attributes.py +++ b/model_data/tests/test_window_attributes.py @@ -1,6 +1,6 @@ import pytest -from epc_data.attributes.WindowAttributes import WindowAttributes -from epc_data.tests.test_data.test_window_attributes_cases import windows_cases +from model_data.attributes.WindowAttributes import WindowAttributes +from model_data.tests.test_data.test_window_attributes_cases import windows_cases class TestWindowAttributes: diff --git a/pytest.ini b/pytest.ini index 45c56659..6ab74d5e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -addopts = --cov-report term-missing --cov=epc_data -testpaths = epc_data/tests +addopts = --cov-report term-missing --cov=model_data +testpaths = model_data/tests