2022-03-08 20:25:50 -05:00
|
|
|
"""
|
|
|
|
Greenery catalog data model Plant class
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2022 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
|
|
|
|
2022-03-09 11:40:06 -05:00
|
|
|
from catalogs.data_model.greenery.soil import Soil as libs_soil
|
|
|
|
|
2022-03-08 20:25:50 -05:00
|
|
|
|
|
|
|
class Plant:
|
|
|
|
def __init__(self, category, plant):
|
|
|
|
self._name = plant.name
|
|
|
|
self._category = category
|
|
|
|
self._height = plant.height
|
|
|
|
self._leaf_area_index = plant.leafAreaIndex
|
|
|
|
self._leaf_reflectivity = plant.leafReflectivity
|
|
|
|
self._leaf_emissivity = plant.leafEmissivity
|
|
|
|
self._minimal_stomatal_resistance = plant.minimalStomatalResistance
|
|
|
|
self._co2_sequestration = plant.co2Sequestration
|
2022-03-09 11:40:06 -05:00
|
|
|
self._grows_on = []
|
|
|
|
for soil in plant.growsOn:
|
|
|
|
self._grows_on.append(libs_soil(soil))
|
2022-03-08 20:25:50 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def name(self):
|
|
|
|
"""
|
|
|
|
Get plant name
|
|
|
|
"""
|
|
|
|
return self._name
|
|
|
|
|
|
|
|
@property
|
|
|
|
def category(self):
|
|
|
|
"""
|
|
|
|
Get plant category name
|
|
|
|
"""
|
|
|
|
return self._category
|
|
|
|
|
|
|
|
@property
|
|
|
|
def height(self):
|
|
|
|
"""
|
|
|
|
Get plant height
|
|
|
|
"""
|
|
|
|
return self._height
|
|
|
|
|
|
|
|
@property
|
|
|
|
def leaf_area_index(self):
|
|
|
|
"""
|
|
|
|
Get plant leaf area index
|
|
|
|
"""
|
|
|
|
return self._leaf_area_index
|
|
|
|
|
|
|
|
@property
|
|
|
|
def leaf_reflectivity(self):
|
|
|
|
"""
|
|
|
|
Get plant leaf area index
|
|
|
|
"""
|
|
|
|
return self._leaf_reflectivity
|
|
|
|
|
|
|
|
@property
|
|
|
|
def leaf_emissivity(self):
|
|
|
|
"""
|
|
|
|
Get plant leaf emissivity
|
|
|
|
"""
|
|
|
|
return self._leaf_emissivity
|
|
|
|
|
|
|
|
@property
|
|
|
|
def minimal_stomatal_resistance(self):
|
|
|
|
"""
|
|
|
|
Get plant minimal stomatal resistance
|
|
|
|
"""
|
|
|
|
return self._minimal_stomatal_resistance
|
|
|
|
|
|
|
|
@property
|
|
|
|
def co2_sequestration(self):
|
|
|
|
"""
|
|
|
|
Get plant co2 sequestration capacity
|
|
|
|
"""
|
|
|
|
return self._co2_sequestration
|
2022-03-09 11:40:06 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def grows_on(self) -> [libs_soil]:
|
|
|
|
"""
|
|
|
|
Get plant compatible soils
|
|
|
|
"""
|
|
|
|
return self._grows_on
|