From 816ad2c7f57ad13686c7914a021d868ba5e6fdac Mon Sep 17 00:00:00 2001 From: pilar Date: Fri, 30 Oct 2020 13:47:59 -0400 Subject: [PATCH] small changes to fit weather_factory idea --- city_model_structure/building.py | 9 +++++---- factories/weather_feeders/helpers/weather.py | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/city_model_structure/building.py b/city_model_structure/building.py index 84f2c8c8..8ceb39c4 100644 --- a/city_model_structure/building.py +++ b/city_model_structure/building.py @@ -4,6 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca contributors: Pilar Monsalvete pilar_monsalvete@yahoo.es """ + from typing import List import matplotlib.patches as patches @@ -322,7 +323,7 @@ class Building(CityObject): def external_temperature(self, value): """ external temperature surrounding the building in grads Celsius - :param value: dict{DataFrame(external temperature)} + :param value: dict{DataFrame(float)} """ self._external_temperature = value @@ -338,7 +339,7 @@ class Building(CityObject): def global_horizontal(self, value): """ global horizontal radiation surrounding the building in W/m2 - :param value: dict{DataFrame(global horizontal radiation)} + :param value: dict{DataFrame(float)} """ self._global_horizontal = value @@ -354,7 +355,7 @@ class Building(CityObject): def diffuse(self, value): """ diffuse radiation surrounding the building in W/m2 - :param value: dict{DataFrame(diffuse radiation)} + :param value: dict{DataFrame(float)} """ self._diffuse = value @@ -370,6 +371,6 @@ class Building(CityObject): def beam(self, value): """ beam radiation surrounding the building in W/m2 - :param value: dict{DataFrame(beam radiation)} + :param value: dict{DataFrame(float)} """ self._beam = value diff --git a/factories/weather_feeders/helpers/weather.py b/factories/weather_feeders/helpers/weather.py index 6c717ed1..9ee068fc 100644 --- a/factories/weather_feeders/helpers/weather.py +++ b/factories/weather_feeders/helpers/weather.py @@ -10,10 +10,9 @@ class Weather(object): # Swinbank - Fuentes sky model approximation(1963) based on cloudiness statistics(32 %) in United States # ambient temperatures( in °C) # sky temperatures( in °C) - _ambient_temperature = ambient_temperature[['temperature']].to_numpy() values = [] - for temperature in _ambient_temperature: + for temperature in ambient_temperature: value = 0.037536 * math.pow((temperature + cte.celsius_to_kelvin), 1.5) \ + 0.32 * (temperature + cte.celsius_to_kelvin) - cte.celsius_to_kelvin values.append(value) - return pd.DataFrame(values, columns=['sky temperature']) + return values