Add itest to gitignore

This commit is contained in:
Alireza Adli 2024-07-17 14:35:00 -04:00
parent df235ad6dc
commit 14291a8789
3 changed files with 24 additions and 14 deletions

2
.gitignore vendored
View File

@ -7,4 +7,4 @@ __pycache__/
input_files/*.geojson input_files/*.geojson
!input_files/.gitkeep !input_files/.gitkeep
test_*.py itest_*.py

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../hub_new/hub" />
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10 (conda-hub)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.10 (conda-hub)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View File

@ -12,6 +12,10 @@ from pathlib import Path
from hub.imports.geometry_factory import GeometryFactory from hub.imports.geometry_factory import GeometryFactory
from hub.imports.construction_factory import ConstructionFactory from hub.imports.construction_factory import ConstructionFactory
from hub.helpers.dictionaries import Dictionaries from hub.helpers.dictionaries import Dictionaries
# from hub.city_model_structure.life_cycle_assessment.access_nrcan_catalogue \
# import AccessNrcanCatalog
# from hub.city_model_structure.life_cycle_assessment.building_component \
# import BuildingComponent
class LCACarbonWorkflow: class LCACarbonWorkflow:
@ -44,18 +48,23 @@ class LCACarbonWorkflow:
def calculate_opening_emission(building): def calculate_opening_emission(building):
surface_emission = [] surface_emission = []
for surface in building.surfaces: for surface in building.surfaces:
if surface.window_ratio == 0: for boundary in surface.associated_thermal_boundaries:
opening_surface = 0 if boundary.window_ratio == 0:
opening_material_emission = 0 opening_surface = 0
else: opening_material_emission = 0
opening_surface = 0 print('window = 0')
opening_material_emission = 0 else:
for opening in surface.associated_thermal_boundaries.thermal_openings: opening_surface = 0
opening_surface += opening.area opening_material_emission = 0
# test migration to gittea print('window != 0')
# opening_material_emission = # for opening in surface.associated_thermal_boundaries.thermal_openings:
# opening_surface += opening.area
# opening_material_emission =
def calculate_emission(self): def calculate_emission(self):
emitted_carbon = [] emitted_carbon = []
for building in self.city.buildings: for building in self.city.buildings:
return len(building.surfaces) # self.calculate_opening_emission(building)
for surface in building.surfaces:
for boundary in surface.associated_thermal_boundaries:
print(boundary.window_ratio)