add todo for heat pum corrections

Keep because most likely we are going to delete this one.
This commit is contained in:
Guille Gutierrez 2023-05-23 11:07:10 -04:00
parent 182d01123c
commit 5a7427e457

View File

@ -4,16 +4,17 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group Copyright © 2022 Concordia CERC group
Project Coder Peter Yefi peteryefi@gmail.com Project Coder Peter Yefi peteryefi@gmail.com
""" """
import io
import pandas as pd
from typing import Dict from typing import Dict
from hub.city_model_structure.energy_systems.water_to_water_hp import WaterToWaterHP
from hub.city_model_structure.energy_system import EnergySystem
from scipy.optimize import curve_fit
import numpy as np
from typing import List from typing import List
import numpy as np
import pandas as pd
from scipy.optimize import curve_fit
from hub.city_model_structure.energy_system import EnergySystem
from hub.city_model_structure.energy_systems.water_to_water_hp import WaterToWaterHP
class WaterToWaterHPParameters: class WaterToWaterHPParameters:
""" """
@ -25,25 +26,7 @@ class WaterToWaterHPParameters:
self._base_path = (base_path / 'heat_pumps/water_to_water.xlsx') self._base_path = (base_path / 'heat_pumps/water_to_water.xlsx')
def _read_file(self) -> Dict: def _read_file(self) -> Dict:
""" # todo: this method is keeping the excel file open and should be either corrected or removed
reads xlsx file containing water to water heat pump information
into a dictionary
:return : Dict
with open(self._base_path, 'rb') as xls:
xl_file = pd.read_excel(io.BytesIO(xls.read()))
hp_data = {}
flow_rates = {
'156': [2.84, 4.23, 5.68],
'256': [4.73, 7.13, 9.446],
'335': [6.62, 9.97, 12.93],
}
for sheet, dataframe in xl_file.items():
print(sheet, xl_file[sheet])
df = dataframe[xl_file[sheet].columns[1]]
"""
xl_file = pd.ExcelFile(self._base_path) xl_file = pd.ExcelFile(self._base_path)
heat_pump_dfs = {sheet_name: xl_file.parse(sheet_name) heat_pump_dfs = {sheet_name: xl_file.parse(sheet_name)
for sheet_name in xl_file.sheet_names} for sheet_name in xl_file.sheet_names}
@ -58,7 +41,6 @@ class WaterToWaterHPParameters:
for sheet, dataframe in heat_pump_dfs.items(): for sheet, dataframe in heat_pump_dfs.items():
df = heat_pump_dfs[sheet].dropna(axis=1, how='all') df = heat_pump_dfs[sheet].dropna(axis=1, how='all')
print(df)
df = df.iloc[3:, 6:35] df = df.iloc[3:, 6:35]
if '156' in sheet: if '156' in sheet: