Compare commits
1 Commits
main
...
documentat
Author | SHA1 | Date | |
---|---|---|---|
|
8e3c8de715 |
|
@ -33,7 +33,6 @@ class CostsCatalogFactory:
|
|||
@property
|
||||
def catalog(self) -> Catalog:
|
||||
"""
|
||||
Return a cost catalog
|
||||
:return: CostCatalog
|
||||
:return: cost catalog (CostCatalog)
|
||||
"""
|
||||
return getattr(self, self._catalog_type, lambda: None)
|
||||
|
|
|
@ -68,8 +68,7 @@ class Schedule:
|
|||
def day_types(self) -> Union[None, List[str]]:
|
||||
"""
|
||||
Get schedule day types, as many as needed from:
|
||||
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'holiday', 'winter_design_day',
|
||||
'summer_design_day']
|
||||
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'holiday', 'winter_design_day', 'summer_design_day']
|
||||
:return: None or [str]
|
||||
"""
|
||||
return self._day_types
|
||||
|
|
|
@ -52,7 +52,7 @@ class Node:
|
|||
@property
|
||||
def time_series(self) -> TimeSeries:
|
||||
"""
|
||||
Add explanation here
|
||||
:return: add type of variable here
|
||||
Get the time series associated with the node
|
||||
:return: TimeSeries
|
||||
"""
|
||||
return self._time_series
|
||||
|
|
|
@ -287,7 +287,7 @@ class Polygon:
|
|||
def divide(self, plane):
|
||||
"""
|
||||
Divides the polygon in two by a plane
|
||||
:param plane: plane that intersects with self to divide it in two parts (Plane)
|
||||
:param plane: that intersects with self to divide it in two parts (Plane)
|
||||
:return: Polygon, Polygon, [Point]
|
||||
"""
|
||||
tri_polygons = Trimesh(vertices=self.vertices, faces=self.faces)
|
||||
|
|
|
@ -124,8 +124,7 @@ class Schedule:
|
|||
def day_types(self) -> Union[None, List[str]]:
|
||||
"""
|
||||
Get schedule day types, as many as needed from:
|
||||
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'holiday', 'winter_design_day',
|
||||
'summer_design_day']
|
||||
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'holiday', 'winter_design_day', 'summer_design_day']
|
||||
:return: None or [str]
|
||||
"""
|
||||
return self._day_types
|
||||
|
|
|
@ -25,7 +25,7 @@ City = TypeVar('City')
|
|||
|
||||
class Building(CityObject):
|
||||
"""
|
||||
Building(CityObject) class
|
||||
Building class inherited from CityObject class
|
||||
"""
|
||||
def __init__(self, name, surfaces, year_of_construction, function, terrains=None, city=None):
|
||||
super().__init__(name, surfaces)
|
||||
|
@ -575,6 +575,7 @@ class Building(CityObject):
|
|||
def usages_percentage(self):
|
||||
"""
|
||||
Get the usages and percentages for the building
|
||||
:return: str
|
||||
"""
|
||||
_usage = ''
|
||||
for internal_zone in self.internal_zones:
|
||||
|
@ -620,7 +621,7 @@ class Building(CityObject):
|
|||
def heating_consumption(self):
|
||||
"""
|
||||
Get energy consumption for heating according to the heating system installed in J
|
||||
return: dict
|
||||
:return: dict
|
||||
"""
|
||||
if len(self._heating_consumption) == 0:
|
||||
for heating_demand_key in self.heating_demand:
|
||||
|
@ -636,7 +637,7 @@ class Building(CityObject):
|
|||
def cooling_consumption(self):
|
||||
"""
|
||||
Get energy consumption for cooling according to the cooling system installed in J
|
||||
return: dict
|
||||
:return: dict
|
||||
"""
|
||||
if len(self._cooling_consumption) == 0:
|
||||
for cooling_demand_key in self.cooling_demand:
|
||||
|
@ -652,7 +653,7 @@ class Building(CityObject):
|
|||
def domestic_hot_water_consumption(self):
|
||||
"""
|
||||
Get energy consumption for domestic according to the domestic hot water system installed in J
|
||||
return: dict
|
||||
:return: dict
|
||||
"""
|
||||
if len(self._domestic_hot_water_consumption) == 0:
|
||||
for domestic_hot_water_demand_key in self.domestic_hot_water_heat_demand:
|
||||
|
@ -700,7 +701,7 @@ class Building(CityObject):
|
|||
def distribution_systems_electrical_consumption(self):
|
||||
"""
|
||||
Get total electricity consumption for distribution and emission systems in J
|
||||
return: dict
|
||||
:return: dict
|
||||
"""
|
||||
if len(self._distribution_systems_electrical_consumption) != 0:
|
||||
return self._distribution_systems_electrical_consumption
|
||||
|
@ -780,7 +781,7 @@ class Building(CityObject):
|
|||
def onsite_electrical_production(self):
|
||||
"""
|
||||
Get total electricity produced onsite in J
|
||||
return: dict
|
||||
:return: dict
|
||||
"""
|
||||
orientation_losses_factor = {cte.MONTH: {'north': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
'east': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
|
@ -815,6 +816,7 @@ class Building(CityObject):
|
|||
def lower_corner(self):
|
||||
"""
|
||||
Get building lower corner.
|
||||
:return: [x,y,z]
|
||||
"""
|
||||
return [self._min_x, self._min_y, self._min_z]
|
||||
|
||||
|
@ -822,5 +824,6 @@ class Building(CityObject):
|
|||
def upper_corner(self):
|
||||
"""
|
||||
Get building upper corner.
|
||||
:return: [x,y,z]
|
||||
"""
|
||||
return [self._max_x, self._max_y, self._max_z]
|
||||
|
|
|
@ -42,7 +42,7 @@ class InternalGain:
|
|||
@property
|
||||
def average_internal_gain(self) -> Union[None, float]:
|
||||
"""
|
||||
Get internal gains average internal gain in W/m2
|
||||
Get average amount of internal gain in W/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._average_internal_gain
|
||||
|
|
|
@ -22,7 +22,7 @@ class Lighting:
|
|||
@property
|
||||
def density(self) -> Union[None, float]:
|
||||
"""
|
||||
Get lighting density in Watts per m2
|
||||
Get lighting density in W/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._density
|
||||
|
@ -30,7 +30,7 @@ class Lighting:
|
|||
@density.setter
|
||||
def density(self, value):
|
||||
"""
|
||||
Set lighting density in Watts per m2
|
||||
Set lighting density in W/m2
|
||||
:param value: float
|
||||
"""
|
||||
if value is not None:
|
||||
|
|
|
@ -23,7 +23,7 @@ class Occupancy:
|
|||
@property
|
||||
def occupancy_density(self) -> Union[None, float]:
|
||||
"""
|
||||
Get density in persons per m2
|
||||
Get density in persons/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._occupancy_density
|
||||
|
@ -31,7 +31,7 @@ class Occupancy:
|
|||
@occupancy_density.setter
|
||||
def occupancy_density(self, value):
|
||||
"""
|
||||
Set density in persons per m2
|
||||
Set density in persons/m2
|
||||
:param value: float
|
||||
"""
|
||||
if value is not None:
|
||||
|
@ -40,7 +40,7 @@ class Occupancy:
|
|||
@property
|
||||
def sensible_convective_internal_gain(self) -> Union[None, float]:
|
||||
"""
|
||||
Get sensible convective internal gain in Watts per m2
|
||||
Get sensible convective internal gain in W/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._sensible_convective_internal_gain
|
||||
|
@ -48,7 +48,7 @@ class Occupancy:
|
|||
@sensible_convective_internal_gain.setter
|
||||
def sensible_convective_internal_gain(self, value):
|
||||
"""
|
||||
Set sensible convective internal gain in Watts per m2
|
||||
Set sensible convective internal gain in W/m2
|
||||
:param value: float
|
||||
"""
|
||||
if value is not None:
|
||||
|
@ -57,7 +57,7 @@ class Occupancy:
|
|||
@property
|
||||
def sensible_radiative_internal_gain(self) -> Union[None, float]:
|
||||
"""
|
||||
Get sensible radiant internal gain in Watts per m2
|
||||
Get sensible radiant internal gain in W/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._sensible_radiative_internal_gain
|
||||
|
@ -65,7 +65,7 @@ class Occupancy:
|
|||
@sensible_radiative_internal_gain.setter
|
||||
def sensible_radiative_internal_gain(self, value):
|
||||
"""
|
||||
Set sensible radiant internal gain in Watts per m2
|
||||
Set sensible radiant internal gain in W/m2
|
||||
:param value: float
|
||||
"""
|
||||
if value is not None:
|
||||
|
@ -74,7 +74,7 @@ class Occupancy:
|
|||
@property
|
||||
def latent_internal_gain(self) -> Union[None, float]:
|
||||
"""
|
||||
Get latent internal gain in Watts per m2
|
||||
Get latent internal gain in W/m2
|
||||
:return: None or float
|
||||
"""
|
||||
return self._latent_internal_gain
|
||||
|
@ -82,7 +82,7 @@ class Occupancy:
|
|||
@latent_internal_gain.setter
|
||||
def latent_internal_gain(self, value):
|
||||
"""
|
||||
Set latent internal gain in Watts per m2
|
||||
Set latent internal gain in W/m2
|
||||
:param value: float
|
||||
"""
|
||||
if value is not None:
|
||||
|
|
|
@ -91,7 +91,7 @@ class City:
|
|||
@property
|
||||
def region_code(self):
|
||||
"""
|
||||
Get city region name
|
||||
Get city region code
|
||||
:return: str
|
||||
"""
|
||||
return self._get_location().region_code
|
||||
|
@ -117,7 +117,7 @@ class City:
|
|||
@name.setter
|
||||
def name(self, value):
|
||||
"""
|
||||
Set city name
|
||||
Set city's name
|
||||
:param value:str
|
||||
"""
|
||||
if value is not None:
|
||||
|
@ -210,7 +210,7 @@ class City:
|
|||
|
||||
def building_alias(self, alias) -> list[Building | list[Building]] | None:
|
||||
"""
|
||||
Retrieve the city CityObject with the given alias alias
|
||||
Retrieve the city CityObject with the given alias
|
||||
:alert: Building alias is not guaranteed to be unique
|
||||
:param alias:str
|
||||
:return: None or [CityObject]
|
||||
|
@ -232,8 +232,8 @@ class City:
|
|||
def add_city_object(self, new_city_object):
|
||||
"""
|
||||
Add a CityObject to the city
|
||||
:param new_city_object:CityObject
|
||||
:return: None or not implemented error
|
||||
:param new_city_object of parameter type:CityObject
|
||||
:return: None or NotImplementedError
|
||||
"""
|
||||
if new_city_object.type == 'building':
|
||||
if self._buildings is None:
|
||||
|
@ -256,7 +256,7 @@ class City:
|
|||
def remove_city_object(self, city_object):
|
||||
"""
|
||||
Remove a CityObject from the city
|
||||
:param city_object:CityObject
|
||||
:param city_object: of class CityObject
|
||||
:return: None
|
||||
"""
|
||||
if city_object.type != 'building':
|
||||
|
@ -289,7 +289,7 @@ class City:
|
|||
def load(city_filename) -> City:
|
||||
"""
|
||||
Load a city saved with city.save(city_filename)
|
||||
:param city_filename: city filename
|
||||
:param city_filename: which indicates the filename of the city
|
||||
:return: City
|
||||
"""
|
||||
if sys.platform == 'win32':
|
||||
|
@ -304,8 +304,8 @@ class City:
|
|||
def load_compressed(compressed_city_filename, destination_filename) -> City:
|
||||
"""
|
||||
Load a city from compressed_city_filename
|
||||
:param compressed_city_filename: Compressed pickle as source
|
||||
:param destination_filename: Pickle file as destination
|
||||
:param compressed_city_filename: which is a Compressed pickle as source
|
||||
:param destination_filename: which is Pickle file as destination
|
||||
:return: City
|
||||
"""
|
||||
with open(str(compressed_city_filename), 'rb') as source, open(str(destination_filename), 'wb') as destination:
|
||||
|
@ -317,7 +317,7 @@ class City:
|
|||
def save(self, city_filename):
|
||||
"""
|
||||
Save a city into the given filename
|
||||
:param city_filename: destination city filename
|
||||
:param city_filename: is the destination filename of the city
|
||||
:return: None
|
||||
"""
|
||||
with open(city_filename, 'wb') as file:
|
||||
|
@ -335,7 +335,7 @@ class City:
|
|||
def region(self, center, radius) -> City:
|
||||
"""
|
||||
Get a region from the city
|
||||
:param center: specific point in space [x, y, z]
|
||||
:param center: specific point in space [x, y, z] that indicates the center of the wanted location
|
||||
:param radius: distance to center of the sphere selected in meters
|
||||
:return: selected_region_city
|
||||
"""
|
||||
|
@ -445,7 +445,7 @@ class City:
|
|||
def add_city_objects_cluster(self, new_city_objects_cluster):
|
||||
"""
|
||||
Add a CityObject to the city
|
||||
:param new_city_objects_cluster:CityObjectsCluster
|
||||
:param new_city_objects_cluster of parameter type:CityObjectsCluster
|
||||
:return: None or NotImplementedError
|
||||
"""
|
||||
if new_city_objects_cluster.type == 'buildings':
|
||||
|
@ -463,6 +463,7 @@ class City:
|
|||
def copy(self) -> City:
|
||||
"""
|
||||
Get a copy of the current city
|
||||
:return: City
|
||||
"""
|
||||
return copy.deepcopy(self)
|
||||
|
||||
|
@ -508,9 +509,8 @@ class City:
|
|||
@property
|
||||
def energy_systems_connection_table(self) -> Union[None, DataFrame]:
|
||||
"""
|
||||
Get energy systems connection table which includes at least two columns: energy_system_type and associated_building
|
||||
and may also include dimensioned_energy_system and connection_building_to_dimensioned_energy_system
|
||||
:return: DataFrame
|
||||
Get energy systems connection table which includes at least two columns: energy_system_type and associated_building and may also include dimensioned_energy_system and connection_building_to_dimensioned_energy_system
|
||||
:return: DataFrame with at least two columns
|
||||
"""
|
||||
return self._energy_systems_connection_table
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class CityObject:
|
|||
@property
|
||||
def type(self) -> str:
|
||||
"""
|
||||
Get city object type
|
||||
Get city object type, for example, building
|
||||
:return: str
|
||||
"""
|
||||
return self._type
|
||||
|
@ -135,7 +135,7 @@ class CityObject:
|
|||
def surface(self, name) -> Union[Surface, None]:
|
||||
"""
|
||||
Get the city object surface with a given name
|
||||
:param name: str
|
||||
:param name: str representing the city object
|
||||
:return: None or Surface
|
||||
"""
|
||||
for s in self.surfaces:
|
||||
|
@ -146,7 +146,7 @@ class CityObject:
|
|||
def surface_by_id(self, identification_number) -> Union[Surface, None]:
|
||||
"""
|
||||
Get the city object surface with a given name
|
||||
:param identification_number: str
|
||||
:param identification_number: str representing the city object
|
||||
:return: None or Surface
|
||||
"""
|
||||
for s in self.surfaces:
|
||||
|
@ -293,6 +293,7 @@ class CityObject:
|
|||
def neighbours(self) -> Union[None, List[CityObject]]:
|
||||
"""
|
||||
Get the list of neighbour_objects and their properties associated to the current city_object
|
||||
:return: List[CityObject]
|
||||
"""
|
||||
return self._neighbours
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ from hub.city_model_structure.city_object import CityObject
|
|||
|
||||
class CityObjectsCluster(ABC, CityObject):
|
||||
"""
|
||||
CityObjectsCluster(ABC) class
|
||||
CityObjectsCluster(ABC) class is inherited from CityObject class
|
||||
"""
|
||||
def __init__(self, name, cluster_type, city_objects):
|
||||
self._name = name
|
||||
|
@ -46,7 +46,7 @@ class CityObjectsCluster(ABC, CityObject):
|
|||
|
||||
def add_city_object(self, city_object) -> List[CityObject]:
|
||||
"""
|
||||
add new object to the cluster
|
||||
add a new object to the cluster
|
||||
:return: [CityObjects]
|
||||
"""
|
||||
if self._city_objects is None:
|
||||
|
|
|
@ -81,7 +81,7 @@ class Vegetation:
|
|||
@property
|
||||
def plants(self) -> List[Plant]:
|
||||
"""
|
||||
Get list plants in the vegetation
|
||||
Get a list of plants in the vegetation
|
||||
:return: List[Plant]
|
||||
"""
|
||||
return self._plants
|
||||
|
|
|
@ -20,6 +20,7 @@ class SensorMeasure:
|
|||
def latitude(self):
|
||||
"""
|
||||
Get measure latitude
|
||||
:return: float
|
||||
"""
|
||||
return self._latitude
|
||||
|
||||
|
@ -27,6 +28,7 @@ class SensorMeasure:
|
|||
def longitude(self):
|
||||
"""
|
||||
Get measure longitude
|
||||
:return: float
|
||||
"""
|
||||
return self._longitude
|
||||
|
||||
|
@ -41,5 +43,6 @@ class SensorMeasure:
|
|||
def value(self):
|
||||
"""
|
||||
Get sensor measure value
|
||||
:return: float
|
||||
"""
|
||||
return self._value
|
||||
|
|
|
@ -12,7 +12,7 @@ CityObject = TypeVar('CityObject')
|
|||
|
||||
class PartsConsistingBuilding(CityObjectsCluster):
|
||||
"""
|
||||
PartsConsistingBuilding(CityObjectsCluster) class
|
||||
PartsConsistingBuilding class inherited from CityObjectsCluster class
|
||||
"""
|
||||
def __init__(self, name, city_objects):
|
||||
self._cluster_type = 'building_parts'
|
||||
|
|
Loading…
Reference in New Issue
Block a user