Merge pull request 'modified ground_temperature name due to an overwriting of year in month' (#28) from bug_in_ground_temperature into main

Reviewed-on: https://nextgenerations-cities.encs.concordia.ca/gitea/CERC/hub/pulls/28
This commit is contained in:
Guille Gutierrez 2023-07-07 14:00:05 -04:00
commit dfd41250e5

View File

@ -40,13 +40,13 @@ class EpwWeatherParameters:
_ = file.readline().split(',') _ = file.readline().split(',')
line = file.readline().split(',') line = file.readline().split(',')
number_records = int(line[1]) number_records = int(line[1])
ground_temperature = {} ground_temperature_from_file = {}
for i in range(0, number_records): for i in range(0, number_records):
depth_measurement_ground_temperature = line[i*16+2] depth_measurement_ground_temperature = line[i*16+2]
temperatures = [] temperatures = []
for j in range(0, 12): for j in range(0, 12):
temperatures.append(float(line[i*16+j+6])) temperatures.append(float(line[i*16+j+6]))
ground_temperature[depth_measurement_ground_temperature] = temperatures ground_temperature_from_file[depth_measurement_ground_temperature] = temperatures
except SystemExit: except SystemExit:
logging.error('Error: weather file %s not found. Please download it from https://energyplus.net/weather and place' logging.error('Error: weather file %s not found. Please download it from https://energyplus.net/weather and place'
' it in folder data\\weather\\epw', self._path) ' it in folder data\\weather\\epw', self._path)
@ -79,7 +79,7 @@ class EpwWeatherParameters:
sys.stderr.write(f'Error: wrong formatting of weather file {self._path}\n') sys.stderr.write(f'Error: wrong formatting of weather file {self._path}\n')
sys.exit() sys.exit()
for building in self._city.buildings: for building in self._city.buildings:
building.ground_temperature[cte.MONTH] = ground_temperature building.ground_temperature[cte.MONTH] = ground_temperature_from_file
ground_temperature = {} ground_temperature = {}
for ground_temperature_set in building.ground_temperature[cte.MONTH]: for ground_temperature_set in building.ground_temperature[cte.MONTH]:
temperature = 0 temperature = 0