From 8e3c8de7156e1b42c75eb8e6a71e7d905da884ac Mon Sep 17 00:00:00 2001 From: Hadis-R Date: Mon, 22 Jan 2024 12:59:12 -0500 Subject: [PATCH] cerchybreferencemanual proofreading --- .../costs_catalog_factory.py | 3 +- .../data_models/usages/schedule.py | 3 +- hub/city_model_structure/attributes/node.py | 4 +-- .../attributes/polygon.py | 2 +- .../attributes/schedule.py | 3 +- hub/city_model_structure/building.py | 15 ++++++---- .../building_demand/internal_gain.py | 2 +- .../building_demand/lighting.py | 4 +-- .../building_demand/occupancy.py | 16 +++++----- .../building_demand/thermal_boundary.py | 2 +- hub/city_model_structure/city.py | 30 +++++++++---------- hub/city_model_structure/city_object.py | 7 +++-- .../city_objects_cluster.py | 4 +-- .../greenery/vegetation.py | 2 +- .../iot/sensor_measure.py | 3 ++ .../parts_consisting_building.py | 2 +- 16 files changed, 53 insertions(+), 49 deletions(-) diff --git a/hub/catalog_factories/costs_catalog_factory.py b/hub/catalog_factories/costs_catalog_factory.py index de341991..a3896b2a 100644 --- a/hub/catalog_factories/costs_catalog_factory.py +++ b/hub/catalog_factories/costs_catalog_factory.py @@ -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) diff --git a/hub/catalog_factories/data_models/usages/schedule.py b/hub/catalog_factories/data_models/usages/schedule.py index 73f03904..3127cf67 100644 --- a/hub/catalog_factories/data_models/usages/schedule.py +++ b/hub/catalog_factories/data_models/usages/schedule.py @@ -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 diff --git a/hub/city_model_structure/attributes/node.py b/hub/city_model_structure/attributes/node.py index 0ba07501..590de2a5 100644 --- a/hub/city_model_structure/attributes/node.py +++ b/hub/city_model_structure/attributes/node.py @@ -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 diff --git a/hub/city_model_structure/attributes/polygon.py b/hub/city_model_structure/attributes/polygon.py index 5a2cf685..785213b5 100644 --- a/hub/city_model_structure/attributes/polygon.py +++ b/hub/city_model_structure/attributes/polygon.py @@ -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) diff --git a/hub/city_model_structure/attributes/schedule.py b/hub/city_model_structure/attributes/schedule.py index 638cd7ab..c36d94f8 100644 --- a/hub/city_model_structure/attributes/schedule.py +++ b/hub/city_model_structure/attributes/schedule.py @@ -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 diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 5a6e109e..5ee090ab 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -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] diff --git a/hub/city_model_structure/building_demand/internal_gain.py b/hub/city_model_structure/building_demand/internal_gain.py index 229b7752..4570c274 100644 --- a/hub/city_model_structure/building_demand/internal_gain.py +++ b/hub/city_model_structure/building_demand/internal_gain.py @@ -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 diff --git a/hub/city_model_structure/building_demand/lighting.py b/hub/city_model_structure/building_demand/lighting.py index db52bb6b..b4352886 100644 --- a/hub/city_model_structure/building_demand/lighting.py +++ b/hub/city_model_structure/building_demand/lighting.py @@ -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: diff --git a/hub/city_model_structure/building_demand/occupancy.py b/hub/city_model_structure/building_demand/occupancy.py index 46d34aa1..93c5d77c 100644 --- a/hub/city_model_structure/building_demand/occupancy.py +++ b/hub/city_model_structure/building_demand/occupancy.py @@ -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: diff --git a/hub/city_model_structure/building_demand/thermal_boundary.py b/hub/city_model_structure/building_demand/thermal_boundary.py index 1ff00244..4b51516f 100644 --- a/hub/city_model_structure/building_demand/thermal_boundary.py +++ b/hub/city_model_structure/building_demand/thermal_boundary.py @@ -1,4 +1,4 @@ -""" + """ ThermalBoundary module SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2022 Concordia CERC group diff --git a/hub/city_model_structure/city.py b/hub/city_model_structure/city.py index 97000fbb..75e2e177 100644 --- a/hub/city_model_structure/city.py +++ b/hub/city_model_structure/city.py @@ -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 diff --git a/hub/city_model_structure/city_object.py b/hub/city_model_structure/city_object.py index c18a4aa0..928d494d 100644 --- a/hub/city_model_structure/city_object.py +++ b/hub/city_model_structure/city_object.py @@ -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 diff --git a/hub/city_model_structure/city_objects_cluster.py b/hub/city_model_structure/city_objects_cluster.py index 57a13f55..f8da4d9d 100644 --- a/hub/city_model_structure/city_objects_cluster.py +++ b/hub/city_model_structure/city_objects_cluster.py @@ -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: diff --git a/hub/city_model_structure/greenery/vegetation.py b/hub/city_model_structure/greenery/vegetation.py index b7d93f0a..a3ab55f0 100644 --- a/hub/city_model_structure/greenery/vegetation.py +++ b/hub/city_model_structure/greenery/vegetation.py @@ -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 diff --git a/hub/city_model_structure/iot/sensor_measure.py b/hub/city_model_structure/iot/sensor_measure.py index cca700ad..9fdd4b99 100644 --- a/hub/city_model_structure/iot/sensor_measure.py +++ b/hub/city_model_structure/iot/sensor_measure.py @@ -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 diff --git a/hub/city_model_structure/parts_consisting_building.py b/hub/city_model_structure/parts_consisting_building.py index 05c8d1aa..76e7049f 100644 --- a/hub/city_model_structure/parts_consisting_building.py +++ b/hub/city_model_structure/parts_consisting_building.py @@ -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'