Added LCA formulas

This commit is contained in:
atiya 2021-11-15 08:24:03 -05:00
parent 97ec2a1436
commit 1d9498cf26
2 changed files with 15 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from pathlib import Path
from imports.life_cycle_assessment.lca_fuel import LcaFuel from imports.life_cycle_assessment.lca_fuel import LcaFuel
from imports.life_cycle_assessment.lca_vehicle import LcaVehicle from imports.life_cycle_assessment.lca_vehicle import LcaVehicle
from imports.life_cycle_assessment.lca_machine import LcaMachine from imports.life_cycle_assessment.lca_machine import LcaMachine
from imports.life_cycle_assessment.lca_material import LcaMaterial
class LifeCycleAssessment: class LifeCycleAssessment:
@ -39,6 +40,12 @@ class LifeCycleAssessment:
""" """
LcaMachine(self._city, self._base_path).enrich() LcaMachine(self._city, self._base_path).enrich()
def _material(self):
"""
Enrich the city by adding the material carbon information
"""
LcaMaterial(self._city, self._base_path).enrich()
def enrich(self): def enrich(self):
""" """
Enrich the city given to the class using the class given handler Enrich the city given to the class using the class given handler

View File

@ -45,6 +45,14 @@ class TestLifeCycleAssessment(TestCase):
# print(machine.name) # print(machine.name)
self.assertTrue(len(city.machines) > 0) self.assertTrue(len(city.machines) > 0)
def test_material(self):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('material', city).enrich()
for material in city.materials:
print(material.material_name)
self.assertTrue(len(city.materials) > 0)