hub/catalogs/data_model/greenery/plant.py

86 lines
1.8 KiB
Python

"""
Greenery catalog data model Plant class
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalogs.data_model.greenery.soil import Soil as libs_soil
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
self._grows_on = []
for soil in plant.growsOn:
self._grows_on.append(libs_soil(soil))
@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
@property
def grows_on(self) -> [libs_soil]:
"""
Get plant compatible soils
"""
return self._grows_on