From fecf40247ac8875b3ce965e2414a44f778d903ac Mon Sep 17 00:00:00 2001 From: pilar Date: Tue, 16 Jun 2020 15:26:55 -0400 Subject: [PATCH] added bixi_feature.py, tree.py and composting_plant.py --- city_model_structure/bixi_feature.py | 32 ++++++++++++++++++++++++ city_model_structure/building.py | 4 +-- city_model_structure/composting_plant.py | 32 ++++++++++++++++++++++++ city_model_structure/tree.py | 29 ++++++++++----------- 4 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 city_model_structure/bixi_feature.py create mode 100644 city_model_structure/composting_plant.py diff --git a/city_model_structure/bixi_feature.py b/city_model_structure/bixi_feature.py new file mode 100644 index 00000000..940a8647 --- /dev/null +++ b/city_model_structure/bixi_feature.py @@ -0,0 +1,32 @@ +""" +bixi_feature module +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" +from city_model_structure.city_object import CityObject + + +class BixiFeature(CityObject): + """ + BixiFeature(CityObject) class + """ + def __init__(self, lod, feature_type, length): + super().__init__(lod) + self._feature_type = feature_type + self._length = length + + @property + def feature_type(self): + """ + Get type of bixi feature + :return: feature_type + """ + return self._feature_type + + @property + def length(self): + """ + Get length of bixi feature in meters + :return: length + """ + return self._length diff --git a/city_model_structure/building.py b/city_model_structure/building.py index 830f370e..5017d0b9 100644 --- a/city_model_structure/building.py +++ b/city_model_structure/building.py @@ -1,5 +1,5 @@ """ -CityObject module +Building module SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca """ @@ -22,7 +22,7 @@ from city_model_structure.city_object import CityObject class Building(CityObject): """ - CityObject class + Building(CityObject) class """ def __init__(self, name, lod, surfaces, terrains, year_of_construction, function, lower_corner, attic_heated=0, basement_heated=0): diff --git a/city_model_structure/composting_plant.py b/city_model_structure/composting_plant.py new file mode 100644 index 00000000..76c3396c --- /dev/null +++ b/city_model_structure/composting_plant.py @@ -0,0 +1,32 @@ +""" +Composting plant module +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" +from city_model_structure.city_object import CityObject + + +class CompostingPlant(CityObject): + """ + CompostingPlant(CityObject) class + """ + def __init__(self, lod, waste_type, capacity): + super().__init__(lod) + self._waste_type = waste_type + self._capacity = capacity + + @property + def waste_type(self): + """ + Get waste_type treated in composting plant + :return: waste_type + """ + return self._waste_type + + @property + def capacity(self): + """ + Get capacity of composting plant in kg + :return: capacity + """ + return self._capacity diff --git a/city_model_structure/tree.py b/city_model_structure/tree.py index 63b9cebf..b8e2e127 100644 --- a/city_model_structure/tree.py +++ b/city_model_structure/tree.py @@ -1,26 +1,28 @@ +""" +Tree module +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" +from city_model_structure.city_object import CityObject - - - - - - - - - - - +class Tree(CityObject): + """ + Tree(CityObject) class + """ + def __init__(self, lod, height, canopy): + super().__init__(lod) + self._height = height + self._canopy = canopy @property def height(self): """ - Get height of tree + Get height of tree in meters :return: height """ return self._height - @property def canopy(self): """ @@ -28,4 +30,3 @@ :return: canopy """ return self._canopy -