Forced the type in setters

This commit is contained in:
Pilar 2021-09-13 15:14:54 -04:00
parent c12643d1dd
commit f4d62bb505
26 changed files with 127 additions and 126 deletions

View File

@ -7,7 +7,7 @@ Contributor Milad milad.aghamohamadnia@concordia.ca
import uuid import uuid
from typing import List, TypeVar from typing import List, TypeVar
UsageZone = TypeVar('Node') Node = TypeVar('Node')
class Edge: class Edge:

View File

@ -8,7 +8,8 @@ Contributor Milad milad.aghamohamadnia@concordia.ca
import uuid import uuid
from typing import List, TypeVar from typing import List, TypeVar
UsageZone = TypeVar('Edge') Edge = TypeVar('Edge')
class Node: class Node:
""" """

View File

@ -217,7 +217,7 @@ class Polyhedron:
return self._min_x return self._min_x
@property @property
def centroid(self) -> List[float]: def centroid(self) -> Union[None, List[float]]:
""" """
Get polyhedron centroid Get polyhedron centroid
:return: [x,y,z] :return: [x,y,z]

View File

@ -44,7 +44,7 @@ class Schedule:
Set schedule type Set schedule type
:param: str :param: str
""" """
self._type = value self._type = str(value)
@property @property
def values(self): def values(self):
@ -77,7 +77,7 @@ class Schedule:
Set schedule data type Set schedule data type
:param: str :param: str
""" """
self._data_type = value self._data_type = str(value)
@property @property
def time_step(self): def time_step(self):
@ -94,7 +94,7 @@ class Schedule:
Set schedule time step Set schedule time step
:param: str :param: str
""" """
self._time_step = value self._time_step = str(value)
@property @property
def time_range(self): def time_range(self):
@ -111,7 +111,7 @@ class Schedule:
Set schedule time range Set schedule time range
:param: str :param: str
""" """
self._time_range = value self._time_range = str(value)
@property @property
def day_types(self): def day_types(self):
@ -129,4 +129,4 @@ class Schedule:
Set schedule day types Set schedule day types
:param: [str] :param: [str]
""" """
self._day_types = value self._day_types = [str(i) for i in value]

View File

@ -137,7 +137,7 @@ class Building(CityObject):
Set if the city object attic is heated Set if the city object attic is heated
:param value: Boolean :param value: Boolean
""" """
self._attic_heated = value self._attic_heated = bool(value)
@property @property
def basement_heated(self): def basement_heated(self):
@ -153,7 +153,7 @@ class Building(CityObject):
Set if the city object basement is heated Set if the city object basement is heated
:param value: Boolean :param value: Boolean
""" """
self._basement_heated = value self._basement_heated = bool(value)
@property @property
def name(self): def name(self):
@ -204,7 +204,7 @@ class Building(CityObject):
Set building function Set building function
:param value: str :param value: str
""" """
self._function = value self._function = str(value)
@property @property
def average_storey_height(self): def average_storey_height(self):
@ -220,7 +220,7 @@ class Building(CityObject):
Set building average storey height in meters Set building average storey height in meters
:param value: float :param value: float
""" """
self._average_storey_height = value self._average_storey_height = float(value)
@property @property
def storeys_above_ground(self): def storeys_above_ground(self):
@ -236,7 +236,7 @@ class Building(CityObject):
Set building storeys number above ground Set building storeys number above ground
:param value: int :param value: int
""" """
self._storeys_above_ground = value self._storeys_above_ground = int(value)
@staticmethod @staticmethod
def _tuple_to_point(xy_tuple): def _tuple_to_point(xy_tuple):

View File

@ -30,7 +30,7 @@ class InternalGains:
Set internal gains average internal gain in W/m2 Set internal gains average internal gain in W/m2
:param value: float :param value: float
""" """
self._average_internal_gain = value self._average_internal_gain = float(value)
@property @property
def convective_fraction(self): def convective_fraction(self):
@ -46,7 +46,7 @@ class InternalGains:
Set internal gains convective fraction Set internal gains convective fraction
:param value: float :param value: float
""" """
self._convective_fraction = value self._convective_fraction = float(value)
@property @property
def radiative_fraction(self): def radiative_fraction(self):
@ -62,7 +62,7 @@ class InternalGains:
Set internal gains convective fraction Set internal gains convective fraction
:param value: float :param value: float
""" """
self._radiative_fraction = value self._radiative_fraction = float(value)
@property @property
def latent_fraction(self): def latent_fraction(self):
@ -78,4 +78,4 @@ class InternalGains:
Set internal gains latent fraction Set internal gains latent fraction
:param value: float :param value: float
""" """
self._latent_fraction = value self._latent_fraction = float(value)

View File

@ -56,4 +56,4 @@ class Layer:
Get layer thickness in meters Get layer thickness in meters
:param value: float :param value: float
""" """
self._thickness = value self._thickness = float(value)

View File

@ -34,7 +34,7 @@ class Material:
Set material name Set material name
:param value: string :param value: string
""" """
self._name = value self._name = str(value)
@property @property
def conductivity(self): def conductivity(self):
@ -50,7 +50,7 @@ class Material:
Set material conductivity in W/mK Set material conductivity in W/mK
:param value: float :param value: float
""" """
self._conductivity = value self._conductivity = float(value)
@property @property
def specific_heat(self): def specific_heat(self):
@ -66,7 +66,7 @@ class Material:
Get material conductivity in J/kgK Get material conductivity in J/kgK
:param value: float :param value: float
""" """
self._specific_heat = value self._specific_heat = float(value)
@property @property
def density(self): def density(self):
@ -82,7 +82,7 @@ class Material:
Set material density in kg/m3 Set material density in kg/m3
:param value: float :param value: float
""" """
self._density = value self._density = float(value)
@property @property
def solar_absorptance(self): def solar_absorptance(self):
@ -98,7 +98,7 @@ class Material:
Set material solar absorptance Set material solar absorptance
:param value: float :param value: float
""" """
self._solar_absorptance = value self._solar_absorptance = float(value)
@property @property
def thermal_absorptance(self): def thermal_absorptance(self):
@ -114,7 +114,7 @@ class Material:
Set material thermal absorptance Set material thermal absorptance
:param value: float :param value: float
""" """
self._thermal_absorptance = value self._thermal_absorptance = float(value)
@property @property
def visible_absorptance(self): def visible_absorptance(self):
@ -130,7 +130,7 @@ class Material:
Set material visible absorptance Set material visible absorptance
:param value: float :param value: float
""" """
self._visible_absorptance = value self._visible_absorptance = float(value)
@property @property
def no_mass(self): def no_mass(self):
@ -146,7 +146,7 @@ class Material:
Set material no mass flag Set material no mass flag
:param value: Boolean :param value: Boolean
""" """
self._no_mass = value self._no_mass = bool(value)
@property @property
def thermal_resistance(self): def thermal_resistance(self):
@ -162,4 +162,4 @@ class Material:
Set material thermal resistance in m2K/W Set material thermal resistance in m2K/W
:param value: float :param value: float
""" """
self._thermal_resistance = value self._thermal_resistance = float(value)

View File

@ -48,7 +48,7 @@ class Occupants:
Set heat dissipation of occupants in W/person Set heat dissipation of occupants in W/person
:param value: float :param value: float
""" """
self._heat_dissipation = value self._heat_dissipation = float(value)
@property @property
def occupancy_rate(self): def occupancy_rate(self):
@ -64,7 +64,7 @@ class Occupants:
Set rate of schedules Set rate of schedules
:param value: float :param value: float
""" """
self._occupancy_rate = value self._occupancy_rate = float(value)
@property @property
def occupant_type(self): def occupant_type(self):
@ -80,7 +80,7 @@ class Occupants:
Set type of schedules Set type of schedules
:param value: float :param value: float
""" """
self._occupant_type = value self._occupant_type = float(value)
@property @property
def usage_zone(self) -> UsageZone: def usage_zone(self) -> UsageZone:
@ -104,7 +104,7 @@ class Occupants:
Set the schedules when an occupant is in a zone (24 values, 1 per hour of the day) Set the schedules when an occupant is in a zone (24 values, 1 per hour of the day)
:param value: [float] :param value: [float]
""" """
self._occupant_schedule = value self._occupant_schedule = [float(i) for i in value]
@property @property
def number_of_occupants(self): def number_of_occupants(self):
@ -120,7 +120,7 @@ class Occupants:
Set the number of occupants Set the number of occupants
:param value: int :param value: int
""" """
self._number_of_occupants = value self._number_of_occupants = int(value)
@property @property
def arrival_time(self): def arrival_time(self):

View File

@ -75,7 +75,7 @@ class Surface:
Set the surface id Set the surface id
:param value: str :param value: str
""" """
self._id = value self._id = str(value)
@property @property
def swr(self): def swr(self):
@ -91,7 +91,7 @@ class Surface:
Set surface short wave reflectance Set surface short wave reflectance
:param value: float :param value: float
""" """
self._swr = value self._swr = float(value)
def _max_coord(self, axis): def _max_coord(self, axis):
if axis == 'x': if axis == 'x':

View File

@ -142,8 +142,8 @@ class ThermalBoundary:
Set thermal boundary outside solar absorptance Set thermal boundary outside solar absorptance
:param value: float :param value: float
""" """
self._outside_solar_absorptance = value self._outside_solar_absorptance = float(value)
self._shortwave_reflectance = 1.0 - float(value) self._shortwave_reflectance = 1.0 - value
@property @property
def outside_thermal_absorptance(self): def outside_thermal_absorptance(self):
@ -159,7 +159,7 @@ class ThermalBoundary:
Set thermal boundary outside thermal absorptance Set thermal boundary outside thermal absorptance
:param value: float :param value: float
""" """
self._outside_thermal_absorptance = value self._outside_thermal_absorptance = float(value)
@property @property
def outside_visible_absorptance(self): def outside_visible_absorptance(self):
@ -175,7 +175,7 @@ class ThermalBoundary:
Set thermal boundary outside visible absorptance Set thermal boundary outside visible absorptance
:param value: float :param value: float
""" """
self._outside_visible_absorptance = value self._outside_visible_absorptance = float(value)
@property @property
def thermal_openings(self) -> List[ThermalOpening]: def thermal_openings(self) -> List[ThermalOpening]:
@ -216,7 +216,7 @@ class ThermalBoundary:
Set construction name Set construction name
:param value: str :param value: str
""" """
self._construction_name = value self._construction_name = str(value)
@property @property
def layers(self) -> List[Layer]: def layers(self) -> List[Layer]:
@ -256,7 +256,7 @@ class ThermalBoundary:
Set thermal boundary window ratio Set thermal boundary window ratio
:param value: float :param value: float
""" """
self._window_ratio = value self._window_ratio = float(value)
@property @property
def u_value(self): def u_value(self):
@ -286,7 +286,7 @@ class ThermalBoundary:
Set thermal boundary U-value in W/m2K Set thermal boundary U-value in W/m2K
:param value: float :param value: float
""" """
self._u_value = value self._u_value = float(value)
@property @property
def shortwave_reflectance(self): def shortwave_reflectance(self):
@ -302,8 +302,8 @@ class ThermalBoundary:
Set thermal boundary shortwave reflectance Set thermal boundary shortwave reflectance
:param value: float :param value: float
""" """
self._shortwave_reflectance = value self._shortwave_reflectance = float(value)
self._outside_solar_absorptance = 1.0 - float(value) self._outside_solar_absorptance = 1.0 - value
@property @property
def hi(self): def hi(self):
@ -317,9 +317,9 @@ class ThermalBoundary:
def hi(self, value): def hi(self, value):
""" """
Set internal convective heat transfer coefficient (W/m2K) Set internal convective heat transfer coefficient (W/m2K)
:param value: internal convective heat transfer coefficient (W/m2K) :param value: float
""" """
self._hi = value self._hi = float(value)
@property @property
def he(self): def he(self):
@ -335,7 +335,7 @@ class ThermalBoundary:
Set external convective heat transfer coefficient (W/m2K) Set external convective heat transfer coefficient (W/m2K)
:param value: float :param value: float
""" """
self._he = value self._he = float(value)
@property @property
def surface_geometry(self): def surface_geometry(self):
@ -369,7 +369,7 @@ class ThermalBoundary:
Set short wave emissivity factor of the thermal boundary's internal surface (-) Set short wave emissivity factor of the thermal boundary's internal surface (-)
:param value: float :param value: float
""" """
self._inside_emissivity = value self._inside_emissivity = float(value)
@property @property
def alpha_coefficient(self): def alpha_coefficient(self):
@ -385,7 +385,7 @@ class ThermalBoundary:
Set long wave emissivity factor of the thermal boundary's internal surface (-) Set long wave emissivity factor of the thermal boundary's internal surface (-)
:param value: float :param value: float
""" """
self._alpha_coefficient = value self._alpha_coefficient = float(value)
@property @property
def radiative_coefficient(self): def radiative_coefficient(self):
@ -401,4 +401,4 @@ class ThermalBoundary:
Set radiative coefficient of the thermal boundary's external surface (-) Set radiative coefficient of the thermal boundary's external surface (-)
:param value: float :param value: float
""" """
self._radiative_coefficient = value self._radiative_coefficient = float(value)

View File

@ -56,7 +56,7 @@ class ThermalOpening:
Set thermal opening area in square meters Set thermal opening area in square meters
:param value: float :param value: float
""" """
self._area = value self._area = float(value)
@property @property
def openable_ratio(self): def openable_ratio(self):
@ -88,7 +88,7 @@ class ThermalOpening:
""" """
# The code to calculate overall_u_value is duplicated here and in thickness_m. # The code to calculate overall_u_value is duplicated here and in thickness_m.
# This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read. # This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read.
self._conductivity = value self._conductivity = float(value)
if self._overall_u_value is None and self.thickness is not None: if self._overall_u_value is None and self.thickness is not None:
h_i = self.hi h_i = self.hi
h_e = self.he h_e = self.he
@ -109,7 +109,7 @@ class ThermalOpening:
Set thermal opening frame ratio Set thermal opening frame ratio
:param value: float :param value: float
""" """
self._frame_ratio = value self._frame_ratio = float(value)
@property @property
def g_value(self): def g_value(self):
@ -125,7 +125,7 @@ class ThermalOpening:
Set thermal opening g-value Set thermal opening g-value
:param value: float :param value: float
""" """
self._g_value = value self._g_value = float(value)
@property @property
def thickness(self): def thickness(self):
@ -143,7 +143,7 @@ class ThermalOpening:
""" """
# The code to calculate overall_u_value is duplicated here and in conductivity. # The code to calculate overall_u_value is duplicated here and in conductivity.
# This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read. # This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read.
self._thickness = value self._thickness = float(value)
if self._overall_u_value is None and self.conductivity is not None: if self._overall_u_value is None and self.conductivity is not None:
h_i = self.hi h_i = self.hi
h_e = self.he h_e = self.he
@ -164,7 +164,7 @@ class ThermalOpening:
Set thermal opening front side solar transmittance at normal incidence Set thermal opening front side solar transmittance at normal incidence
:param value: float :param value: float
""" """
self._front_side_solar_transmittance_at_normal_incidence = value self._front_side_solar_transmittance_at_normal_incidence = float(value)
@property @property
def back_side_solar_transmittance_at_normal_incidence(self): def back_side_solar_transmittance_at_normal_incidence(self):
@ -180,7 +180,7 @@ class ThermalOpening:
Set thermal opening back side solar transmittance at normal incidence Set thermal opening back side solar transmittance at normal incidence
:param value: float :param value: float
""" """
self._back_side_solar_transmittance_at_normal_incidence = value self._back_side_solar_transmittance_at_normal_incidence = float(value)
@property @property
def overall_u_value(self): def overall_u_value(self):
@ -196,7 +196,7 @@ class ThermalOpening:
Set thermal opening overall U-value in W/m2K Set thermal opening overall U-value in W/m2K
:param value: float :param value: float
""" """
self._overall_u_value = value self._overall_u_value = float(value)
@property @property
def hi(self): def hi(self):
@ -212,7 +212,7 @@ class ThermalOpening:
Set internal convective heat transfer coefficient (W/m2K) Set internal convective heat transfer coefficient (W/m2K)
:param value: float :param value: float
""" """
self._hi = value self._hi = float(value)
@property @property
def he(self): def he(self):
@ -228,7 +228,7 @@ class ThermalOpening:
Set external convective heat transfer coefficient (W/m2K) Set external convective heat transfer coefficient (W/m2K)
:param value: float :param value: float
""" """
self._he = value self._he = float(value)
@property @property
def surface_geometry(self) -> Polygon: def surface_geometry(self) -> Polygon:
@ -253,7 +253,7 @@ class ThermalOpening:
Set short wave emissivity factor of the thermal opening's internal surface (-) Set short wave emissivity factor of the thermal opening's internal surface (-)
:param value: float :param value: float
""" """
self._inside_emissivity = value self._inside_emissivity = float(value)
@property @property
def alpha_coefficient(self): def alpha_coefficient(self):
@ -269,7 +269,7 @@ class ThermalOpening:
Set long wave emissivity factor of the thermal opening's internal surface (-) Set long wave emissivity factor of the thermal opening's internal surface (-)
:param value: float :param value: float
""" """
self._alpha_coefficient = value self._alpha_coefficient = float(value)
@property @property
def radiative_coefficient(self): def radiative_coefficient(self):
@ -285,4 +285,4 @@ class ThermalOpening:
Set radiative coefficient of the thermal opening's external surface (-) Set radiative coefficient of the thermal opening's external surface (-)
:param value: float :param value: float
""" """
self._radiative_coefficient = value self._radiative_coefficient = float(value)

View File

@ -85,7 +85,7 @@ class ThermalZone:
Set thermal zone additional thermal bridge u value W/m2K Set thermal zone additional thermal bridge u value W/m2K
:param value: float :param value: float
""" """
self._additional_thermal_bridge_u_value = value self._additional_thermal_bridge_u_value = float(value)
@property @property
def effective_thermal_capacity(self): def effective_thermal_capacity(self):
@ -101,7 +101,7 @@ class ThermalZone:
Set thermal zone effective thermal capacity in J/m2K Set thermal zone effective thermal capacity in J/m2K
:param value: float :param value: float
""" """
self._effective_thermal_capacity = value self._effective_thermal_capacity = float(value)
@property @property
def indirectly_heated_area_ratio(self): def indirectly_heated_area_ratio(self):
@ -117,7 +117,7 @@ class ThermalZone:
Set thermal zone indirectly heated area ratio Set thermal zone indirectly heated area ratio
:param value: float :param value: float
""" """
self._indirectly_heated_area_ratio = value self._indirectly_heated_area_ratio = float(value)
@property @property
def infiltration_rate_system_on(self): def infiltration_rate_system_on(self):
@ -133,7 +133,7 @@ class ThermalZone:
Set thermal zone infiltration rate system on in air changes per hour (ACH) Set thermal zone infiltration rate system on in air changes per hour (ACH)
:param value: float :param value: float
""" """
self._infiltration_rate_system_on = value self._infiltration_rate_system_on = float(value)
@property @property
def infiltration_rate_system_off(self): def infiltration_rate_system_off(self):
@ -149,7 +149,7 @@ class ThermalZone:
Set thermal zone infiltration rate system on in air changes per hour (ACH) Set thermal zone infiltration rate system on in air changes per hour (ACH)
:param value: float :param value: float
""" """
self._infiltration_rate_system_off = value self._infiltration_rate_system_off = float(value)
@property @property
def usage_zones(self) -> List[UsageZone]: def usage_zones(self) -> List[UsageZone]:
@ -197,4 +197,4 @@ class ThermalZone:
Set a specific order of the zones to be called Set a specific order of the zones to be called
:param value: int :param value: int
""" """
self._ordinate_number = value self._ordinate_number = int(value)

View File

@ -77,7 +77,7 @@ class UsageZone:
Set usage zone heating set point in Celsius Set usage zone heating set point in Celsius
:param value: float :param value: float
""" """
self._heating_setpoint = value self._heating_setpoint = float(value)
@property @property
def heating_setback(self): def heating_setback(self):
@ -93,7 +93,7 @@ class UsageZone:
Set usage zone heating setback in Celsius Set usage zone heating setback in Celsius
:param value: float :param value: float
""" """
self._heating_setback = value self._heating_setback = float(value)
@property @property
def cooling_setpoint(self): def cooling_setpoint(self):
@ -109,7 +109,7 @@ class UsageZone:
Set usage zone cooling setpoint in Celsius Set usage zone cooling setpoint in Celsius
:param value: float :param value: float
""" """
self._cooling_setpoint = value self._cooling_setpoint = float(value)
@property @property
def hours_day(self): def hours_day(self):
@ -125,7 +125,7 @@ class UsageZone:
Set usage zone usage hours per day Set usage zone usage hours per day
:param value: float :param value: float
""" """
self._hours_day = value self._hours_day = float(value)
@property @property
def days_year(self): def days_year(self):
@ -141,7 +141,7 @@ class UsageZone:
Set usage zone usage days per year Set usage zone usage days per year
:param value: float :param value: float
""" """
self._days_year = value self._days_year = float(value)
@property @property
def mechanical_air_change(self): def mechanical_air_change(self):
@ -157,7 +157,7 @@ class UsageZone:
Set usage zone mechanical air change in air change per hour (ACH) Set usage zone mechanical air change in air change per hour (ACH)
:param value: float :param value: float
""" """
self._mechanical_air_change = value self._mechanical_air_change = float(value)
@property @property
def usage(self): def usage(self):
@ -173,7 +173,7 @@ class UsageZone:
Set usage zone usage Set usage zone usage
:param value: str :param value: str
""" """
self._usage = value self._usage = str(value)
@property @property
def occupants(self) -> List[Occupants]: def occupants(self) -> List[Occupants]:
@ -221,7 +221,7 @@ class UsageZone:
Set average DHW consumption in cubic meters per person per day Set average DHW consumption in cubic meters per person per day
:param values: float :param values: float
""" """
self._dhw_average_volume_pers_day = values self._dhw_average_volume_pers_day = float(values)
@property @property
def dhw_preparation_temperature(self): def dhw_preparation_temperature(self):
@ -232,12 +232,12 @@ class UsageZone:
return self._dhw_preparation_temperature return self._dhw_preparation_temperature
@dhw_preparation_temperature.setter @dhw_preparation_temperature.setter
def dhw_preparation_temperature(self, values): def dhw_preparation_temperature(self, value):
""" """
Set preparation temperature of the DHW in Celsius Set preparation temperature of the DHW in Celsius
:param values: float :param value: float
""" """
self._dhw_preparation_temperature = values self._dhw_preparation_temperature = float(value)
@property @property
def electrical_app_average_consumption_sqm_year(self): def electrical_app_average_consumption_sqm_year(self):
@ -248,12 +248,12 @@ class UsageZone:
return self._electrical_app_average_consumption_sqm_year return self._electrical_app_average_consumption_sqm_year
@electrical_app_average_consumption_sqm_year.setter @electrical_app_average_consumption_sqm_year.setter
def electrical_app_average_consumption_sqm_year(self, values): def electrical_app_average_consumption_sqm_year(self, value):
""" """
Set average consumption of electrical appliances in Joules per square meter and year (J/m2yr) Set average consumption of electrical appliances in Joules per square meter and year (J/m2yr)
:param values: float :param value: float
""" """
self._electrical_app_average_consumption_sqm_year = values self._electrical_app_average_consumption_sqm_year = float(value)
@property @property
def volume_geometry(self) -> Polyhedron: def volume_geometry(self) -> Polyhedron:
@ -277,7 +277,7 @@ class UsageZone:
Set volume in cubic meters Set volume in cubic meters
:param value: float :param value: float
""" """
self._volume = value self._volume = float(value)
@property @property
def is_heated(self): def is_heated(self):
@ -293,7 +293,7 @@ class UsageZone:
Set thermal zone heated flag Set thermal zone heated flag
:param value: Boolean :param value: Boolean
""" """
self._is_heated = value self._is_heated = bool(value)
@property @property
def is_cooled(self): def is_cooled(self):
@ -309,4 +309,4 @@ class UsageZone:
Set thermal zone cooled flag Set thermal zone cooled flag
:param value: Boolean :param value: Boolean
""" """
self._is_cooled = value self._is_cooled = bool(value)

View File

@ -93,7 +93,7 @@ class City:
Set the name for the climatic information reference city Set the name for the climatic information reference city
:param value: str :param value: str
""" """
self._climate_reference_city = value self._climate_reference_city = str(value)
@property @property
def climate_file(self) -> Path: def climate_file(self) -> Path:
@ -109,7 +109,7 @@ class City:
Set the climate file full path Set the climate file full path
:param value: Path :param value: Path
""" """
self._climate_file = value self._climate_file = Path(value)
@property @property
def city_objects(self) -> Union[List[CityObject], None]: def city_objects(self) -> Union[List[CityObject], None]:
@ -224,7 +224,7 @@ class City:
Set city name Set city name
:param value:str :param value:str
""" """
self._name = value self._name = str(value)
@staticmethod @staticmethod
def load(city_filename) -> City: def load(city_filename) -> City:
@ -280,7 +280,7 @@ class City:
Set city latitude in degrees Set city latitude in degrees
:parameter value: float :parameter value: float
""" """
self._latitude = value self._latitude = float(value)
@property @property
def longitude(self): def longitude(self):
@ -296,7 +296,7 @@ class City:
Set city longitude in degrees Set city longitude in degrees
:parameter value: float :parameter value: float
""" """
self._longitude = value self._longitude = float(value)
@property @property
def time_zone(self): def time_zone(self):
@ -312,7 +312,7 @@ class City:
Set city time_zone Set city time_zone
:parameter value: float :parameter value: float
""" """
self._time_zone = value self._time_zone = float(value)
@property @property
def buildings_clusters(self) -> Union[List[BuildingsCluster], None]: def buildings_clusters(self) -> Union[List[BuildingsCluster], None]:

View File

@ -27,7 +27,7 @@ class HeatPump:
Set seasonal mean COP (-) Set seasonal mean COP (-)
:param value: float :param value: float
""" """
self._seasonal_mean_cop = value self._seasonal_mean_cop = float(value)
@property @property
def seasonal_mean_coverage_factor(self): def seasonal_mean_coverage_factor(self):
@ -43,4 +43,4 @@ class HeatPump:
Set percentage of demand covered by the hp (-) Set percentage of demand covered by the hp (-)
:return: float :return: float
""" """
self._seasonal_mean_coverage_factor = value self._seasonal_mean_coverage_factor = float(value)

View File

@ -31,7 +31,7 @@ class PvSystem:
Set mean modules efficiency (-) Set mean modules efficiency (-)
:param value: float :param value: float
""" """
self._modules_mean_seasonal_efficiency = value self._modules_mean_seasonal_efficiency = float(value)
@property @property
def total_area(self): def total_area(self):
@ -47,7 +47,7 @@ class PvSystem:
Set total modules area in square meters Set total modules area in square meters
:param value: float :param value: float
""" """
self._total_area = value self._total_area = float(value)
@property @property
def module_area(self): def module_area(self):
@ -63,7 +63,7 @@ class PvSystem:
Set module area in square meters Set module area in square meters
:param value: float :param value: float
""" """
self._module_area = value self._module_area = float(value)
@property @property
def number_of_modules(self): def number_of_modules(self):
@ -79,7 +79,7 @@ class PvSystem:
Set number of modules Set number of modules
:param value: int :param value: int
""" """
self._number_of_modules = value self._number_of_modules = int(value)
@property @property
def overall_system_performance_ratio(self): def overall_system_performance_ratio(self):
@ -95,7 +95,7 @@ class PvSystem:
Set overall system performance ratio (-) Set overall system performance ratio (-)
:param value: float :param value: float
""" """
self._overall_system_performance_ratio = value self._overall_system_performance_ratio = float(value)
@property @property
def electricity_generation(self): def electricity_generation(self):
@ -111,4 +111,4 @@ class PvSystem:
Set electricity generation in J Set electricity generation in J
:param value: float :param value: float
""" """
self._electricity_generation = value self._electricity_generation = float(value)

View File

@ -31,7 +31,7 @@ class Sensor:
Set sensor name Set sensor name
:param value: str :param value: str
""" """
self._name = value self._name = str(value)
@property @property
def type(self): def type(self):

View File

@ -100,7 +100,7 @@ class Connection:
Set if the vehicles which pass this (lane to lane) connection will not wait Set if the vehicles which pass this (lane to lane) connection will not wait
:param value: Boolean :param value: Boolean
""" """
self._pass = value self._pass = bool(value)
@property @property
def keep_clear(self): def keep_clear(self):
@ -116,4 +116,4 @@ class Connection:
Set if vehicles which pass this (lane to lane) connection should keep the intersection clear Set if vehicles which pass this (lane to lane) connection should keep the intersection clear
:param value: Boolean :param value: Boolean
""" """
self._keep_clear = value self._keep_clear = bool(value)

View File

@ -35,7 +35,7 @@ class Crossing(TrafficNode):
Set whether the pedestrians have priority over the vehicles Set whether the pedestrians have priority over the vehicles
:param value: bool :param value: bool
""" """
self._priority = value self._priority = bool(value)
@property @property
def width(self): def width(self):
@ -51,7 +51,7 @@ class Crossing(TrafficNode):
Set crossing width in meters Set crossing width in meters
:param value: float :param value: float
""" """
self._width = value self._width = float(value)
@property @property
def shape(self) -> List[List[float]]: def shape(self) -> List[List[float]]:
@ -67,4 +67,4 @@ class Crossing(TrafficNode):
Set the list of positions Set the list of positions
:param value: [[x, y, (z)]] :param value: [[x, y, (z)]]
""" """
self._shape = value self._shape = [[float(i) for i in value]]

View File

@ -38,7 +38,7 @@ class Lane:
The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one) The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)
:param value: int :param value: int
""" """
self._index = value self._index = int(value)
@property @property
def allow(self) -> List[str]: def allow(self) -> List[str]:
@ -54,7 +54,7 @@ class Lane:
Set the list of allowed vehicle classes setter Set the list of allowed vehicle classes setter
:param value: [str] :param value: [str]
""" """
self._allow = value self._allow = [str(i) for i in value]
@property @property
def disallow(self) -> List[str]: def disallow(self) -> List[str]:
@ -70,7 +70,7 @@ class Lane:
Get the list of not allowed vehicle classes setter Get the list of not allowed vehicle classes setter
:param value: [str] :param value: [str]
""" """
self._disallow = value self._disallow = [str(i) for i in value]
@property @property
def change_left(self) -> List[str]: def change_left(self) -> List[str]:
@ -86,7 +86,7 @@ class Lane:
Set the list of vehicle classes that may change left from this lane Set the list of vehicle classes that may change left from this lane
:param value: [str] :param value: [str]
""" """
self._change_left = value self._change_left = [str(i) for i in value]
@property @property
def change_right(self) -> List[str]: def change_right(self) -> List[str]:
@ -102,7 +102,7 @@ class Lane:
Set the list of vehicle classes that may change right from this lane Set the list of vehicle classes that may change right from this lane
:param value: [str] :param value: [str]
""" """
self._change_right = value self._change_right = [str(i) for i in value]
@property @property
def speed(self): def speed(self):
@ -118,7 +118,7 @@ class Lane:
Set the lane speed in m/s Set the lane speed in m/s
:param value: float :param value: float
""" """
self._speed = value self._speed = float(value)
@property @property
def width(self): def width(self):
@ -134,4 +134,4 @@ class Lane:
Set the lane width in meters Set the lane width in meters
:param value: float :param value: float
""" """
self._width = value self._width = float(value)

View File

@ -35,7 +35,7 @@ class Phase:
Set phase duration in seconds Set phase duration in seconds
:param value: int :param value: int
""" """
self._duration = value self._duration = int(value)
@property @property
def state(self): def state(self):
@ -51,7 +51,7 @@ class Phase:
Set the list of signal states Set the list of signal states
:param value: [str] :param value: [str]
""" """
self._state = value self._state = [str(i) for i in value]
@property @property
def min_duration(self): def min_duration(self):
@ -69,7 +69,7 @@ class Phase:
Set phase minimum duration in seconds Set phase minimum duration in seconds
:param value: int :param value: int
""" """
self._min_duration = value self._min_duration = int(value)
@property @property
def max_duration(self): def max_duration(self):
@ -87,7 +87,7 @@ class Phase:
Set phase maximum duration in seconds Set phase maximum duration in seconds
:param value: int :param value: int
""" """
self._max_duration = value self._max_duration = int(value)
@property @property
def name(self): def name(self):
@ -103,7 +103,7 @@ class Phase:
Set phase name Set phase name
:param value: str :param value: str
""" """
self._name = value self._name = str(value)
@property @property
def next(self) -> List[int]: def next(self) -> List[int]:
@ -125,4 +125,4 @@ class Phase:
successor phases. successor phases.
:param value: [int] :param value: [int]
""" """
self._next = value self._next = [int(i) for i in value]

View File

@ -69,7 +69,7 @@ class TrafficEdge(Edge):
It starts with one; higher numbers represent more important roads. It starts with one; higher numbers represent more important roads.
:param value: int :param value: int
""" """
self._priority = value self._priority = int(value)
@property @property
def speed(self): def speed(self):
@ -85,7 +85,7 @@ class TrafficEdge(Edge):
Set the speed limit in m/s Set the speed limit in m/s
:param value: float :param value: float
""" """
self._speed = value self._speed = float(value)
@property @property
def length(self): def length(self):
@ -101,7 +101,7 @@ class TrafficEdge(Edge):
Set the lane length in meters Set the lane length in meters
:param value: float :param value: float
""" """
self._length = value self._length = float(value)
@property @property
def allows(self) -> List[str]: def allows(self) -> List[str]:
@ -117,7 +117,7 @@ class TrafficEdge(Edge):
Set the list of allowed vehicle classes Set the list of allowed vehicle classes
:param value: [str] :param value: [str]
""" """
self._allows = value self._allows = [str(i) for i in value]
@property @property
def disallows(self) -> List[str]: def disallows(self) -> List[str]:
@ -133,4 +133,4 @@ class TrafficEdge(Edge):
Set the list of not allowed vehicle classes Set the list of not allowed vehicle classes
:param value: [str] :param value: [str]
""" """
self._disallows = value self._disallows = [str(i) for i in value]

View File

@ -37,7 +37,7 @@ class TrafficLight(TrafficNode):
Get if is possible to turn right when the traffic light is red Get if is possible to turn right when the traffic light is red
:param value: Boolean :param value: Boolean
""" """
self._right_on_red = value self._right_on_red = bool(value)
@property @property
def offset(self): def offset(self):
@ -53,7 +53,7 @@ class TrafficLight(TrafficNode):
Set program initial time offset Set program initial time offset
:param value: int :param value: int
""" """
self._offset = value self._offset = int(value)
@property @property
def phases(self) -> List[Phase]: def phases(self) -> List[Phase]:

View File

@ -33,4 +33,4 @@ class WalkwayNode(TrafficNode):
Set the list of positions Set the list of positions
:param value: [[x, y, (z)]] :param value: [[x, y, (z)]]
""" """
self._shape = value self._shape = [[float(i) for i in value]]