diff --git a/exports/energy_systems/__pycache__/air_source_hp_export.cpython-38.pyc b/exports/energy_systems/__pycache__/air_source_hp_export.cpython-38.pyc new file mode 100644 index 00000000..839a9bb9 Binary files /dev/null and b/exports/energy_systems/__pycache__/air_source_hp_export.cpython-38.pyc differ diff --git a/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc b/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc new file mode 100644 index 00000000..80c47841 Binary files /dev/null and b/exports/energy_systems/__pycache__/heat_pump_export.cpython-38.pyc differ diff --git a/exports/energy_systems/__pycache__/water_to_water_hp_export.cpython-38.pyc b/exports/energy_systems/__pycache__/water_to_water_hp_export.cpython-38.pyc new file mode 100644 index 00000000..2661ec47 Binary files /dev/null and b/exports/energy_systems/__pycache__/water_to_water_hp_export.cpython-38.pyc differ diff --git a/exports/energy_systems/air_source_hp_export.py b/exports/energy_systems/air_source_hp_export.py index c825c8f5..3ee1dbd9 100644 --- a/exports/energy_systems/air_source_hp_export.py +++ b/exports/energy_systems/air_source_hp_export.py @@ -15,17 +15,19 @@ class AirSourceHPExport(HeatPumpExport): after executing insel """ - def __init__(self, base_path, city, output_path, sim_type): + def __init__(self, base_path, city, output_path, sim_type, demand_path=None): """ :param base_path: path to energy system files :param city: the city object :param output_path: the file to hold insel simulation results :param sim_type: the simulation type to run: 0 for series, 1 for parallel + :param demand_path: path to hourly energy demand file """ tmp_file = 'heat_pumps/as_series.txt' if sim_type == 0 else 'heat_pumps/as_parallel.txt' template_path = (base_path / tmp_file) - super().__init__(base_path, city, output_path, template_path) + super().__init__(base_path, city, output_path, template_path, demand_path) + def _extract_model_coff(self, hp_model: str, data_type='heat') -> Union[List, None]: """ diff --git a/exports/energy_systems/heat_pump_export.py b/exports/energy_systems/heat_pump_export.py index 7c007b82..b1343c24 100644 --- a/exports/energy_systems/heat_pump_export.py +++ b/exports/energy_systems/heat_pump_export.py @@ -17,12 +17,12 @@ class HeatPumpExport: of some defined function """ - def __init__(self, base_path, city, output_path, template, water_temp=None): + def __init__(self, base_path, city, output_path, template, demand_path=None, water_temp=None): self._template_path = template self._water_temp = water_temp self._constants_path = (base_path / 'heat_pumps/constants.yaml') # needed to compute max demand. - self._demand_path = (base_path / 'heat_pumps/demand.txt') + self._demand_path = (base_path / 'heat_pumps/demand.txt') if demand_path is None else demand_path self._city = city self._input_data = None self._base_path = base_path diff --git a/exports/energy_systems/water_to_water_hp_export.py b/exports/energy_systems/water_to_water_hp_export.py index a0be32d3..3acf4d45 100644 --- a/exports/energy_systems/water_to_water_hp_export.py +++ b/exports/energy_systems/water_to_water_hp_export.py @@ -15,17 +15,19 @@ class WaterToWaterHPExport(HeatPumpExport): after executing insel """ - def __init__(self, base_path, city, output_path, sim_type): + def __init__(self, base_path, city, output_path, sim_type, demand_path): """ :param base_path: path to energy system files :param city: the city object :param output_path: the file to hold insel simulation results :param sim_type: the simulation type to run: 1 for series, 0 for parallel + :param demand_path: path to hourly energy demand file """ tmp_file = 'heat_pumps/w2w_series.txt' if sim_type == 0 else 'heat_pumps/w2w_parallel.txt' template_path = (base_path / tmp_file) water_temp = (base_path / 'heat_pumps/wt_hourly3.txt') - super().__init__(base_path, city, output_path, template_path, water_temp) + super().__init__(base_path=base_path, city=city, output_path=output_path, template=template_path, + demand_path=demand_path, water_temp=water_temp) def _extract_model_coff(self, hp_model: str) -> Union[List, None]: """ diff --git a/unittests/test_energy_systems_air_source_hp.py b/unittests/test_energy_systems_air_source_hp.py index 6f4edad8..72c3a9cd 100644 --- a/unittests/test_energy_systems_air_source_hp.py +++ b/unittests/test_energy_systems_air_source_hp.py @@ -50,7 +50,8 @@ class TestEnergySystemsFactory(TestCase): 'HPSupTemp': 60 } - EnergySystemsExportFactory(self._city, user_input, '012', self._output_path).export() + EnergySystemsExportFactory(city=self._city, user_input=user_input, hp_model='012', + output_path=self._output_path).export() df = pd.read_csv(self._output_path) self.assertEqual(df.shape, (13, 3)) self.assertEqual(df.iloc[0, 1], 1867715.88)