Review comments and homogenize getter and setters code comment texts

This commit is contained in:
Guille Gutierrez 2021-08-30 14:39:24 -04:00
parent 5e33a41493
commit 5282e51695
52 changed files with 350 additions and 328 deletions

View File

@ -23,14 +23,15 @@ class Edge:
@property @property
def name(self): def name(self):
""" """
Edge name Get edge name
:return: str
""" """
return self._name return self._name
@property @property
def id(self): def id(self):
""" """
Edge id, an universally unique identifier randomly generated Get edge id, an universally unique identifier randomly generated
:return: str :return: str
""" """
if self._id is None: if self._id is None:
@ -40,6 +41,7 @@ class Edge:
@property @property
def nodes(self) -> List[Node]: def nodes(self) -> List[Node]:
""" """
Delimiting nodes for the edge Get delimiting nodes for the edge
:return: [Node]
""" """
return self._nodes return self._nodes

View File

@ -24,14 +24,15 @@ class Node:
@property @property
def name(self): def name(self):
""" """
Node name Get node name
:return: str
""" """
return self._name return self._name
@property @property
def id(self): def id(self):
""" """
Node id, an universally unique identifier randomly generated Get node id, an universally unique identifier randomly generated
:return: str :return: str
""" """
if self._id is None: if self._id is None:
@ -41,6 +42,7 @@ class Node:
@property @property
def edges(self) -> List[Edge]: def edges(self) -> List[Edge]:
""" """
Edges delimited by the node get edges delimited by the node
:return: [Edge]
""" """
return self._edges return self._edges

View File

@ -26,8 +26,8 @@ class Plane:
@property @property
def origin(self) -> Point: def origin(self) -> Point:
""" """
Point origin of the plane Get plane origin point
return Point :return: Point
""" """
if self._origin is None: if self._origin is None:
raise NotImplementedError raise NotImplementedError
@ -36,8 +36,8 @@ class Plane:
@property @property
def normal(self): def normal(self):
""" """
Plane normal [x, y, z] Get plane normal [x, y, z]
return np.ndarray :return: np.ndarray
""" """
if self._normal is None: if self._normal is None:
raise NotImplementedError raise NotImplementedError
@ -46,8 +46,8 @@ class Plane:
@property @property
def opposite_normal(self): def opposite_normal(self):
""" """
Plane normal in the opposite direction [x, y, z] get plane normal in the opposite direction [x, y, z]
return np.ndarray :return: np.ndarray
""" """
if self._opposite_normal is None: if self._opposite_normal is None:
coordinates = [] coordinates = []

View File

@ -18,13 +18,14 @@ class Point:
@property @property
def coordinates(self): def coordinates(self):
""" """
Point coordinates Get point coordinates
:return: [ndarray]
""" """
return self._coordinates return self._coordinates
def distance_to_point(self, other_point): def distance_to_point(self, other_point):
""" """
distance between points in an n-D Euclidean space Calculates distance between points in an n-D Euclidean space
:param other_point: point or vertex :param other_point: point or vertex
:return: float :return: float
""" """

View File

@ -36,8 +36,8 @@ class Polygon:
@property @property
def points(self) -> List[Point]: def points(self) -> List[Point]:
""" """
List of points belonging to the polygon [[x, y, z],...] Get the points belonging to the polygon [[x, y, z],...]
:return: List[Point] :return: [Point]
""" """
if self._points is None: if self._points is None:
self._points = [] self._points = []
@ -48,7 +48,7 @@ class Polygon:
@property @property
def coordinates(self) -> List[np.ndarray]: def coordinates(self) -> List[np.ndarray]:
""" """
List of points in the shape of its coordinates belonging to the polygon [[x, y, z],...] Get the points in the shape of its coordinates belonging to the polygon [[x, y, z],...]
:return: [np.ndarray] :return: [np.ndarray]
""" """
return self._coordinates return self._coordinates
@ -56,7 +56,7 @@ class Polygon:
@property @property
def points_list(self) -> np.ndarray: def points_list(self) -> np.ndarray:
""" """
Solid surface point coordinates list [x, y, z, x, y, z,...] Get the solid surface point coordinates list [x, y, z, x, y, z,...]
:return: np.ndarray :return: np.ndarray
""" """
if self._points_list is None: if self._points_list is None:
@ -65,9 +65,10 @@ class Polygon:
return self._points_list return self._points_list
@property @property
def edges(self): def edges(self) -> List[List[Point]]:
""" """
Polygon edges list Get polygon edges list
:return: [[Point]]
""" """
if self._edges is None: if self._edges is None:
self._edges = [] self._edges = []
@ -81,7 +82,7 @@ class Polygon:
@property @property
def area(self): def area(self):
""" """
Surface area in square meters Get surface area in square meters
:return: float :return: float
""" """
# New method to calculate area # New method to calculate area
@ -150,7 +151,7 @@ class Polygon:
@property @property
def normal(self) -> np.ndarray: def normal(self) -> np.ndarray:
""" """
Surface normal vector Get surface normal vector
:return: np.ndarray :return: np.ndarray
""" """
if self._normal is None: if self._normal is None:
@ -211,7 +212,7 @@ class Polygon:
def triangulate(self) -> List[Polygon]: def triangulate(self) -> List[Polygon]:
""" """
triangulates a polygon following the ear clipping methodology Triangulates a polygon following the ear clipping methodology
:return: list[triangles] :return: list[triangles]
""" """
# todo: review triangulate_polygon in # todo: review triangulate_polygon in
@ -504,7 +505,7 @@ class Polygon:
@property @property
def inverse(self): def inverse(self):
""" """
Flips the order of the coordinates Get the polygon coordinates in reversed order
:return: [np.ndarray] :return: [np.ndarray]
""" """
if self._inverse is None: if self._inverse is None:
@ -578,7 +579,7 @@ class Polygon:
@property @property
def vertices(self) -> np.ndarray: def vertices(self) -> np.ndarray:
""" """
Polyhedron vertices Get polyhedron vertices
:return: np.ndarray(int) :return: np.ndarray(int)
""" """
if self._vertices is None: if self._vertices is None:
@ -603,7 +604,7 @@ class Polygon:
@property @property
def faces(self) -> List[List[int]]: def faces(self) -> List[List[int]]:
""" """
Polyhedron triangular faces Get polyhedron triangular faces
:return: [face] :return: [face]
""" """
if self._faces is None: if self._faces is None:

View File

@ -54,7 +54,7 @@ class Polyhedron:
@property @property
def vertices(self) -> np.ndarray: def vertices(self) -> np.ndarray:
""" """
Polyhedron vertices Get polyhedron vertices
:return: np.ndarray(int) :return: np.ndarray(int)
""" """
if self._vertices is None: if self._vertices is None:
@ -79,7 +79,7 @@ class Polyhedron:
@property @property
def faces(self) -> List[List[int]]: def faces(self) -> List[List[int]]:
""" """
Polyhedron triangular faces Get polyhedron triangular faces
:return: [face] :return: [face]
""" """
if self._faces is None: if self._faces is None:
@ -108,7 +108,7 @@ class Polyhedron:
@property @property
def trimesh(self) -> Union[Trimesh, None]: def trimesh(self) -> Union[Trimesh, None]:
""" """
Get trimesh Get polyhedron trimesh
:return: Trimesh :return: Trimesh
""" """
if self._trimesh is None: if self._trimesh is None:
@ -122,7 +122,7 @@ class Polyhedron:
@property @property
def volume(self): def volume(self):
""" """
Polyhedron volume in cubic meters Get polyhedron volume in cubic meters
:return: float :return: float
""" """
if self._volume is None: if self._volume is None:
@ -137,7 +137,7 @@ class Polyhedron:
@property @property
def max_z(self): def max_z(self):
""" """
Polyhedron maximal z value in meters Get polyhedron maximal z value in meters
:return: float :return: float
""" """
if self._max_z is None: if self._max_z is None:
@ -150,7 +150,7 @@ class Polyhedron:
@property @property
def max_y(self): def max_y(self):
""" """
Polyhedron maximal y value in meters Get polyhedron maximal y value in meters
:return: float :return: float
""" """
if self._max_y is None: if self._max_y is None:
@ -164,7 +164,7 @@ class Polyhedron:
@property @property
def max_x(self): def max_x(self):
""" """
Polyhedron maximal x value in meters Get polyhedron maximal x value in meters
:return: float :return: float
""" """
if self._max_x is None: if self._max_x is None:
@ -177,7 +177,7 @@ class Polyhedron:
@property @property
def min_z(self): def min_z(self):
""" """
Polyhedron minimal z value in meters Get polyhedron minimal z value in meters
:return: float :return: float
""" """
if self._min_z is None: if self._min_z is None:
@ -191,7 +191,7 @@ class Polyhedron:
@property @property
def min_y(self): def min_y(self):
""" """
Polyhedron minimal y value in meters Get polyhedron minimal y value in meters
:return: float :return: float
""" """
if self._min_y is None: if self._min_y is None:
@ -205,7 +205,7 @@ class Polyhedron:
@property @property
def min_x(self): def min_x(self):
""" """
Polyhedron minimal x value in meters Get polyhedron minimal x value in meters
:return: float :return: float
""" """
if self._min_x is None: if self._min_x is None:
@ -217,9 +217,9 @@ class Polyhedron:
return self._min_x return self._min_x
@property @property
def centroid(self): def centroid(self) -> [float]:
""" """
Polyhedron centroid Get polyhedron centroid
:return: [x,y,z] :return: [x,y,z]
""" """
if self._centroid is None: if self._centroid is None:
@ -248,5 +248,6 @@ class Polyhedron:
def show(self): def show(self):
""" """
Auxiliary function to render the polyhedron Auxiliary function to render the polyhedron
:return: None
""" """
self.trimesh.show() self.trimesh.show()

View File

@ -18,7 +18,7 @@ class ScheduleValue:
def hour(self): def hour(self):
""" """
Get hours Get hours
:return: hour of a day :return: str
""" """
return self._hour return self._hour
@ -26,6 +26,6 @@ class ScheduleValue:
def probability(self): def probability(self):
""" """
Get probabilities of occupants' presence Get probabilities of occupants' presence
:return: occupants' presence probabilities :return: float
""" """
return self._probability return self._probability

View File

@ -63,7 +63,7 @@ class Building(CityObject):
@property @property
def grounds(self) -> [Surface]: def grounds(self) -> [Surface]:
""" """
Building ground surfaces Get building ground surfaces
""" """
return self._grounds return self._grounds
@ -92,14 +92,16 @@ class Building(CityObject):
@property @property
def roofs(self) -> [Surface]: def roofs(self) -> [Surface]:
""" """
Building roof surfaces Get building roof surfaces
:return: [Surface]
""" """
return self._roofs return self._roofs
@property @property
def walls(self) -> [Surface]: def walls(self) -> [Surface]:
""" """
Building wall surfaces Get building wall surfaces
:return: [Surface]
""" """
return self._walls return self._walls
@ -135,7 +137,6 @@ 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
:return: None
""" """
self._attic_heated = value self._attic_heated = value
@ -152,14 +153,13 @@ 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
:return: None
""" """
self._basement_heated = value self._basement_heated = value
@property @property
def name(self): def name(self):
""" """
City object name Get building name
:return: str :return: str
""" """
return self._name return self._name
@ -167,7 +167,7 @@ class Building(CityObject):
@property @property
def thermal_zones(self) -> List[ThermalZone]: def thermal_zones(self) -> List[ThermalZone]:
""" """
City object thermal zones Get building thermal zones
:return: [ThermalZone] :return: [ThermalZone]
""" """
if len(self._thermal_zones) == 0: if len(self._thermal_zones) == 0:
@ -178,8 +178,7 @@ class Building(CityObject):
@property @property
def heated_volume(self): def heated_volume(self):
""" """
City object heated volume in cubic meters Raises not implemented error
:return: float
""" """
# ToDo: this need to be calculated based on the basement and attic heated values # ToDo: this need to be calculated based on the basement and attic heated values
raise NotImplementedError raise NotImplementedError
@ -187,7 +186,7 @@ class Building(CityObject):
@property @property
def year_of_construction(self): def year_of_construction(self):
""" """
City object year of construction Get building year of construction
:return: int :return: int
""" """
return self._year_of_construction return self._year_of_construction
@ -195,7 +194,7 @@ class Building(CityObject):
@property @property
def function(self): def function(self):
""" """
City object function Get building function
:return: str :return: str
""" """
return self._function return self._function
@ -204,15 +203,14 @@ class Building(CityObject):
def function(self, value): def function(self, value):
""" """
Set building function Set building function
:param value: string :param value: str
:return: None
""" """
self._function = value self._function = value
@property @property
def average_storey_height(self): def average_storey_height(self):
""" """
Get city object average storey height in meters Get building average storey height in meters
:return: float :return: float
""" """
return self._average_storey_height return self._average_storey_height
@ -220,16 +218,15 @@ class Building(CityObject):
@average_storey_height.setter @average_storey_height.setter
def average_storey_height(self, value): def average_storey_height(self, value):
""" """
Set city object average storey height in meters Set building average storey height in meters
:param value: float :param value: float
:return: None
""" """
self._average_storey_height = value self._average_storey_height = value
@property @property
def storeys_above_ground(self): def storeys_above_ground(self):
""" """
Get city object storeys number above ground Get building storeys number above ground
:return: int :return: int
""" """
return self._storeys_above_ground return self._storeys_above_ground
@ -237,9 +234,8 @@ class Building(CityObject):
@storeys_above_ground.setter @storeys_above_ground.setter
def storeys_above_ground(self, value): def storeys_above_ground(self, value):
""" """
Set city object storeys number above ground Set building storeys number above ground
:param value: int :param value: int
:return:
""" """
self._storeys_above_ground = value self._storeys_above_ground = value
@ -250,7 +246,7 @@ class Building(CityObject):
@property @property
def heating(self) -> dict: def heating(self) -> dict:
""" """
heating demand in Wh Get heating demand in Wh
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._heating return self._heating
@ -258,7 +254,7 @@ class Building(CityObject):
@heating.setter @heating.setter
def heating(self, value): def heating(self, value):
""" """
heating demand in Wh Set heating demand in Wh
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._heating = value self._heating = value
@ -266,7 +262,7 @@ class Building(CityObject):
@property @property
def cooling(self) -> dict: def cooling(self) -> dict:
""" """
cooling demand in Wh Get cooling demand in Wh
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._cooling return self._cooling
@ -274,7 +270,7 @@ class Building(CityObject):
@cooling.setter @cooling.setter
def cooling(self, value): def cooling(self, value):
""" """
cooling demand in Wh Set cooling demand in Wh
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._cooling = value self._cooling = value
@ -282,7 +278,7 @@ class Building(CityObject):
@property @property
def eave_height(self): def eave_height(self):
""" """
building eave height in meters Get building eave height in meters
:return: float :return: float
""" """
if self._eave_height is None: if self._eave_height is None:
@ -294,7 +290,7 @@ class Building(CityObject):
@property @property
def storeys(self) -> [Storey]: def storeys(self) -> [Storey]:
""" """
Storeys inside the building Get building storeys
:return: [Storey] :return: [Storey]
""" """
return self._storeys return self._storeys
@ -302,7 +298,7 @@ class Building(CityObject):
@storeys.setter @storeys.setter
def storeys(self, value): def storeys(self, value):
""" """
Storeys inside the building Set building storeys
:param value: [Storey] :param value: [Storey]
""" """
self._storeys = value self._storeys = value
@ -310,7 +306,8 @@ class Building(CityObject):
@property @property
def roof_type(self): def roof_type(self):
""" """
Roof type for the building flat or pitch Get roof type for the building flat or pitch
:return: str
""" """
if self._roof_type is None: if self._roof_type is None:
self._roof_type = 'flat' self._roof_type = 'flat'
@ -324,7 +321,7 @@ class Building(CityObject):
@property @property
def floor_area(self): def floor_area(self):
""" """
Floor area of the building m2 Get building floor area in square meters
:return: float :return: float
""" """
if self._floor_area is None: if self._floor_area is None:
@ -337,7 +334,7 @@ class Building(CityObject):
@property @property
def thermal_boundaries(self) -> List[ThermalBoundary]: def thermal_boundaries(self) -> List[ThermalBoundary]:
""" """
List of all thermal boundaries associated to the building's thermal zones Get all thermal boundaries associated to the building's thermal zones
:return: [ThermalBoundary] :return: [ThermalBoundary]
""" """
if self._thermal_boundaries is None: if self._thermal_boundaries is None:

View File

@ -23,8 +23,8 @@ class Material:
@property @property
def name(self): def name(self):
""" """
Get material name Get material name
:return: string :return: str
""" """
return self._name return self._name
@ -39,8 +39,8 @@ class Material:
@property @property
def conductivity(self): def conductivity(self):
""" """
Get material conductivity in W/mK Get material conductivity in W/mK
:return: float :return: float
""" """
return self._conductivity return self._conductivity

View File

@ -70,7 +70,7 @@ class Occupants:
def occupant_type(self): def occupant_type(self):
""" """
Get type of schedules Get type of schedules
:return: string :return: str
""" """
return self._occupant_type return self._occupant_type
@ -150,7 +150,7 @@ class Occupants:
def departure_time(self, value): def departure_time(self, value):
""" """
Set the departure time of the occupant (for office building) in UTC with format YYYYMMDD HH:mm:ss Set the departure time of the occupant (for office building) in UTC with format YYYYMMDD HH:mm:ss
:param value: time :param value: str
""" """
self._departure_time = value self._departure_time = value
@ -167,7 +167,7 @@ class Occupants:
def day_of_week(self): def day_of_week(self):
""" """
Get the day of the week (MON, TUE, WED, THU, FRI, SAT, SUN) Get the day of the week (MON, TUE, WED, THU, FRI, SAT, SUN)
:return: string :return: str
""" """
# todo @Sanam: is this a property or should it be a function # todo @Sanam: is this a property or should it be a function
# to get the day of the week of an specific day of the year? # to get the day of the week of an specific day of the year?

View File

@ -29,7 +29,7 @@ class Storey:
@property @property
def name(self): def name(self):
""" """
Storey's name Get storey's name
:return: str :return: str
""" """
return self._name return self._name
@ -37,7 +37,7 @@ class Storey:
@property @property
def surfaces(self) -> List[Surface]: def surfaces(self) -> List[Surface]:
""" """
External surfaces enclosing the storey Get external surfaces enclosing the storey
:return: [Surface] :return: [Surface]
""" """
return self._storey_surfaces return self._storey_surfaces
@ -45,7 +45,7 @@ class Storey:
@property @property
def neighbours(self): def neighbours(self):
""" """
Neighbour storeys' names Get the neighbour storeys' names
:return: [str] :return: [str]
""" """
return self._neighbours return self._neighbours
@ -53,7 +53,7 @@ class Storey:
@property @property
def thermal_boundaries(self) -> List[ThermalBoundary]: def thermal_boundaries(self) -> List[ThermalBoundary]:
""" """
Thermal boundaries bounding the thermal zone Get the thermal boundaries bounding the thermal zone
:return: [ThermalBoundary] :return: [ThermalBoundary]
""" """
if self._thermal_boundaries is None: if self._thermal_boundaries is None:
@ -65,7 +65,7 @@ class Storey:
@property @property
def virtual_surfaces(self) -> List[Surface]: def virtual_surfaces(self) -> List[Surface]:
""" """
Internal surfaces enclosing the thermal zone Get the internal surfaces enclosing the thermal zone
:return: [Surface] :return: [Surface]
""" """
if self._virtual_surfaces is None: if self._virtual_surfaces is None:
@ -77,7 +77,7 @@ class Storey:
@property @property
def thermal_zone(self) -> ThermalZone: def thermal_zone(self) -> ThermalZone:
""" """
Thermal zone inside the storey Get the thermal zone inside the storey
:return: ThermalZone :return: ThermalZone
""" """
if self._thermal_zone is None: if self._thermal_zone is None:
@ -87,7 +87,7 @@ class Storey:
@property @property
def volume(self): def volume(self):
""" """
Storey's volume Get storey's volume in cubic meters
:return: float :return: float
""" """
return self._volume return self._volume

View File

@ -8,6 +8,7 @@ contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
from __future__ import annotations from __future__ import annotations
import uuid import uuid
import numpy as np import numpy as np
from typing import Union
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
from city_model_structure.attributes.plane import Plane from city_model_structure.attributes.plane import Plane
from city_model_structure.attributes.point import Point from city_model_structure.attributes.point import Point
@ -43,7 +44,7 @@ class Surface:
@property @property
def name(self): def name(self):
""" """
Surface name Get the surface name
:return: str :return: str
""" """
if self._name is None: if self._name is None:
@ -53,8 +54,8 @@ class Surface:
@property @property
def id(self): def id(self):
""" """
Surface id Get the surface id
:return str :return: str
""" """
if self._id is None: if self._id is None:
raise ValueError('Undefined surface id') raise ValueError('Undefined surface id')
@ -70,7 +71,8 @@ class Surface:
@id.setter @id.setter
def id(self, value): def id(self, value):
""" """
Surface id Set the surface id
:param value: str
""" """
self._id = value self._id = value
@ -123,7 +125,7 @@ class Surface:
@property @property
def lower_corner(self): def lower_corner(self):
""" """
Surface's lower corner [x, y, z] Get surface's lower corner [x, y, z]
:return: [float] :return: [float]
""" """
if self._lower_corner is None: if self._lower_corner is None:
@ -133,7 +135,7 @@ class Surface:
@property @property
def upper_corner(self): def upper_corner(self):
""" """
Surface's upper corner [x, y, z] Get surface's upper corner [x, y, z]
:return: [float] :return: [float]
""" """
if self._upper_corner is None: if self._upper_corner is None:
@ -143,7 +145,7 @@ class Surface:
@property @property
def area_above_ground(self): def area_above_ground(self):
""" """
Surface area above ground in square meters Get surface area above ground in square meters
:return: float :return: float
""" """
if self._area_above_ground is None: if self._area_above_ground is None:
@ -154,7 +156,7 @@ class Surface:
@property @property
def area_below_ground(self): def area_below_ground(self):
""" """
Surface area below ground in square meters Get surface area below ground in square meters
:return: float :return: float
""" """
return 0.0 return 0.0
@ -162,7 +164,7 @@ class Surface:
@property @property
def azimuth(self): def azimuth(self):
""" """
Surface azimuth in radians Get surface azimuth in radians
:return: float :return: float
""" """
if self._azimuth is None: if self._azimuth is None:
@ -173,7 +175,7 @@ class Surface:
@property @property
def inclination(self): def inclination(self):
""" """
Surface inclination in radians Get surface inclination in radians
:return: float :return: float
""" """
if self._inclination is None: if self._inclination is None:
@ -183,7 +185,7 @@ class Surface:
@property @property
def type(self): def type(self):
""" """
Surface type Ground, Wall or Roof Get surface type Ground, Wall or Roof
:return: str :return: str
""" """
if self._type is None: if self._type is None:
@ -199,7 +201,7 @@ class Surface:
@property @property
def global_irradiance(self) -> dict: def global_irradiance(self) -> dict:
""" """
global irradiance on surface in Wh/m2 Get global irradiance on surface in Wh/m2
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._global_irradiance return self._global_irradiance
@ -207,7 +209,7 @@ class Surface:
@global_irradiance.setter @global_irradiance.setter
def global_irradiance(self, value): def global_irradiance(self, value):
""" """
global irradiance on surface in Wh/m2 Set global irradiance on surface in Wh/m2
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._global_irradiance = value self._global_irradiance = value
@ -215,7 +217,7 @@ class Surface:
@property @property
def perimeter_polygon(self) -> Polygon: def perimeter_polygon(self) -> Polygon:
""" """
total surface defined by the perimeter, merging solid and holes Get a polygon surface defined by the perimeter, merging solid and holes
:return: Polygon :return: Polygon
""" """
return self._perimeter_polygon return self._perimeter_polygon
@ -223,15 +225,15 @@ class Surface:
@property @property
def solid_polygon(self) -> Polygon: def solid_polygon(self) -> Polygon:
""" """
solid surface Get the solid surface
:return: Polygon :return: Polygon
""" """
return self._solid_polygon return self._solid_polygon
@property @property
def holes_polygons(self) -> [Polygon]: def holes_polygons(self) -> Union[Polygon, None]:
""" """
hole surfaces, a list of hole polygons found in the surface Get hole surfaces, a list of hole polygons found in the surface
:return: None, [] or [Polygon] :return: None, [] or [Polygon]
None -> not known whether holes exist in reality or not due to low level of detail of input data None -> not known whether holes exist in reality or not due to low level of detail of input data
[] -> no holes in the surface [] -> no holes in the surface
@ -242,7 +244,7 @@ class Surface:
@property @property
def pv_system_installed(self) -> PvSystem: def pv_system_installed(self) -> PvSystem:
""" """
PV system installed on the surface Get PV system installed on the surface
:return: PvSystem :return: PvSystem
""" """
return self._pv_system_installed return self._pv_system_installed
@ -250,7 +252,7 @@ class Surface:
@pv_system_installed.setter @pv_system_installed.setter
def pv_system_installed(self, value): def pv_system_installed(self, value):
""" """
PV system installed on the surface Set PV system installed on the surface
:param value: PvSystem :param value: PvSystem
""" """
self._pv_system_installed = value self._pv_system_installed = value
@ -258,7 +260,7 @@ class Surface:
@property @property
def inverse(self) -> Surface: def inverse(self) -> Surface:
""" """
Returns the same surface pointing backwards Get the inverse surface (the same surface pointing backwards)
:return: Surface :return: Surface
""" """
if self._inverse is None: if self._inverse is None:
@ -283,6 +285,7 @@ class Surface:
def divide(self, z): def divide(self, z):
""" """
Divides a surface at Z plane Divides a surface at Z plane
:return: Surface, Surface, Any
""" """
# todo: recheck this method for LoD3 (windows) # todo: recheck this method for LoD3 (windows)
origin = Point([0, 0, z]) origin = Point([0, 0, z])

View File

@ -61,7 +61,7 @@ class ThermalBoundary:
@thermal_zones.setter @thermal_zones.setter
def thermal_zones(self, value): def thermal_zones(self, value):
""" """
Thermal zones delimited by the thermal boundary Set the thermal zones delimited by the thermal boundary
:param value: [ThermalZone] :param value: [ThermalZone]
""" """
self._thermal_zones = value self._thermal_zones = value
@ -69,7 +69,7 @@ class ThermalBoundary:
@property @property
def azimuth(self): def azimuth(self):
""" """
Thermal boundary azimuth in radians Get the thermal boundary azimuth in radians
:return: float :return: float
""" """
return self._surface.azimuth return self._surface.azimuth
@ -77,7 +77,7 @@ class ThermalBoundary:
@property @property
def inclination(self): def inclination(self):
""" """
Thermal boundary inclination in radians Set the thermal boundary inclination in radians
:return: float :return: float
""" """
return self._surface.inclination return self._surface.inclination
@ -85,7 +85,7 @@ class ThermalBoundary:
@property @property
def area(self): def area(self):
""" """
Thermal boundary area in square meters Set the thermal boundary area in square meters
:return: float :return: float
""" """
# to check the lod without depending on that parameter # to check the lod without depending on that parameter
@ -98,7 +98,7 @@ class ThermalBoundary:
@property @property
def _total_area_including_windows(self): def _total_area_including_windows(self):
""" """
Thermal boundary plus windows area in square meters Get the thermal boundary plus windows area in square meters
:return: float :return: float
""" """
return self.surface.perimeter_polygon.area return self.surface.perimeter_polygon.area
@ -106,7 +106,7 @@ class ThermalBoundary:
@property @property
def thickness(self): def thickness(self):
""" """
Thermal boundary thickness in meters Get the thermal boundary thickness in meters
:return: float :return: float
""" """
if self._thickness is None: if self._thickness is None:
@ -225,7 +225,7 @@ class ThermalBoundary:
@property @property
def type(self): def type(self):
""" """
Thermal boundary surface type Get thermal boundary surface type
:return: str :return: str
""" """
return self._surface.type return self._surface.type
@ -246,7 +246,6 @@ class ThermalBoundary:
""" """
self._window_ratio = value self._window_ratio = value
# todo: what if I just want to assign a number?? @Guille
@property @property
def u_value(self): def u_value(self):
""" """
@ -322,15 +321,14 @@ class ThermalBoundary:
def he(self, value): def he(self, value):
""" """
Set external convective heat transfer coefficient (W/m2K) Set external convective heat transfer coefficient (W/m2K)
:param value: external convective heat transfer coefficient (W/m2K) :param value: float
""" """
self._he = value self._he = value
@property @property
def surface_geometry(self) -> Union[NotImplementedError, Polygon]: def surface_geometry(self):
""" """
Get the polygon that defines the thermal boundary Raises not implemented error
:return: Polygon
""" """
raise NotImplementedError raise NotImplementedError

View File

@ -33,7 +33,7 @@ class ThermalOpening:
@property @property
def area(self): def area(self):
""" """
Thermal opening area in square meters Get thermal opening area in square meters
:return: float :return: float
""" """
return self._area return self._area
@ -41,7 +41,7 @@ class ThermalOpening:
@area.setter @area.setter
def area(self, value): def area(self, value):
""" """
Thermal opening area in square meters setter Set thermal opening area in square meters
:param value: float :param value: float
""" """
self._area = value self._area = value
@ -49,17 +49,14 @@ class ThermalOpening:
@property @property
def openable_ratio(self): def openable_ratio(self):
""" """
Get thermal opening openable ratio, NOT IMPLEMENTED Raises not implemented error
:return: Exception
""" """
raise NotImplementedError raise NotImplementedError
@openable_ratio.setter @openable_ratio.setter
def openable_ratio(self, value): def openable_ratio(self, value):
""" """
Set thermal opening openable ratio, NOT IMPLEMENTED Raises not implemented error
:param value: Any
:return: Exception
""" """
raise NotImplementedError raise NotImplementedError
@ -74,7 +71,7 @@ class ThermalOpening:
@conductivity.setter @conductivity.setter
def conductivity(self, value): def conductivity(self, value):
""" """
Get thermal opening conductivity in W/mK Set thermal opening conductivity in W/mK
:param value: float :param value: float
""" """
# 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.
@ -184,7 +181,7 @@ class ThermalOpening:
@overall_u_value.setter @overall_u_value.setter
def overall_u_value(self, value): def overall_u_value(self, value):
""" """
Get 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 = value
@ -201,7 +198,7 @@ class ThermalOpening:
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 = value
@ -217,7 +214,7 @@ class ThermalOpening:
def he(self, value): def he(self, value):
""" """
Set external convective heat transfer coefficient (W/m2K) Set external convective heat transfer coefficient (W/m2K)
:param value: external convective heat transfer coefficient (W/m2K) :param value: float
""" """
self._he = value self._he = value

View File

@ -186,7 +186,7 @@ class ThermalZone:
@property @property
def ordinate_number(self): def ordinate_number(self):
""" """
In case the thermal_zones need to be enumerated and their order saved, this property saves that order Get the order in which the thermal_zones need to be enumerated
:return: int :return: int
""" """
return self._ordinate_number return self._ordinate_number
@ -194,7 +194,7 @@ class ThermalZone:
@ordinate_number.setter @ordinate_number.setter
def ordinate_number(self, value): def ordinate_number(self, value):
""" """
Sets an 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 = value

View File

@ -69,7 +69,7 @@ class UsageZone:
@property @property
def heating_setpoint(self): def heating_setpoint(self):
""" """
Get usage zone heating set point in celsius grads Get usage zone heating set point in Celsius
:return: float :return: float
""" """
return self._heating_setpoint return self._heating_setpoint
@ -77,7 +77,7 @@ class UsageZone:
@heating_setpoint.setter @heating_setpoint.setter
def heating_setpoint(self, value): def heating_setpoint(self, value):
""" """
Set usage zone heating set point in celsius grads Set usage zone heating set point in Celsius
:param value: float :param value: float
""" """
self._heating_setpoint = value self._heating_setpoint = value
@ -85,7 +85,7 @@ class UsageZone:
@property @property
def heating_setback(self): def heating_setback(self):
""" """
Get usage zone heating setback in celsius grads Get usage zone heating setback in Celsius
:return: float :return: float
""" """
return self._heating_setback return self._heating_setback
@ -93,7 +93,7 @@ class UsageZone:
@heating_setback.setter @heating_setback.setter
def heating_setback(self, value): def heating_setback(self, value):
""" """
Set usage zone heating setback in celsius grads Set usage zone heating setback in Celsius
:param value: float :param value: float
""" """
self._heating_setback = value self._heating_setback = value
@ -101,7 +101,7 @@ class UsageZone:
@property @property
def cooling_setpoint(self): def cooling_setpoint(self):
""" """
Get usage zone cooling setpoint in celsius grads Get usage zone cooling setpoint in Celsius
:return: float :return: float
""" """
return self._cooling_setpoint return self._cooling_setpoint
@ -109,7 +109,7 @@ class UsageZone:
@cooling_setpoint.setter @cooling_setpoint.setter
def cooling_setpoint(self, value): def cooling_setpoint(self, value):
""" """
Set usage zone cooling setpoint in celsius grads Set usage zone cooling setpoint in Celsius
:param value: float :param value: float
""" """
self._cooling_setpoint = value self._cooling_setpoint = value
@ -149,7 +149,7 @@ class UsageZone:
@property @property
def mechanical_air_change(self): def mechanical_air_change(self):
""" """
Set usage zone mechanical air change in air change per hour (ACH) Get usage zone mechanical air change in air change per hour (ACH)
:return: float :return: float
""" """
return self._mechanical_air_change return self._mechanical_air_change
@ -157,7 +157,7 @@ class UsageZone:
@mechanical_air_change.setter @mechanical_air_change.setter
def mechanical_air_change(self, value): def mechanical_air_change(self, value):
""" """
Get 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 = value
@ -173,7 +173,7 @@ class UsageZone:
@usage.setter @usage.setter
def usage(self, value): def usage(self, value):
""" """
Get usage zone usage Set usage zone usage
:param value: str :param value: str
""" """
self._usage = value self._usage = value
@ -205,7 +205,7 @@ class UsageZone:
@heating_schedule.setter @heating_schedule.setter
def heating_schedule(self, values): def heating_schedule(self, values):
""" """
heating schedules Set heating schedules
:param values: dict{DataFrame(int)} :param values: dict{DataFrame(int)}
""" """
self._heating_schedule = values self._heating_schedule = values
@ -221,7 +221,7 @@ class UsageZone:
@cooling_schedule.setter @cooling_schedule.setter
def cooling_schedule(self, values): def cooling_schedule(self, values):
""" """
cooling schedules Set cooling schedules
:param values: dict{DataFrame(int)} :param values: dict{DataFrame(int)}
""" """
self._cooling_schedule = values self._cooling_schedule = values
@ -237,7 +237,7 @@ class UsageZone:
@ventilation_schedule.setter @ventilation_schedule.setter
def ventilation_schedule(self, values): def ventilation_schedule(self, values):
""" """
ventilation_schedule schedules Set ventilation_schedule schedules
:param values: dict{DataFrame(int)} :param values: dict{DataFrame(int)}
""" """
self._ventilation_schedule = values self._ventilation_schedule = values
@ -261,7 +261,7 @@ class UsageZone:
@property @property
def occupancy_density(self): def occupancy_density(self):
""" """
Get schedules density in persons per m2 Get schedules density in persons per square meter
:return: float :return: float
""" """
return self._occupancy_density return self._occupancy_density
@ -269,7 +269,7 @@ class UsageZone:
@occupancy_density.setter @occupancy_density.setter
def occupancy_density(self, values): def occupancy_density(self, values):
""" """
schedules density in persons per m2 Set schedules density in persons per square meter
:param values: float :param values: float
""" """
self._occupancy_density = values self._occupancy_density = values
@ -277,7 +277,7 @@ class UsageZone:
@property @property
def dhw_average_volume_pers_day(self): def dhw_average_volume_pers_day(self):
""" """
Get average DHW consumption in m3 per person per day Get average DHW consumption in cubic meters per person per day
:return: float :return: float
""" """
return self._dhw_average_volume_pers_day return self._dhw_average_volume_pers_day
@ -285,7 +285,7 @@ class UsageZone:
@dhw_average_volume_pers_day.setter @dhw_average_volume_pers_day.setter
def dhw_average_volume_pers_day(self, values): def dhw_average_volume_pers_day(self, values):
""" """
average DHW consumption in m3 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 = values
@ -293,7 +293,7 @@ class UsageZone:
@property @property
def dhw_preparation_temperature(self): def dhw_preparation_temperature(self):
""" """
Get preparation temperature of the DHW in degree Celsius Get preparation temperature of the DHW in Celsius
:return: float :return: float
""" """
return self._dhw_preparation_temperature return self._dhw_preparation_temperature
@ -301,7 +301,7 @@ class UsageZone:
@dhw_preparation_temperature.setter @dhw_preparation_temperature.setter
def dhw_preparation_temperature(self, values): def dhw_preparation_temperature(self, values):
""" """
preparation temperature of the DHW in degree Celsius Set preparation temperature of the DHW in Celsius
:param values: float :param values: float
""" """
self._dhw_preparation_temperature = values self._dhw_preparation_temperature = values
@ -309,7 +309,7 @@ class UsageZone:
@property @property
def electrical_app_average_consumption_sqm_year(self): def electrical_app_average_consumption_sqm_year(self):
""" """
Get average consumption of electrical appliances in Joules hour per m2 and year (J/m2yr) Get average consumption of electrical appliances in Joules hour per square meter and year (J/m2yr)
:return: float :return: float
""" """
return self._electrical_app_average_consumption_sqm_year return self._electrical_app_average_consumption_sqm_year
@ -317,7 +317,7 @@ class UsageZone:
@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, values):
""" """
average consumption of electrical appliances in Joules per m2 and year (J/m2yr) Set average consumption of electrical appliances in Joules per square meter and year (J/m2yr)
:param values: float :param values: float
""" """
self._electrical_app_average_consumption_sqm_year = values self._electrical_app_average_consumption_sqm_year = values
@ -333,7 +333,7 @@ class UsageZone:
@property @property
def volume(self): def volume(self):
""" """
Get the volume in m3 Get the volume in cubic meters
:return: float :return: float
""" """
return self._volume return self._volume
@ -341,7 +341,7 @@ class UsageZone:
@volume.setter @volume.setter
def volume(self, value): def volume(self, value):
""" """
Volume in m3 setter Set volume in cubic meters
:param value: float :param value: float
""" """
self._volume = value self._volume = value

View File

@ -24,7 +24,7 @@ class BuildingsCluster(CityObjectsCluster):
@property @property
def type(self): def type(self):
""" """
Cluster type Get cluster type
:return: str :return: str
""" """
return self._cluster_type return self._cluster_type
@ -32,7 +32,7 @@ class BuildingsCluster(CityObjectsCluster):
@property @property
def city_objects(self) -> List[CityObject]: def city_objects(self) -> List[CityObject]:
""" """
List of city objects conforming the cluster Get the list of city objects conforming the cluster
:return: [CityObject] :return: [CityObject]
""" """
return self._city_objects return self._city_objects

View File

@ -66,7 +66,7 @@ class City:
@property @property
def country_code(self): def country_code(self):
""" """
City country code Get city country code
:return: str :return: str
""" """
return self._get_location().country return self._get_location().country
@ -74,7 +74,7 @@ class City:
@property @property
def name(self): def name(self):
""" """
City name Get city name
:return: str :return: str
""" """
return self._get_location().city return self._get_location().city
@ -82,7 +82,7 @@ class City:
@property @property
def climate_reference_city(self): def climate_reference_city(self):
""" """
Name of the city of reference for climatic information Get the name for the climatic information reference city
:return: str :return: str
""" """
return self._climate_reference_city return self._climate_reference_city
@ -90,7 +90,7 @@ class City:
@climate_reference_city.setter @climate_reference_city.setter
def climate_reference_city(self, value): def climate_reference_city(self, value):
""" """
Name of the city of reference for climatic information Set the name for the climatic information reference city
:param value: str :param value: str
""" """
self._climate_reference_city = value self._climate_reference_city = value
@ -98,7 +98,7 @@ class City:
@property @property
def climate_file(self) -> Path: def climate_file(self) -> Path:
""" """
Full path of climate file Get the climate file full path
:return: Path :return: Path
""" """
return self._climate_file return self._climate_file
@ -106,7 +106,7 @@ class City:
@climate_file.setter @climate_file.setter
def climate_file(self, value): def climate_file(self, value):
""" """
Full path of climate file Set the climate file full path
:param value: Path :param value: Path
""" """
self._climate_file = value self._climate_file = value
@ -114,7 +114,7 @@ class City:
@property @property
def city_objects(self) -> Union[List[CityObject], None]: def city_objects(self) -> Union[List[CityObject], None]:
""" """
City objects belonging to the city Get the city objects belonging to the city
:return: None or [CityObject] :return: None or [CityObject]
""" """
if self._city_objects is None: if self._city_objects is None:
@ -130,7 +130,7 @@ class City:
@property @property
def buildings(self) -> Union[List[Building], None]: def buildings(self) -> Union[List[Building], None]:
""" """
Buildings belonging to the city Get the buildings belonging to the city
:return: None or [Building] :return: None or [Building]
""" """
return self._buildings return self._buildings
@ -138,31 +138,28 @@ class City:
@property @property
def trees(self) -> NotImplementedError: def trees(self) -> NotImplementedError:
""" """
Trees belonging to the city raises not implemented error
:return: NotImplementedError
""" """
raise NotImplementedError raise NotImplementedError
@property @property
def bixi_features(self) -> NotImplementedError: def bixi_features(self) -> NotImplementedError:
""" """
Bixi features belonging to the city raises not implemented error
:return: NotImplementedError
""" """
raise NotImplementedError raise NotImplementedError
@property @property
def composting_plants(self) -> NotImplementedError: def composting_plants(self) -> NotImplementedError:
""" """
Composting plants belonging to the city raises not implemented error
:return: NotImplementedError
""" """
raise NotImplementedError raise NotImplementedError
@property @property
def lower_corner(self): def lower_corner(self):
""" """
City lower corner Get city lower corner
:return: [x,y,z] :return: [x,y,z]
""" """
return self._lower_corner return self._lower_corner
@ -170,7 +167,7 @@ class City:
@property @property
def upper_corner(self): def upper_corner(self):
""" """
City upper corner Get city upper corner
:return: [x,y,z] :return: [x,y,z]
""" """
return self._upper_corner return self._upper_corner
@ -216,7 +213,7 @@ class City:
@property @property
def srs_name(self): def srs_name(self):
""" """
srs name Get city srs name
:return: str :return: str
""" """
return self._srs_name return self._srs_name
@ -224,9 +221,8 @@ class City:
@name.setter @name.setter
def name(self, value): def name(self, value):
""" """
Set the city name Set city name
:param value:str :param value:str
:return: None
""" """
self._name = value self._name = value
@ -273,7 +269,7 @@ class City:
@property @property
def latitude(self): def latitude(self):
""" """
city latitude in degrees Get city latitude in degrees
:return: float :return: float
""" """
return self._latitude return self._latitude
@ -281,7 +277,7 @@ class City:
@latitude.setter @latitude.setter
def latitude(self, value): def latitude(self, value):
""" """
city latitude in degrees Set city latitude in degrees
:parameter value: float :parameter value: float
""" """
self._latitude = value self._latitude = value
@ -289,7 +285,7 @@ class City:
@property @property
def longitude(self): def longitude(self):
""" """
city longitude in degrees Get city longitude in degrees
:return: float :return: float
""" """
return self._longitude return self._longitude
@ -297,7 +293,7 @@ class City:
@longitude.setter @longitude.setter
def longitude(self, value): def longitude(self, value):
""" """
city longitude in degrees Set city longitude in degrees
:parameter value: float :parameter value: float
""" """
self._longitude = value self._longitude = value
@ -305,7 +301,7 @@ class City:
@property @property
def time_zone(self): def time_zone(self):
""" """
city time_zone Get city time_zone
:return: float :return: float
""" """
return self._time_zone return self._time_zone
@ -313,7 +309,7 @@ class City:
@time_zone.setter @time_zone.setter
def time_zone(self, value): def time_zone(self, value):
""" """
city time_zone Set city time_zone
:parameter value: float :parameter value: float
""" """
self._time_zone = value self._time_zone = value
@ -321,7 +317,7 @@ class City:
@property @property
def buildings_clusters(self) -> Union[List[BuildingsCluster], None]: def buildings_clusters(self) -> Union[List[BuildingsCluster], None]:
""" """
buildings clusters belonging to the city Get buildings clusters belonging to the city
:return: None or [BuildingsCluster] :return: None or [BuildingsCluster]
""" """
return self._buildings_clusters return self._buildings_clusters
@ -329,7 +325,7 @@ class City:
@property @property
def parts_consisting_buildings(self) -> Union[List[PartsConsistingBuilding], None]: def parts_consisting_buildings(self) -> Union[List[PartsConsistingBuilding], None]:
""" """
Parts consisting buildings belonging to the city Get parts consisting buildings belonging to the city
:return: None or [PartsConsistingBuilding] :return: None or [PartsConsistingBuilding]
""" """
return self._parts_consisting_buildings return self._parts_consisting_buildings
@ -337,7 +333,7 @@ class City:
@property @property
def city_objects_clusters(self) -> Union[List[CityObjectsCluster], None]: def city_objects_clusters(self) -> Union[List[CityObjectsCluster], None]:
""" """
City objects clusters belonging to the city Get city objects clusters belonging to the city
:return: None or [CityObjectsCluster] :return: None or [CityObjectsCluster]
""" """
if self.buildings_clusters is None: if self.buildings_clusters is None:

View File

@ -40,7 +40,7 @@ class CityObject:
@property @property
def lod(self): def lod(self):
""" """
City object level of detail 1, 2, 3 or 4 Get city object level of detail 1, 2, 3 or 4
:return: int :return: int
""" """
lod = math.log(self._lod, 2) + 1 lod = math.log(self._lod, 2) + 1
@ -49,7 +49,7 @@ class CityObject:
@property @property
def type(self): def type(self):
""" """
city object type Get city object type
:return: str :return: str
""" """
return self._type return self._type
@ -57,7 +57,7 @@ class CityObject:
@property @property
def volume(self): def volume(self):
""" """
City object volume in cubic meters Get city object volume in cubic meters
:return: float :return: float
""" """
return self.simplified_polyhedron.volume return self.simplified_polyhedron.volume
@ -65,7 +65,7 @@ class CityObject:
@property @property
def detailed_polyhedron(self) -> Polyhedron: def detailed_polyhedron(self) -> Polyhedron:
""" """
City object polyhedron including details such as holes Get city object polyhedron including details such as holes
:return: Polyhedron :return: Polyhedron
""" """
if self._detailed_polyhedron is None: if self._detailed_polyhedron is None:
@ -81,7 +81,7 @@ class CityObject:
@property @property
def simplified_polyhedron(self) -> Polyhedron: def simplified_polyhedron(self) -> Polyhedron:
""" """
City object polyhedron, just the simple lod2 representation Get city object polyhedron, just the simple lod2 representation
:return: Polyhedron :return: Polyhedron
""" """
if self._simplified_polyhedron is None: if self._simplified_polyhedron is None:
@ -94,7 +94,7 @@ class CityObject:
@property @property
def surfaces(self) -> List[Surface]: def surfaces(self) -> List[Surface]:
""" """
City object surfaces Get city object surfaces
:return: [Surface] :return: [Surface]
""" """
return self._surfaces return self._surfaces
@ -124,7 +124,7 @@ class CityObject:
@property @property
def centroid(self): def centroid(self):
""" """
City object centroid Get city object centroid
:return: [x,y,z] :return: [x,y,z]
""" """
if self._centroid is None: if self._centroid is None:
@ -134,7 +134,7 @@ class CityObject:
@property @property
def max_height(self): def max_height(self):
""" """
City object maximal height in meters Get city object maximal height in meters
:return: float :return: float
""" """
return self.simplified_polyhedron.max_z return self.simplified_polyhedron.max_z
@ -142,7 +142,7 @@ class CityObject:
@property @property
def external_temperature(self) -> dict: def external_temperature(self) -> dict:
""" """
external temperature surrounding the city object in grads Celsius Get external temperature surrounding the city object in Celsius
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._external_temperature return self._external_temperature
@ -150,7 +150,7 @@ class CityObject:
@external_temperature.setter @external_temperature.setter
def external_temperature(self, value): def external_temperature(self, value):
""" """
external temperature surrounding the city object in grads Celsius Set external temperature surrounding the city object in Celsius
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._external_temperature = value self._external_temperature = value
@ -158,7 +158,7 @@ class CityObject:
@property @property
def global_horizontal(self) -> dict: def global_horizontal(self) -> dict:
""" """
global horizontal radiation surrounding the city object in W/m2 Get global horizontal radiation surrounding the city object in W/m2
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._global_horizontal return self._global_horizontal
@ -166,7 +166,7 @@ class CityObject:
@global_horizontal.setter @global_horizontal.setter
def global_horizontal(self, value): def global_horizontal(self, value):
""" """
global horizontal radiation surrounding the city object in W/m2 Set global horizontal radiation surrounding the city object in W/m2
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._global_horizontal = value self._global_horizontal = value
@ -174,7 +174,7 @@ class CityObject:
@property @property
def diffuse(self) -> dict: def diffuse(self) -> dict:
""" """
diffuse radiation surrounding the city object in W/m2 Get diffuse radiation surrounding the city object in W/m2
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._diffuse return self._diffuse
@ -182,7 +182,7 @@ class CityObject:
@diffuse.setter @diffuse.setter
def diffuse(self, value): def diffuse(self, value):
""" """
diffuse radiation surrounding the city object in W/m2 Set diffuse radiation surrounding the city object in W/m2
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._diffuse = value self._diffuse = value
@ -190,7 +190,7 @@ class CityObject:
@property @property
def beam(self) -> dict: def beam(self) -> dict:
""" """
beam radiation surrounding the city object in W/m2 Get beam radiation surrounding the city object in W/m2
:return: dict{DataFrame(float)} :return: dict{DataFrame(float)}
""" """
return self._beam return self._beam
@ -198,7 +198,7 @@ class CityObject:
@beam.setter @beam.setter
def beam(self, value): def beam(self, value):
""" """
beam radiation surrounding the city object in W/m2 Set beam radiation surrounding the city object in W/m2
:param value: dict{DataFrame(float)} :param value: dict{DataFrame(float)}
""" """
self._beam = value self._beam = value
@ -206,7 +206,8 @@ class CityObject:
@property @property
def lower_corner(self): def lower_corner(self):
""" """
City object lower corner coordinates [x, y, z] Get city object lower corner coordinates [x, y, z]
:return: [x,y,z]
""" """
if self._city_object_lower_corner is None: if self._city_object_lower_corner is None:
self._city_object_lower_corner = [self._min_x, self._min_y, self._min_z] self._city_object_lower_corner = [self._min_x, self._min_y, self._min_z]
@ -215,7 +216,7 @@ class CityObject:
@property @property
def sensors(self) -> List[Sensor]: def sensors(self) -> List[Sensor]:
""" """
Sensor list belonging to the city object Get sensors belonging to the city object
:return: [Sensor] :return: [Sensor]
""" """
return self._sensors return self._sensors
@ -223,7 +224,7 @@ class CityObject:
@sensors.setter @sensors.setter
def sensors(self, value): def sensors(self, value):
""" """
Sensor list belonging to the city object Set sensors belonging to the city object
:param value: [Sensor] :param value: [Sensor]
""" """
self._sensors = value self._sensors = value

View File

@ -25,7 +25,7 @@ class CityObjectsCluster(ABC, CityObject):
@property @property
def name(self): def name(self):
""" """
Cluster name Get cluster name
:return: str :return: str
""" """
return self._name return self._name
@ -33,14 +33,14 @@ class CityObjectsCluster(ABC, CityObject):
@property @property
def type(self): def type(self):
""" """
City object cluster type raises NotImplemented error raises not implemented error
""" """
raise NotImplementedError raise NotImplementedError
@property @property
def city_objects(self): def city_objects(self):
""" """
City objects raises NotImplemented error raises not implemented error
""" """
raise NotImplementedError raise NotImplementedError
@ -58,7 +58,7 @@ class CityObjectsCluster(ABC, CityObject):
@property @property
def sensors(self) -> List[Sensor]: def sensors(self) -> List[Sensor]:
""" """
Sensor list belonging to the city objects cluster Get sensors belonging to the city objects cluster
:return: [Sensor] :return: [Sensor]
""" """
return self._sensors return self._sensors
@ -66,7 +66,7 @@ class CityObjectsCluster(ABC, CityObject):
@sensors.setter @sensors.setter
def sensors(self, value): def sensors(self, value):
""" """
Sensor list belonging to the city objects cluster Set sensors belonging to the city objects cluster
:param value: [Sensor] :param value: [Sensor]
""" """
self._sensors = value self._sensors = value

View File

@ -19,8 +19,8 @@ class CompostingPlant(CityObject):
@property @property
def waste_type(self): def waste_type(self):
""" """
Get waste_type treated in composting plant Get waste type treated in composting plant
:return: waste_type :return: str
""" """
return self._waste_type return self._waste_type
@ -28,6 +28,6 @@ class CompostingPlant(CityObject):
def capacity(self): def capacity(self):
""" """
Get capacity of composting plant in kg Get capacity of composting plant in kg
:return: capacity :return: float
""" """
return self._capacity return self._capacity

View File

@ -17,15 +17,15 @@ class HeatPump:
def seasonal_mean_cop(self): def seasonal_mean_cop(self):
""" """
Get seasonal mean COP (-) Get seasonal mean COP (-)
:return: real :return: float
""" """
return self._seasonal_mean_cop return self._seasonal_mean_cop
@seasonal_mean_cop.setter @seasonal_mean_cop.setter
def seasonal_mean_cop(self, value): def seasonal_mean_cop(self, value):
""" """
Get seasonal mean COP (-) Set seasonal mean COP (-)
:param value: real :param value: float
""" """
self._seasonal_mean_cop = value self._seasonal_mean_cop = value
@ -33,7 +33,7 @@ class HeatPump:
def seasonal_mean_coverage_factor(self): def seasonal_mean_coverage_factor(self):
""" """
Get percentage of demand covered by the hp (-) Get percentage of demand covered by the hp (-)
:return: real :return: float
""" """
return self._seasonal_mean_coverage_factor return self._seasonal_mean_coverage_factor
@ -41,6 +41,6 @@ class HeatPump:
def seasonal_mean_coverage_factor(self, value): def seasonal_mean_coverage_factor(self, value):
""" """
Set percentage of demand covered by the hp (-) Set percentage of demand covered by the hp (-)
:return: real :return: float
""" """
self._seasonal_mean_coverage_factor = value self._seasonal_mean_coverage_factor = value

View File

@ -36,7 +36,7 @@ class PvSystem:
@property @property
def total_area(self): def total_area(self):
""" """
Get total modules area (m2) Get total modules area in square meters
:return: float :return: float
""" """
return self._total_area return self._total_area
@ -44,7 +44,7 @@ class PvSystem:
@total_area.setter @total_area.setter
def total_area(self, value): def total_area(self, value):
""" """
Set total modules area (m2) Set total modules area in square meters
:param value: float :param value: float
""" """
self._total_area = value self._total_area = value
@ -52,7 +52,7 @@ class PvSystem:
@property @property
def module_area(self): def module_area(self):
""" """
Get module area (m2) Get module area in square meters
:return: float :return: float
""" """
return self._module_area return self._module_area
@ -60,7 +60,7 @@ class PvSystem:
@module_area.setter @module_area.setter
def module_area(self, value): def module_area(self, value):
""" """
Set module area (m2) Set module area in square meters
:param value: float :param value: float
""" """
self._module_area = value self._module_area = value
@ -100,7 +100,7 @@ class PvSystem:
@property @property
def electricity_generation(self): def electricity_generation(self):
""" """
Get electricity generation (J) Get electricity generation in J
:return: float :return: float
""" """
return self._electricity_generation return self._electricity_generation
@ -108,7 +108,7 @@ class PvSystem:
@electricity_generation.setter @electricity_generation.setter
def electricity_generation(self, value): def electricity_generation(self, value):
""" """
Set electricity generation (J) Set electricity generation in J
:param value: float :param value: float
""" """
self._electricity_generation = value self._electricity_generation = value

View File

@ -25,13 +25,16 @@ class ConcordiaEnergySensor(Sensor):
@property @property
def measures(self) -> pd.DataFrame: def measures(self) -> pd.DataFrame:
""" """
Sensor measures [yyyy-mm-dd, hh:mm:ss kW] Get sensor measures [yyyy-mm-dd, hh:mm:ss kW]
:return: DataFrame["Date time", "Energy consumption"] :return: DataFrame["Date time", "Energy consumption"]
""" """
return self._measures return self._measures
@measures.deleter @measures.deleter
def measures(self): def measures(self):
"""
Delete sensor measures
"""
self._measures.drop = None self._measures.drop = None
def add_period(self, measures): def add_period(self, measures):

View File

@ -25,13 +25,16 @@ class ConcordiaGasFlowSensor(Sensor):
@property @property
def measures(self) -> pd.DataFrame: def measures(self) -> pd.DataFrame:
""" """
Sensor measures [yyyy-mm-dd, hh:mm:ss m3] Get sensor measures [yyyy-mm-dd, hh:mm:ss m3]
:return: DataFrame["Date time", "Gas Flow Cumulative Monthly"] :return: DataFrame["Date time", "Gas Flow Cumulative Monthly"]
""" """
return self._measures return self._measures
@measures.deleter @measures.deleter
def measures(self): def measures(self):
"""
Delete sensor measures
"""
self._measures.drop = None self._measures.drop = None
def add_period(self, measures): def add_period(self, measures):

View File

@ -25,13 +25,16 @@ class ConcordiaTemperatureSensor(Sensor):
@property @property
def measures(self) -> pd.DataFrame: def measures(self) -> pd.DataFrame:
""" """
Sensor measures [yyyy-mm-dd, hh:mm:ss Celsius] Get sensor measures [yyyy-mm-dd, hh:mm:ss Celsius]
:return: DataFrame["Date time", "Temperature"] :return: DataFrame["Date time", "Temperature"]
""" """
return self._measures return self._measures
@measures.deleter @measures.deleter
def measures(self): def measures(self):
"""
Delete sensor measures
"""
self._measures.drop = None self._measures.drop = None
def add_period(self, measures): def add_period(self, measures):

View File

@ -29,7 +29,7 @@ class Network(CityObject):
@property @property
def id(self): def id(self):
""" """
Network id, an universally unique identifier randomly generated Get network id, an universally unique identifier randomly generated
:return: str :return: str
""" """
if self._id is None: if self._id is None:
@ -39,13 +39,15 @@ class Network(CityObject):
@property @property
def edges(self) -> List[Edge]: def edges(self) -> List[Edge]:
""" """
Network edges Get network edges
:return: [Edge]
""" """
return self._edges return self._edges
@property @property
def nodes(self) -> List[Node]: def nodes(self) -> List[Node]:
""" """
Network nodes Get network nodes
:return: [Node]
""" """
return self._nodes return self._nodes

View File

@ -22,7 +22,7 @@ class PartsConsistingBuilding(CityObjectsCluster):
@property @property
def type(self): def type(self):
""" """
type of cluster Get type of cluster
:return: str :return: str
""" """
return self._cluster_type return self._cluster_type
@ -30,7 +30,7 @@ class PartsConsistingBuilding(CityObjectsCluster):
@property @property
def city_objects(self) -> List[CityObject]: def city_objects(self) -> List[CityObject]:
""" """
city objects that compose the cluster Get city objects that compose the cluster
:return: [CityObject] :return: [CityObject]
""" """
return self._city_objects return self._city_objects

View File

@ -39,6 +39,6 @@ class SubwayEntrance(CityObject):
def name(self): def name(self):
""" """
Get name Get name
:return: string :return: str
""" """
return self._name return self._name

View File

@ -25,7 +25,7 @@ class Connection:
@property @property
def from_edge(self) -> Edge: def from_edge(self) -> Edge:
""" """
Edge the vehicle leaves Get "from" edge
:return: Edge :return: Edge
""" """
return self._from_edge return self._from_edge
@ -33,7 +33,7 @@ class Connection:
@from_edge.setter @from_edge.setter
def from_edge(self, value): def from_edge(self, value):
""" """
Edge the vehicle leaves setter Set "from" edge
:param value: Edge :param value: Edge
""" """
self._from_edge = value self._from_edge = value
@ -41,7 +41,7 @@ class Connection:
@property @property
def to_edge(self) -> Edge: def to_edge(self) -> Edge:
""" """
Edge the vehicle reaches Get "to" edge
:return: Edge :return: Edge
""" """
return self._to_edge return self._to_edge
@ -49,7 +49,7 @@ class Connection:
@to_edge.setter @to_edge.setter
def to_edge(self, value): def to_edge(self, value):
""" """
Edge the vehicle reaches setter Set "to" edge
:param value: Edge :param value: Edge
""" """
self._to_edge = value self._to_edge = value
@ -57,7 +57,7 @@ class Connection:
@property @property
def from_lane(self) -> Lane: def from_lane(self) -> Lane:
""" """
Incoming lane Get "from" lane
:return: Lane :return: Lane
""" """
return self._to_lane return self._to_lane
@ -65,7 +65,7 @@ class Connection:
@from_lane.setter @from_lane.setter
def from_lane(self, value): def from_lane(self, value):
""" """
Incoming lane setter Set "from" lane
:param value: Lane :param value: Lane
""" """
self._from_lane = value self._from_lane = value
@ -73,7 +73,7 @@ class Connection:
@property @property
def to_lane(self) -> Lane: def to_lane(self) -> Lane:
""" """
Outgoing lane Get "to" lane
:return: Lane :return: Lane
""" """
return self._to_lane return self._to_lane
@ -81,7 +81,7 @@ class Connection:
@to_lane.setter @to_lane.setter
def to_lane(self, value): def to_lane(self, value):
""" """
Outgoing lane setter Set "to" lane
:param value: Lane :param value: Lane
""" """
self._to_lane = value self._to_lane = value
@ -89,31 +89,31 @@ class Connection:
@property @property
def pass_not_wait(self): def pass_not_wait(self):
""" """
if set, vehicles which pass this (lane-2-lane) connection will not wait Get if the vehicles which pass this (lane to lane) connection will not wait
:return: bool :return: Boolean
""" """
return self._pass return self._pass
@pass_not_wait.setter @pass_not_wait.setter
def pass_not_wait(self, value): def pass_not_wait(self, value):
""" """
pass_not_wait setter Set if the vehicles which pass this (lane to lane) connection will not wait
:param value: bool :param value: Boolean
""" """
self._pass = value self._pass = value
@property @property
def keep_clear(self): def keep_clear(self):
""" """
if set to false, vehicles which pass this (lane-2-lane) connection will not worry about blocking the intersection Get if vehicles which pass this (lane to lane) connection should keep the intersection clear
:return: bool :return: Boolean
""" """
return self._keep_clear return self._keep_clear
@keep_clear.setter @keep_clear.setter
def keep_clear(self, value): def keep_clear(self, value):
""" """
keep_clear setter Set if vehicles which pass this (lane to lane) connection should keep the intersection clear
:param value: bool :param value: Boolean
""" """
self._keep_clear = value self._keep_clear = value

View File

@ -24,7 +24,7 @@ class Crossing(TrafficNode):
@property @property
def priority(self): def priority(self):
""" """
Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections). Get whether the pedestrians have priority over the vehicles
:return: bool :return: bool
""" """
return self._priority return self._priority
@ -32,7 +32,7 @@ class Crossing(TrafficNode):
@priority.setter @priority.setter
def priority(self, value): def priority(self, value):
""" """
Priority setter Set whether the pedestrians have priority over the vehicles
:param value: bool :param value: bool
""" """
self._priority = value self._priority = value
@ -40,7 +40,7 @@ class Crossing(TrafficNode):
@property @property
def width(self): def width(self):
""" """
Width in m Get crossing width in meters
:return: float :return: float
""" """
return self._width return self._width
@ -48,7 +48,7 @@ class Crossing(TrafficNode):
@width.setter @width.setter
def width(self, value): def width(self, value):
""" """
Width in m setter Set crossing width in meters
:param value: float :param value: float
""" """
self._width = value self._width = value
@ -56,7 +56,7 @@ class Crossing(TrafficNode):
@property @property
def shape(self) -> List[List[float]]: def shape(self) -> List[List[float]]:
""" """
List of positions (positions in m) Get the list of positions
:return: [[x, y, (z)]] :return: [[x, y, (z)]]
""" """
return self._shape return self._shape
@ -64,7 +64,7 @@ class Crossing(TrafficNode):
@shape.setter @shape.setter
def shape(self, value): def shape(self, value):
""" """
List of positions setter Set the list of positions
:param value: [[x, y, (z)]] :param value: [[x, y, (z)]]
""" """
self._shape = value self._shape = value

View File

@ -25,7 +25,7 @@ class Lane:
@property @property
def index(self): def index(self):
""" """
Lane index Get lane index
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)
:return: int :return: int
""" """
@ -34,7 +34,8 @@ class Lane:
@index.setter @index.setter
def index(self, value): def index(self, value):
""" """
Index setter Set lane index
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 = value
@ -42,7 +43,7 @@ class Lane:
@property @property
def allow(self) -> List[str]: def allow(self) -> List[str]:
""" """
List of allowed vehicle classes Get the list of allowed vehicle classes
:return: [str] :return: [str]
""" """
return self._allow return self._allow
@ -50,7 +51,7 @@ class Lane:
@allow.setter @allow.setter
def allow(self, value): def allow(self, value):
""" """
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 = value
@ -58,7 +59,7 @@ class Lane:
@property @property
def disallow(self) -> List[str]: def disallow(self) -> List[str]:
""" """
List of not allowed vehicle classes Get the list of not allowed vehicle classes
:return: [str] :return: [str]
""" """
return self._disallow return self._disallow
@ -66,7 +67,7 @@ class Lane:
@disallow.setter @disallow.setter
def disallow(self, value): def disallow(self, value):
""" """
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 = value
@ -74,7 +75,7 @@ class Lane:
@property @property
def change_left(self) -> List[str]: def change_left(self) -> List[str]:
""" """
List of vehicle classes that may change left from this lane Get the list of vehicle classes that may change left from this lane
:return: [str] :return: [str]
""" """
return self._change_left return self._change_left
@ -82,7 +83,7 @@ class Lane:
@change_left.setter @change_left.setter
def change_left(self, value): def change_left(self, value):
""" """
change_left setter 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 = value
@ -90,7 +91,7 @@ class Lane:
@property @property
def change_right(self) -> List[str]: def change_right(self) -> List[str]:
""" """
List of vehicle classes that may change right from this lane Get the list of vehicle classes that may change right from this lane
:return: [str] :return: [str]
""" """
return self._change_right return self._change_right
@ -98,7 +99,7 @@ class Lane:
@change_right.setter @change_right.setter
def change_right(self, value): def change_right(self, value):
""" """
change_right setter 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 = value
@ -106,7 +107,7 @@ class Lane:
@property @property
def speed(self): def speed(self):
""" """
Speed in m/s Get the lane speed in m/s
:return: float :return: float
""" """
return self._speed return self._speed
@ -114,7 +115,7 @@ class Lane:
@speed.setter @speed.setter
def speed(self, value): def speed(self, value):
""" """
Speed in m/s setter Set the lane speed in m/s
:param value: float :param value: float
""" """
self._speed = value self._speed = value
@ -122,7 +123,7 @@ class Lane:
@property @property
def width(self): def width(self):
""" """
Width in m Get the lane width in meters
:return: float :return: float
""" """
return self._width return self._width
@ -130,7 +131,7 @@ class Lane:
@width.setter @width.setter
def width(self, value): def width(self, value):
""" """
Width in m setter Set the lane width in meters
:param value: float :param value: float
""" """
self._width = value self._width = value

View File

@ -24,7 +24,7 @@ class Phase:
@property @property
def duration(self): def duration(self):
""" """
Duration in seconds Get phase duration in seconds
:return: int :return: int
""" """
return self._duration return self._duration
@ -32,7 +32,7 @@ class Phase:
@duration.setter @duration.setter
def duration(self, value): def duration(self, value):
""" """
Duration setter Set phase duration in seconds
:param value: int :param value: int
""" """
self._duration = value self._duration = value
@ -40,23 +40,23 @@ class Phase:
@property @property
def state(self): def state(self):
""" """
List of signal states Get the list of signal states
:return: [] :return: [str]
""" """
return self._state return self._state
@state.setter @state.setter
def state(self, value): def state(self, value):
""" """
List of signal states setter Set the list of signal states
:param value: [] :param value: [str]
""" """
self._state = value self._state = value
@property @property
def min_duration(self): def min_duration(self):
""" """
Minimum duration in seconds Get phase minimum duration in seconds
:return: int :return: int
""" """
if self._min_duration is None: if self._min_duration is None:
@ -66,7 +66,7 @@ class Phase:
@min_duration.setter @min_duration.setter
def min_duration(self, value): def min_duration(self, value):
""" """
Minimum duration setter Set phase minimum duration in seconds
:param value: int :param value: int
""" """
self._min_duration = value self._min_duration = value
@ -74,7 +74,7 @@ class Phase:
@property @property
def max_duration(self): def max_duration(self):
""" """
Maximum duration in seconds Get phase maximum duration in seconds
:return: int :return: int
""" """
if self._max_duration is None: if self._max_duration is None:
@ -84,7 +84,7 @@ class Phase:
@max_duration.setter @max_duration.setter
def max_duration(self, value): def max_duration(self, value):
""" """
Maximum duration setter Set phase maximum duration in seconds
:param value: int :param value: int
""" """
self._max_duration = value self._max_duration = value
@ -92,7 +92,7 @@ class Phase:
@property @property
def name(self): def name(self):
""" """
Phase name Get phase name
:return: str :return: str
""" """
return self._name return self._name
@ -100,7 +100,7 @@ class Phase:
@name.setter @name.setter
def name(self, value): def name(self, value):
""" """
Phase name setter Set phase name
:param value: str :param value: str
""" """
self._name = value self._name = value
@ -108,7 +108,7 @@ class Phase:
@property @property
def next(self) -> List[int]: def next(self) -> List[int]:
""" """
The next phase in the cycle after the current. Get the next phase in the cycle after the current.
This is useful when adding extra transition phases to a traffic light plan which are not part of every cycle. This is useful when adding extra transition phases to a traffic light plan which are not part of every cycle.
Traffic lights of type 'actuated' can make use of a list of indices for selecting among alternative Traffic lights of type 'actuated' can make use of a list of indices for selecting among alternative
successor phases. successor phases.
@ -119,7 +119,10 @@ class Phase:
@next.setter @next.setter
def next(self, value): def next(self, value):
""" """
Next setter Get the next phase in the cycle after the current.
This is useful when adding extra transition phases to a traffic light plan which are not part of every cycle.
Traffic lights of type 'actuated' can make use of a list of indices for selecting among alternative
successor phases.
:param value: [int] :param value: [int]
""" """
self._next = value self._next = value

View File

@ -32,7 +32,7 @@ class TrafficEdge(Edge):
@property @property
def edge_type(self): def edge_type(self):
""" """
The name of a edge type Get the edge type
:return: str :return: str
""" """
return self._edge_type return self._edge_type
@ -40,7 +40,7 @@ class TrafficEdge(Edge):
@property @property
def lanes(self) -> List[Lane]: def lanes(self) -> List[Lane]:
""" """
List of lanes on an edge Get the lanes on an edge
:return: List[Lane] :return: List[Lane]
""" """
return self._lanes return self._lanes
@ -48,7 +48,7 @@ class TrafficEdge(Edge):
@lanes.setter @lanes.setter
def lanes(self, value): def lanes(self, value):
""" """
List of lanes on an edge setter Set the lanes on an edge
:param value: List[Lane] :param value: List[Lane]
""" """
self._lanes = value self._lanes = value
@ -56,7 +56,7 @@ class TrafficEdge(Edge):
@property @property
def priority(self): def priority(self):
""" """
A number, which determines the priority between different road types. Get the priority between different road types.
It starts with one; higher numbers represent more important roads. It starts with one; higher numbers represent more important roads.
:return: int :return: int
""" """
@ -65,7 +65,8 @@ class TrafficEdge(Edge):
@priority.setter @priority.setter
def priority(self, value): def priority(self, value):
""" """
Priority setter Set the priority between different road types.
It starts with one; higher numbers represent more important roads.
:param value: int :param value: int
""" """
self._priority = value self._priority = value
@ -73,7 +74,7 @@ class TrafficEdge(Edge):
@property @property
def speed(self): def speed(self):
""" """
The speed limit in m/s Get he speed limit in m/s
:return: float :return: float
""" """
return self._speed return self._speed
@ -81,7 +82,7 @@ class TrafficEdge(Edge):
@speed.setter @speed.setter
def speed(self, value): def speed(self, value):
""" """
The speed limit in m/s setter Set the speed limit in m/s
:param value: float :param value: float
""" """
self._speed = value self._speed = value
@ -89,7 +90,7 @@ class TrafficEdge(Edge):
@property @property
def length(self): def length(self):
""" """
Length in m Get the lane length in meters
:return: float :return: float
""" """
return self._length return self._length
@ -97,7 +98,7 @@ class TrafficEdge(Edge):
@length.setter @length.setter
def length(self, value): def length(self, value):
""" """
Length in m setter Set the lane length in meters
:param value: float :param value: float
""" """
self._length = value self._length = value
@ -105,7 +106,7 @@ class TrafficEdge(Edge):
@property @property
def allows(self) -> List[str]: def allows(self) -> List[str]:
""" """
List of allowed vehicle classes Get the list of allowed vehicle classes
:return: [str] :return: [str]
""" """
return self._allows return self._allows
@ -113,7 +114,7 @@ class TrafficEdge(Edge):
@allows.setter @allows.setter
def allows(self, value): def allows(self, value):
""" """
List of allowed vehicle classes setter Set the list of allowed vehicle classes
:param value: [str] :param value: [str]
""" """
self._allows = value self._allows = value
@ -121,7 +122,7 @@ class TrafficEdge(Edge):
@property @property
def disallows(self) -> List[str]: def disallows(self) -> List[str]:
""" """
List of not allowed vehicle classes Get the list of not allowed vehicle classes
:return: [str] :return: [str]
""" """
return self._disallows return self._disallows
@ -129,7 +130,7 @@ class TrafficEdge(Edge):
@disallows.setter @disallows.setter
def disallows(self, value): def disallows(self, value):
""" """
List of not allowed vehicle classes setter Set the list of not allowed vehicle classes
:param value: [str] :param value: [str]
""" """
self._disallows = value self._disallows = value

View File

@ -26,21 +26,23 @@ class TrafficLight(TrafficNode):
@property @property
def right_on_red(self): def right_on_red(self):
""" """
Return if is possible to turn right if the traffic light is red Get if is possible to turn right when the traffic light is red
:return: Boolean
""" """
return self._right_on_red return self._right_on_red
@right_on_red.setter @right_on_red.setter
def right_on_red(self, value): def right_on_red(self, value):
""" """
Set if is possible to turn right if the traffic light is red Get if is possible to turn right when the traffic light is red
:param value: Boolean
""" """
self._right_on_red = value self._right_on_red = value
@property @property
def offset(self): def offset(self):
""" """
The initial time offset of the program Get program initial time offset
:return: int :return: int
""" """
return self._offset return self._offset
@ -48,7 +50,7 @@ class TrafficLight(TrafficNode):
@offset.setter @offset.setter
def offset(self, value): def offset(self, value):
""" """
The initial time offset of the program setter Set program initial time offset
:param value: int :param value: int
""" """
self._offset = value self._offset = value
@ -56,7 +58,7 @@ class TrafficLight(TrafficNode):
@property @property
def phases(self) -> List[Phase]: def phases(self) -> List[Phase]:
""" """
Phases of the traffic light logic Get traffic light logic phases
:return: [Phase] :return: [Phase]
""" """
return self._phases return self._phases
@ -64,7 +66,7 @@ class TrafficLight(TrafficNode):
@phases.setter @phases.setter
def phases(self, value): def phases(self, value):
""" """
Phases setter Set traffic light logic phases
:param value: [Phase] :param value: [Phase]
""" """
self._phases = value self._phases = value

View File

@ -20,6 +20,7 @@ class TrafficNetwork(Network):
@property @property
def type(self): def type(self):
""" """
Network type Get network type
:return: str
""" """
return self._type return self._type

View File

@ -34,7 +34,7 @@ class TrafficNode(Node):
@property @property
def node_type(self): def node_type(self):
""" """
The name of a node type Get node type
:return: str :return: str
""" """
return self._node_type return self._node_type
@ -42,7 +42,7 @@ class TrafficNode(Node):
@property @property
def coordinates(self) -> Point: def coordinates(self) -> Point:
""" """
The x,y,z - Node coordinates Get node coordinates
:return: Point :return: Point
""" """
return self._coordinates return self._coordinates
@ -50,7 +50,7 @@ class TrafficNode(Node):
@coordinates.setter @coordinates.setter
def coordinates(self, value): def coordinates(self, value):
""" """
The x,y,z - Node coordinates setter Set node coordinates
:param value: Point :param value: Point
""" """
self._coordinates = value self._coordinates = value
@ -58,27 +58,31 @@ class TrafficNode(Node):
@property @property
def prohibitions(self) -> List[(Edge, Edge)]: def prohibitions(self) -> List[(Edge, Edge)]:
""" """
return a list of forbidden edges tuples meaning you can not move from the first edge to the second Get node prohibitions
:return: [(Edge, Edge)]
""" """
return self._prohibitions return self._prohibitions
@prohibitions.setter @prohibitions.setter
def prohibitions(self, value): def prohibitions(self, value):
""" """
Set the prohibitions tuples for this node Set node prohibitions
:param value: [(Edge, Edge)]
""" """
self._prohibitions = value self._prohibitions = value
@property @property
def connections(self) -> List[Connection]: def connections(self) -> List[Connection]:
""" """
Return a list of connections for the node Get node connections
:return: [Connection]
""" """
return self._connections return self._connections
@connections.setter @connections.setter
def connections(self, value): def connections(self, value):
""" """
Set the connections for this node Set node connections
:param value: [Connection]
""" """
self._connections = value self._connections = value

View File

@ -22,7 +22,7 @@ class WalkwayNode(TrafficNode):
@property @property
def shape(self) -> List[List[float]]: def shape(self) -> List[List[float]]:
""" """
List of positions (positions in m) Get the list of positions
:return: [[x, y, (z)]] :return: [[x, y, (z)]]
""" """
return self._shape return self._shape
@ -30,7 +30,7 @@ class WalkwayNode(TrafficNode):
@shape.setter @shape.setter
def shape(self, value): def shape(self, value):
""" """
List of positions setter Set the list of positions
:param value: [[x, y, (z)]] :param value: [[x, y, (z)]]
""" """
self._shape = value self._shape = value

View File

@ -20,7 +20,7 @@ class Tree(CityObject):
def height(self): def height(self):
""" """
Get height of tree in meters Get height of tree in meters
:return: height :return: float
""" """
return self._height return self._height
@ -28,6 +28,6 @@ class Tree(CityObject):
def canopy(self): def canopy(self):
""" """
Get canopy of tree Get canopy of tree
:return: canopy :return: Boolean
""" """
return self._canopy return self._canopy

View File

@ -19,7 +19,7 @@ class ConfigurationHelper:
@property @property
def max_location_distance_for_shared_walls(self): def max_location_distance_for_shared_walls(self):
""" """
Configured maximal distance between attributes to consider that they may share walls in meters Get configured maximal distance between attributes to consider that they may share walls in meters
:return: float :return: float
""" """
return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls') return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls')
@ -27,7 +27,7 @@ class ConfigurationHelper:
@property @property
def min_coordinate(self) -> float: def min_coordinate(self) -> float:
""" """
Configured minimal coordinate value Get configured minimal coordinate value
:return: float :return: float
""" """
return self._config.getfloat('buildings', 'min_coordinate') return self._config.getfloat('buildings', 'min_coordinate')
@ -35,7 +35,7 @@ class ConfigurationHelper:
@property @property
def max_coordinate(self) -> float: def max_coordinate(self) -> float:
""" """
Configured maximal coordinate value Get configured maximal coordinate value
:return: float :return: float
""" """
return self._config.getfloat('buildings', 'max_coordinate') return self._config.getfloat('buildings', 'max_coordinate')

View File

@ -20,7 +20,7 @@ class CaPhysicsParameters(NrelPhysicsInterface):
def enrich_buildings(self): def enrich_buildings(self):
""" """
Returns the city with the construction parameters assigned to the buildings Returns the city with the construction parameters assigned to the buildings
:return: :return: None
""" """
city = self._city city = self._city
# it is assumed that all buildings have the same archetypes' keys # it is assumed that all buildings have the same archetypes' keys

View File

@ -90,7 +90,7 @@ class NrelLayerArchetype:
def name(self): def name(self):
""" """
Get nrel layer archetype name Get nrel layer archetype name
:return: string :return: str
""" """
return self._name return self._name

View File

@ -29,8 +29,8 @@ class NrelThermalBoundaryArchetype:
@property @property
def boundary_type(self): def boundary_type(self):
""" """
Get nrel thermal boundaryu archetype type Get nrel thermal boundary archetype type
:return: string :return: str
""" """
return self._boundary_type return self._boundary_type
@ -70,7 +70,7 @@ class NrelThermalBoundaryArchetype:
def construction_name(self): def construction_name(self):
""" """
Get nrel thermal boundary archetype construction name Get nrel thermal boundary archetype construction name
:return: String :return: str
""" """
return self._construction_name return self._construction_name
@ -94,6 +94,6 @@ class NrelThermalBoundaryArchetype:
def overall_u_value(self): def overall_u_value(self):
""" """
Get nrel thermal boundary archetype overall U-value in W/m2K Get nrel thermal boundary archetype overall U-value in W/m2K
:param value: float :return: float
""" """
return self._overall_u_value return self._overall_u_value

View File

@ -26,7 +26,7 @@ class StoreysGeneration:
@property @property
def storeys(self) -> [Storey]: def storeys(self) -> [Storey]:
""" """
subsections of building trimesh by storey in case of no interiors defined Get subsections of building trimesh by storey in case of no interiors defined
:return: [Storey] :return: [Storey]
""" """
number_of_storeys, height = self._calculate_number_storeys_and_height(self._building.average_storey_height, number_of_storeys, height = self._calculate_number_storeys_and_height(self._building.average_storey_height,

View File

@ -25,7 +25,7 @@ class UsPhysicsParameters(NrelPhysicsInterface):
def enrich_buildings(self): def enrich_buildings(self):
""" """
Returns the city with the construction parameters assigned to the buildings Returns the city with the construction parameters assigned to the buildings
:return: :return: None
""" """
city = self._city city = self._city
# it is assumed that all buildings have the same archetypes' keys # it is assumed that all buildings have the same archetypes' keys

View File

@ -62,7 +62,7 @@ class CityGml:
@property @property
def content(self): def content(self):
""" """
CityGml raw content Get cityGml raw content
:return: str :return: str
""" """
return self._gml return self._gml
@ -97,7 +97,7 @@ class CityGml:
@property @property
def city(self) -> City: def city(self) -> City:
""" """
City model structure enriched with the geometry information Get city model structure enriched with the geometry information
:return: City :return: City
""" """

View File

@ -19,7 +19,7 @@ class CityGmlBase(ABC):
@property @property
def surfaces(self): def surfaces(self):
""" """
parsed surfaces Get parsed surfaces
""" """
return self._surfaces return self._surfaces

View File

@ -41,14 +41,14 @@ class Obj:
@property @property
def scene(self) -> Scene: def scene(self) -> Scene:
""" """
Obj scene Get obj scene
""" """
return self._scene return self._scene
@property @property
def city(self) -> City: def city(self) -> City:
""" """
Create a city out of an obj file Get city out of an obj file
""" """
if self._city is None: if self._city is None:
# todo: refactor this method to clearly choose the obj type # todo: refactor this method to clearly choose the obj type

View File

@ -33,7 +33,7 @@ class OsmSubway:
@property @property
def city(self) -> City: def city(self) -> City:
""" """
City subway entrances Get a city with subway entrances
""" """
transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857") transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857")
lower_corner = [sys.float_info.max, sys.float_info.max, 0] lower_corner = [sys.float_info.max, sys.float_info.max, 0]

View File

@ -9,7 +9,7 @@ import parseidf
class DoeIdf: class DoeIdf:
""" """
This is a import factory to add Idf schedules into the data model Idf factory to import schedules into the data model
""" """
idf_schedule_to_commet_schedule = {'BLDG_LIGHT_SCH': 'Lights', idf_schedule_to_commet_schedule = {'BLDG_LIGHT_SCH': 'Lights',
'BLDG_OCC_SCH_wo_SB': 'Occupancy', 'BLDG_OCC_SCH_wo_SB': 'Occupancy',

View File

@ -9,7 +9,7 @@ import helpers.constants as cte
class UsageHelper: class UsageHelper:
""" """
Usage helpre class Usage helper class
""" """
usage_to_hft = { usage_to_hft = {
cte.RESIDENTIAL: 'residential', cte.RESIDENTIAL: 'residential',

View File

@ -15,7 +15,7 @@ class Weather:
@staticmethod @staticmethod
def sky_temperature(ambient_temperature): def sky_temperature(ambient_temperature):
""" """
sky temperature from ambient temperature in degree Celsius Get sky temperature from ambient temperature in Celsius
:return: float :return: float
""" """
# Swinbank - Source sky model approximation(1963) based on cloudiness statistics(32 %) in United States # Swinbank - Source sky model approximation(1963) based on cloudiness statistics(32 %) in United States