diff --git a/city_model_structure/attributes/edge.py b/city_model_structure/attributes/edge.py index 14c18c16..3274a969 100644 --- a/city_model_structure/attributes/edge.py +++ b/city_model_structure/attributes/edge.py @@ -5,8 +5,9 @@ Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc Contributor Milad milad.aghamohamadnia@concordia.ca """ import uuid -from typing import List -from city_model_structure.attributes.node import Node +from typing import List, TypeVar + +UsageZone = TypeVar('Node') class Edge: diff --git a/city_model_structure/attributes/node.py b/city_model_structure/attributes/node.py index e6f4a410..7c366bea 100644 --- a/city_model_structure/attributes/node.py +++ b/city_model_structure/attributes/node.py @@ -6,9 +6,9 @@ Contributor Milad milad.aghamohamadnia@concordia.ca """ import uuid -from typing import List -from city_model_structure.attributes.edge import Edge +from typing import List, TypeVar +UsageZone = TypeVar('Edge') class Node: """ diff --git a/city_model_structure/attributes/polyhedron.py b/city_model_structure/attributes/polyhedron.py index a1099547..b468e736 100644 --- a/city_model_structure/attributes/polyhedron.py +++ b/city_model_structure/attributes/polyhedron.py @@ -217,7 +217,7 @@ class Polyhedron: return self._min_x @property - def centroid(self) -> [float]: + def centroid(self) -> List[float]: """ Get polyhedron centroid :return: [x,y,z] diff --git a/city_model_structure/building.py b/city_model_structure/building.py index b985383e..a7123808 100644 --- a/city_model_structure/building.py +++ b/city_model_structure/building.py @@ -59,9 +59,10 @@ class Building(CityObject): self._internal_walls.append(surface) @property - def grounds(self) -> [Surface]: + def grounds(self) -> List[Surface]: """ Get building ground surfaces + :return: [Surface] """ return self._grounds @@ -88,7 +89,7 @@ class Building(CityObject): return False @property - def roofs(self) -> [Surface]: + def roofs(self) -> List[Surface]: """ Get building roof surfaces :return: [Surface] @@ -96,7 +97,7 @@ class Building(CityObject): return self._roofs @property - def walls(self) -> [Surface]: + def walls(self) -> List[Surface]: """ Get building wall surfaces :return: [Surface] @@ -286,7 +287,7 @@ class Building(CityObject): return self._eave_height @property - def storeys(self) -> [Storey]: + def storeys(self) -> List[Storey]: """ Get building storeys :return: [Storey] diff --git a/city_model_structure/building_demand/surface.py b/city_model_structure/building_demand/surface.py index a6dc6a6b..bb5eb37d 100644 --- a/city_model_structure/building_demand/surface.py +++ b/city_model_structure/building_demand/surface.py @@ -236,9 +236,9 @@ class Surface: """ Get hole surfaces, a list of hole polygons found in the surface :return: None, [] or [Polygon] - None -> not known whether holes exist in reality or not due to low level of detail of input data - [] -> no holes in the surface - [Polygon] -> one or more holes in the surface + None -> not known whether holes exist in reality or not due to low level of detail of input data + [] -> no holes in the surface + [Polygon] -> one or more holes in the surface """ return self._holes_polygons diff --git a/city_model_structure/city_object.py b/city_model_structure/city_object.py index c99e137e..9b935e60 100644 --- a/city_model_structure/city_object.py +++ b/city_model_structure/city_object.py @@ -122,7 +122,7 @@ class CityObject: return None @property - def centroid(self): + def centroid(self) -> List[float]: """ Get city object centroid :return: [x,y,z] diff --git a/city_model_structure/iot/sensor.py b/city_model_structure/iot/sensor.py index 6dfad778..25a79f45 100644 --- a/city_model_structure/iot/sensor.py +++ b/city_model_structure/iot/sensor.py @@ -68,6 +68,6 @@ class Sensor: @property def measures(self): """ - Sensor measures + Raises not implemented error """ raise NotImplementedError diff --git a/imports/schedules/doe_idf.py b/imports/schedules/doe_idf.py index 746ab47d..8c434850 100644 --- a/imports/schedules/doe_idf.py +++ b/imports/schedules/doe_idf.py @@ -5,13 +5,14 @@ Copyright © 2020 Project """ import pandas as pd import parseidf +import xmltodict class DoeIdf: """ Idf factory to import schedules into the data model """ - idf_schedule_to_commet_schedule = {'BLDG_LIGHT_SCH': 'Lights', + idf_schedule_to_comnet_schedule = {'BLDG_LIGHT_SCH': 'Lights', 'BLDG_OCC_SCH_wo_SB': 'Occupancy', 'BLDG_EQUIP_SCH': 'Equipment', 'ACTIVITY_SCH': 'Activity', @@ -44,8 +45,8 @@ class DoeIdf: def _load_schedule(self, idf, building_usage): schedules_day = {} for compact_schedule in idf[self._SCHEDULE_COMPACT_TYPE]: - if compact_schedule[self._SCHEDULE_TYPE_NAME] in self.idf_schedule_to_commet_schedule: - schedule_type = self.idf_schedule_to_commet_schedule[compact_schedule[self._SCHEDULE_TYPE_NAME]] + if compact_schedule[self._SCHEDULE_TYPE_NAME] in self.idf_schedule_to_comnet_schedule: + schedule_type = self.idf_schedule_to_comnet_schedule[compact_schedule[self._SCHEDULE_TYPE_NAME]] else: continue days_index = []