Merge branch 'master' of https://rs-loy-gitlab.concordia.ca/Guille/libs
This commit is contained in:
commit
ed6f568b92
|
@ -104,7 +104,6 @@ class Polygon:
|
||||||
if module != 0:
|
if module != 0:
|
||||||
angle = abs(np.arcsin(scalar_product / module))
|
angle = abs(np.arcsin(scalar_product / module))
|
||||||
angle_sum += angle
|
angle_sum += angle
|
||||||
print(angle_sum)
|
|
||||||
return abs(angle_sum - math.pi*2) < cte.EPSILON
|
return abs(angle_sum - math.pi*2) < cte.EPSILON
|
||||||
|
|
||||||
def contains_polygon(self, polygon):
|
def contains_polygon(self, polygon):
|
||||||
|
@ -112,13 +111,10 @@ class Polygon:
|
||||||
Determines if the given polygon is contained by the current polygon
|
Determines if the given polygon is contained by the current polygon
|
||||||
:return: boolean
|
:return: boolean
|
||||||
"""
|
"""
|
||||||
print('contains')
|
|
||||||
for point in polygon.points:
|
|
||||||
print(point.coordinates, self.contains_point(point))
|
|
||||||
|
|
||||||
|
for point in polygon.points:
|
||||||
if not self.contains_point(point):
|
if not self.contains_point(point):
|
||||||
return False
|
return False
|
||||||
print('Belong!')
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -31,6 +31,7 @@ class ThermalOpening:
|
||||||
self._inside_emissivity = None
|
self._inside_emissivity = None
|
||||||
self._alpha_coefficient = None
|
self._alpha_coefficient = None
|
||||||
self._radiative_coefficient = None
|
self._radiative_coefficient = None
|
||||||
|
self._construction_name = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
@ -290,3 +291,17 @@ class ThermalOpening:
|
||||||
"""
|
"""
|
||||||
if value is not None:
|
if value is not None:
|
||||||
self._radiative_coefficient = float(value)
|
self._radiative_coefficient = float(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def construction_name(self):
|
||||||
|
"""
|
||||||
|
Get thermal opening construction name
|
||||||
|
"""
|
||||||
|
return self._construction_name
|
||||||
|
|
||||||
|
@construction_name.setter
|
||||||
|
def construction_name(self, value):
|
||||||
|
"""
|
||||||
|
Set thermal opening construction name
|
||||||
|
"""
|
||||||
|
self._construction_name = value
|
||||||
|
|
|
@ -8,8 +8,9 @@ from __future__ import annotations
|
||||||
import sys
|
import sys
|
||||||
import pickle
|
import pickle
|
||||||
import math
|
import math
|
||||||
from typing import List, Union
|
import copy
|
||||||
import pyproj
|
import pyproj
|
||||||
|
from typing import List, Union
|
||||||
from pyproj import Transformer
|
from pyproj import Transformer
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -434,3 +435,9 @@ class City:
|
||||||
return lca_material
|
return lca_material
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def copy(self) -> City:
|
||||||
|
"""
|
||||||
|
Get a copy of the current city
|
||||||
|
"""
|
||||||
|
return copy.deepcopy(self)
|
||||||
|
|
|
@ -44,6 +44,14 @@ class CityObject:
|
||||||
"""
|
"""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, value):
|
||||||
|
"""
|
||||||
|
Set building name
|
||||||
|
:return: str
|
||||||
|
"""
|
||||||
|
self._name = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lod(self) -> int:
|
def lod(self) -> int:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -175,7 +175,7 @@
|
||||||
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0.7</company_recycling_ratio>
|
<company_recycling_ratio>0.7</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="brick" id="2" name="light clay brick">
|
<material type="brick" id="2" name="light clay brick">
|
||||||
<density unit="ton/m3">1.2</density>
|
<density unit="ton/m3">1.2</density>
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0.7</company_recycling_ratio>
|
<company_recycling_ratio>0.7</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="brick" id="3" name="refractory">
|
<material type="brick" id="3" name="refractory">
|
||||||
<density unit="ton/m3">2</density>
|
<density unit="ton/m3">2</density>
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0.7</company_recycling_ratio>
|
<company_recycling_ratio>0.7</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="brick" id="4" name="sand-lime brick">
|
<material type="brick" id="4" name="sand-lime brick">
|
||||||
<density unit="ton/m3">1.4</density>
|
<density unit="ton/m3">1.4</density>
|
||||||
|
@ -202,7 +202,7 @@
|
||||||
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0.7</company_recycling_ratio>
|
<company_recycling_ratio>0.7</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="1" name="light weight expanded clay">
|
<material type="concrete" id="1" name="light weight expanded clay">
|
||||||
<density unit="ton/m3">1.6</density>
|
<density unit="ton/m3">1.6</density>
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="2" name="lightweight Expanded perlite">
|
<material type="concrete" id="2" name="lightweight Expanded perlite">
|
||||||
<density unit="ton/m3">1.6</density>
|
<density unit="ton/m3">1.6</density>
|
||||||
|
@ -220,7 +220,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="3" name="lightweight expanded vermiculite">
|
<material type="concrete" id="3" name="lightweight expanded vermiculite">
|
||||||
<density unit="ton/m3">1.6</density>
|
<density unit="ton/m3">1.6</density>
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="4" name="lightweight polystyrene">
|
<material type="concrete" id="4" name="lightweight polystyrene">
|
||||||
<density unit="ton/m3">1.4</density>
|
<density unit="ton/m3">1.4</density>
|
||||||
|
@ -238,7 +238,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="5" name="lightweight pumice">
|
<material type="concrete" id="5" name="lightweight pumice">
|
||||||
<density unit="ton/m3">1.3</density>
|
<density unit="ton/m3">1.3</density>
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="6" name="concrete 20 MPa">
|
<material type="concrete" id="6" name="concrete 20 MPa">
|
||||||
<density unit="ton/m3">2.3</density>
|
<density unit="ton/m3">2.3</density>
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="7" name="concrete 25 MPa">
|
<material type="concrete" id="7" name="concrete 25 MPa">
|
||||||
<density unit="ton/m3">2.3</density>
|
<density unit="ton/m3">2.3</density>
|
||||||
|
@ -265,7 +265,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="8" name="concrete 30-32 MPa">
|
<material type="concrete" id="8" name="concrete 30-32 MPa">
|
||||||
<density unit="ton/m3">2.3</density>
|
<density unit="ton/m3">2.3</density>
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="9" name="concrete 35 MPae">
|
<material type="concrete" id="9" name="concrete 35 MPae">
|
||||||
<density unit="ton/m3">2.4</density>
|
<density unit="ton/m3">2.4</density>
|
||||||
|
@ -283,7 +283,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="10" name="concrete 50 MPa">
|
<material type="concrete" id="10" name="concrete 50 MPa">
|
||||||
<density unit="ton/m3">2.4</density>
|
<density unit="ton/m3">2.4</density>
|
||||||
|
@ -292,7 +292,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="11" name="concrete block">
|
<material type="concrete" id="11" name="concrete block">
|
||||||
<density unit="ton/m3">2.3</density>
|
<density unit="ton/m3">2.3</density>
|
||||||
|
@ -301,7 +301,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="concrete" id="12" name="concrete roof tile">
|
<material type="concrete" id="12" name="concrete roof tile">
|
||||||
<density unit="ton/m3">1.2</density>
|
<density unit="ton/m3">1.2</density>
|
||||||
|
@ -310,7 +310,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="glass" id="1" name="flat glass, coated">
|
<material type="glass" id="1" name="flat glass, coated">
|
||||||
<density unit="ton/m3">2.58</density>
|
<density unit="ton/m3">2.58</density>
|
||||||
|
@ -319,7 +319,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.05</landfilling_ratio>
|
<landfilling_ratio>0.05</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="glass" id="2" name="glass fibre">
|
<material type="glass" id="2" name="glass fibre">
|
||||||
<density unit="ton/m3">2.58</density>
|
<density unit="ton/m3">2.58</density>
|
||||||
|
@ -328,7 +328,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.05</landfilling_ratio>
|
<landfilling_ratio>0.05</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="1" name="cellulose fibre">
|
<material type="insulation" id="1" name="cellulose fibre">
|
||||||
<density unit="ton/m3">0.06</density>
|
<density unit="ton/m3">0.06</density>
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="2" name="cork slab">
|
<material type="insulation" id="2" name="cork slab">
|
||||||
<density unit="ton/m3">0.122</density>
|
<density unit="ton/m3">0.122</density>
|
||||||
|
@ -346,7 +346,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="3" name="polystyren foam">
|
<material type="insulation" id="3" name="polystyren foam">
|
||||||
<density unit="ton/m3">0.028</density>
|
<density unit="ton/m3">0.028</density>
|
||||||
|
@ -355,7 +355,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="4" name="polystyrene 10% recycled">
|
<material type="insulation" id="4" name="polystyrene 10% recycled">
|
||||||
<density unit="ton/m3">0.024</density>
|
<density unit="ton/m3">0.024</density>
|
||||||
|
@ -364,7 +364,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="5" name="stone wool">
|
<material type="insulation" id="5" name="stone wool">
|
||||||
<density unit="ton/m3">0.1</density>
|
<density unit="ton/m3">0.1</density>
|
||||||
|
@ -373,7 +373,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="6" name="foam glass">
|
<material type="insulation" id="6" name="foam glass">
|
||||||
<density unit="ton/m3">0.3</density>
|
<density unit="ton/m3">0.3</density>
|
||||||
|
@ -382,7 +382,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="insulation" id="7" name="glass wool mat">
|
<material type="insulation" id="7" name="glass wool mat">
|
||||||
<density unit="ton/m3">0.032</density>
|
<density unit="ton/m3">0.032</density>
|
||||||
|
@ -391,7 +391,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.1</landfilling_ratio>
|
<landfilling_ratio>0.1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="wood" id="1" name="fiberboard, hard">
|
<material type="wood" id="1" name="fiberboard, hard">
|
||||||
<density unit="ton/m3">0.9</density>
|
<density unit="ton/m3">0.9</density>
|
||||||
|
@ -400,7 +400,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.4</landfilling_ratio>
|
<landfilling_ratio>0.4</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="wood" id="2" name="three layerd laminated board">
|
<material type="wood" id="2" name="three layerd laminated board">
|
||||||
<density unit="ton/m3">0.7</density>
|
<density unit="ton/m3">0.7</density>
|
||||||
|
@ -409,7 +409,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.4</landfilling_ratio>
|
<landfilling_ratio>0.4</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="wood" id="3" name="fibreboard, soft">
|
<material type="wood" id="3" name="fibreboard, soft">
|
||||||
<density unit="ton/m3">0.65</density>
|
<density unit="ton/m3">0.65</density>
|
||||||
|
@ -418,7 +418,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.4</landfilling_ratio>
|
<landfilling_ratio>0.4</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="wood" id="4" name="plywood">
|
<material type="wood" id="4" name="plywood">
|
||||||
<density unit="ton/m3">0.72</density>
|
<density unit="ton/m3">0.72</density>
|
||||||
|
@ -427,7 +427,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.4</landfilling_ratio>
|
<landfilling_ratio>0.4</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="1" name="acrylic filler">
|
<material type="covering" id="1" name="acrylic filler">
|
||||||
<density unit="ton/m3">1.43</density>
|
<density unit="ton/m3">1.43</density>
|
||||||
|
@ -436,7 +436,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0</company_recycling_ratio>
|
<company_recycling_ratio>0</company_recycling_ratio>
|
||||||
<landfilling_ratio>1</landfilling_ratio>
|
<landfilling_ratio>1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="2" name="anhydrite floor">
|
<material type="covering" id="2" name="anhydrite floor">
|
||||||
<density unit="ton/m3">1.43</density>
|
<density unit="ton/m3">1.43</density>
|
||||||
|
@ -445,7 +445,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0</company_recycling_ratio>
|
<company_recycling_ratio>0</company_recycling_ratio>
|
||||||
<landfilling_ratio>1</landfilling_ratio>
|
<landfilling_ratio>1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="3" name="base plaster">
|
<material type="covering" id="3" name="base plaster">
|
||||||
<density unit="ton/m3">1.43</density>
|
<density unit="ton/m3">1.43</density>
|
||||||
|
@ -454,7 +454,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0</company_recycling_ratio>
|
<company_recycling_ratio>0</company_recycling_ratio>
|
||||||
<landfilling_ratio>1</landfilling_ratio>
|
<landfilling_ratio>1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="4" name="cement cast plaster floor">
|
<material type="covering" id="4" name="cement cast plaster floor">
|
||||||
<density unit="ton/m3">1.43</density>
|
<density unit="ton/m3">1.43</density>
|
||||||
|
@ -463,7 +463,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0</company_recycling_ratio>
|
<company_recycling_ratio>0</company_recycling_ratio>
|
||||||
<landfilling_ratio>1</landfilling_ratio>
|
<landfilling_ratio>1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="5" name="cement tile">
|
<material type="covering" id="5" name="cement tile">
|
||||||
<density unit="ton/m3">1.2</density>
|
<density unit="ton/m3">1.2</density>
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="6" name="ceramic tile">
|
<material type="covering" id="6" name="ceramic tile">
|
||||||
<density unit="ton/m3">2.1</density>
|
<density unit="ton/m3">2.1</density>
|
||||||
|
@ -481,7 +481,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="7" name="clay plaster">
|
<material type="covering" id="7" name="clay plaster">
|
||||||
<density unit="ton/m3">1.43</density>
|
<density unit="ton/m3">1.43</density>
|
||||||
|
@ -490,7 +490,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>0</company_recycling_ratio>
|
<company_recycling_ratio>0</company_recycling_ratio>
|
||||||
<landfilling_ratio>1</landfilling_ratio>
|
<landfilling_ratio>1</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="8" name="fiber cement corrugated slab">
|
<material type="covering" id="8" name="fiber cement corrugated slab">
|
||||||
<density unit="ton/m3">1.44</density>
|
<density unit="ton/m3">1.44</density>
|
||||||
|
@ -499,7 +499,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="9" name="fiber cement facing tile">
|
<material type="covering" id="9" name="fiber cement facing tile">
|
||||||
<density unit="ton/m3">1.44</density>
|
<density unit="ton/m3">1.44</density>
|
||||||
|
@ -508,7 +508,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="wood" id="10" name="gypsum fibreboard">
|
<material type="wood" id="10" name="gypsum fibreboard">
|
||||||
<density unit="ton/m3">1.27</density>
|
<density unit="ton/m3">1.27</density>
|
||||||
|
@ -517,7 +517,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="covering" id="11" name="gypsum plaster board">
|
<material type="covering" id="11" name="gypsum plaster board">
|
||||||
<density unit="ton/m3">1.15</density>
|
<density unit="ton/m3">1.15</density>
|
||||||
|
@ -526,7 +526,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.2</landfilling_ratio>
|
<landfilling_ratio>0.2</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="metal" id="1" name="steel">
|
<material type="metal" id="1" name="steel">
|
||||||
<density unit="ton/m3">8</density>
|
<density unit="ton/m3">8</density>
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.02</landfilling_ratio>
|
<landfilling_ratio>0.02</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="metal" id="2" name="aluminium">
|
<material type="metal" id="2" name="aluminium">
|
||||||
<density unit="ton/m3">2.7</density>
|
<density unit="ton/m3">2.7</density>
|
||||||
|
@ -544,7 +544,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.02</landfilling_ratio>
|
<landfilling_ratio>0.02</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
<material type="metal" id="3" name="reinforcing steel">
|
<material type="metal" id="3" name="reinforcing steel">
|
||||||
<density unit="ton/m3">7.85</density>
|
<density unit="ton/m3">7.85</density>
|
||||||
|
@ -553,7 +553,7 @@
|
||||||
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
<onsite_recycling_ratio>0</onsite_recycling_ratio>
|
||||||
<company_recycling_ratio>1</company_recycling_ratio>
|
<company_recycling_ratio>1</company_recycling_ratio>
|
||||||
<landfilling_ratio>0.02</landfilling_ratio>
|
<landfilling_ratio>0.02</landfilling_ratio>
|
||||||
<cost unit= "...."> .... </cost>
|
<cost unit="CAD">0.1</cost>
|
||||||
</material>
|
</material>
|
||||||
</building_materials>
|
</building_materials>
|
||||||
</library>
|
</library>
|
|
@ -12,7 +12,8 @@ class ThermalOpeningArchetype:
|
||||||
def __init__(self, conductivity=None, frame_ratio=None, g_value=None, thickness=None,
|
def __init__(self, conductivity=None, frame_ratio=None, g_value=None, thickness=None,
|
||||||
back_side_solar_transmittance_at_normal_incidence=None,
|
back_side_solar_transmittance_at_normal_incidence=None,
|
||||||
front_side_solar_transmittance_at_normal_incidence=None, overall_u_value=None,
|
front_side_solar_transmittance_at_normal_incidence=None, overall_u_value=None,
|
||||||
openable_ratio=None, inside_emissivity=None, alpha_coefficient=None, radiative_coefficient=None):
|
openable_ratio=None, inside_emissivity=None, alpha_coefficient=None, radiative_coefficient=None,
|
||||||
|
construction_name=None):
|
||||||
self._conductivity = conductivity
|
self._conductivity = conductivity
|
||||||
self._frame_ratio = frame_ratio
|
self._frame_ratio = frame_ratio
|
||||||
self._g_value = g_value
|
self._g_value = g_value
|
||||||
|
@ -24,6 +25,7 @@ class ThermalOpeningArchetype:
|
||||||
self._inside_emissivity = inside_emissivity
|
self._inside_emissivity = inside_emissivity
|
||||||
self._alpha_coefficient = alpha_coefficient
|
self._alpha_coefficient = alpha_coefficient
|
||||||
self._radiative_coefficient = radiative_coefficient
|
self._radiative_coefficient = radiative_coefficient
|
||||||
|
self._construction_name = construction_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def conductivity(self):
|
def conductivity(self):
|
||||||
|
@ -112,3 +114,17 @@ class ThermalOpeningArchetype:
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._radiative_coefficient
|
return self._radiative_coefficient
|
||||||
|
|
||||||
|
@property
|
||||||
|
def construction_name(self):
|
||||||
|
"""
|
||||||
|
Get thermal opening construction name
|
||||||
|
"""
|
||||||
|
return self._construction_name
|
||||||
|
|
||||||
|
@construction_name.setter
|
||||||
|
def construction_name(self, value):
|
||||||
|
"""
|
||||||
|
Set thermal opening construction name
|
||||||
|
"""
|
||||||
|
self._construction_name = value
|
||||||
|
|
|
@ -109,6 +109,7 @@ class NrelPhysicsInterface:
|
||||||
if 'window' in construction and construction['window'] is not None:
|
if 'window' in construction and construction['window'] is not None:
|
||||||
window_ratio = construction['window_ratio']['#text']
|
window_ratio = construction['window_ratio']['#text']
|
||||||
w_lib = self._search_construction_type('window', construction['window'])
|
w_lib = self._search_construction_type('window', construction['window'])
|
||||||
|
window_construction_name = w_lib['@name']
|
||||||
frame_ratio = w_lib['frame_ratio']['#text']
|
frame_ratio = w_lib['frame_ratio']['#text']
|
||||||
if 'conductivity' in w_lib:
|
if 'conductivity' in w_lib:
|
||||||
conductivity = w_lib['conductivity']['#text']
|
conductivity = w_lib['conductivity']['#text']
|
||||||
|
@ -128,7 +129,8 @@ class NrelPhysicsInterface:
|
||||||
thickness=thickness, back_side_solar_transmittance_at_normal_incidence=
|
thickness=thickness, back_side_solar_transmittance_at_normal_incidence=
|
||||||
back_side_solar_transmittance_at_normal_incidence,
|
back_side_solar_transmittance_at_normal_incidence,
|
||||||
front_side_solar_transmittance_at_normal_incidence=
|
front_side_solar_transmittance_at_normal_incidence=
|
||||||
front_side_solar_transmittance_at_normal_incidence)
|
front_side_solar_transmittance_at_normal_incidence,
|
||||||
|
construction_name=window_construction_name)
|
||||||
else:
|
else:
|
||||||
overall_u_value = w_lib['overall_u_value']['#text']
|
overall_u_value = w_lib['overall_u_value']['#text']
|
||||||
units = w_lib['overall_u_value']['@units']
|
units = w_lib['overall_u_value']['@units']
|
||||||
|
|
|
@ -99,6 +99,7 @@ class UsPhysicsParameters(NrelPhysicsInterface):
|
||||||
for thermal_opening in thermal_boundary.thermal_openings:
|
for thermal_opening in thermal_boundary.thermal_openings:
|
||||||
if thermal_boundary_archetype.thermal_opening_archetype is not None:
|
if thermal_boundary_archetype.thermal_opening_archetype is not None:
|
||||||
thermal_opening_archetype = thermal_boundary_archetype.thermal_opening_archetype
|
thermal_opening_archetype = thermal_boundary_archetype.thermal_opening_archetype
|
||||||
|
thermal_opening.construction_name = thermal_opening_archetype.construction_name
|
||||||
thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio
|
thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio
|
||||||
thermal_opening.g_value = thermal_opening_archetype.g_value
|
thermal_opening.g_value = thermal_opening_archetype.g_value
|
||||||
thermal_opening.conductivity = thermal_opening_archetype.conductivity
|
thermal_opening.conductivity = thermal_opening_archetype.conductivity
|
||||||
|
|
|
@ -7,7 +7,6 @@ from numpy import inf
|
||||||
from rhino3dm import *
|
from rhino3dm import *
|
||||||
from rhino3dm._rhino3dm import MeshType
|
from rhino3dm._rhino3dm import MeshType
|
||||||
|
|
||||||
|
|
||||||
from city_model_structure.attributes.point import Point
|
from city_model_structure.attributes.point import Point
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ from city_model_structure.attributes.polygon import Polygon
|
||||||
from city_model_structure.building import Building
|
from city_model_structure.building import Building
|
||||||
from city_model_structure.city import City
|
from city_model_structure.city import City
|
||||||
from city_model_structure.building_demand.surface import Surface as LibsSurface
|
from city_model_structure.building_demand.surface import Surface as LibsSurface
|
||||||
from helpers.constants import EPSILON
|
|
||||||
from imports.geometry.helpers.geometry_helper import GeometryHelper
|
from imports.geometry.helpers.geometry_helper import GeometryHelper
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +29,6 @@ class Rhino:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _in_perimeter(wall, corner):
|
def _in_perimeter(wall, corner):
|
||||||
res = wall.contains_point(Point(corner))
|
res = wall.contains_point(Point(corner))
|
||||||
print(f'belong: {res} wall:({wall.coordinates}) corner: ({corner})')
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -98,7 +95,6 @@ class Rhino:
|
||||||
windows.append(Polygon(surface.perimeter_polygon.inverse))
|
windows.append(Polygon(surface.perimeter_polygon.inverse))
|
||||||
else:
|
else:
|
||||||
buildings.append(rhino_object)
|
buildings.append(rhino_object)
|
||||||
print(f'windows: {len(windows)}')
|
|
||||||
# todo: this method will be pretty inefficient
|
# todo: this method will be pretty inefficient
|
||||||
for hole in windows:
|
for hole in windows:
|
||||||
corner = hole.coordinates[0]
|
corner = hole.coordinates[0]
|
||||||
|
|
|
@ -6,7 +6,7 @@ Contributor Mohammad Reza mohammad.seyedabadi@mail.concordia.ca
|
||||||
"""
|
"""
|
||||||
import xmltodict
|
import xmltodict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from city_model_structure.building_demand.material import Material
|
from city_model_structure.lca_material import LcaMaterial as LMaterial
|
||||||
|
|
||||||
class LcaMaterial:
|
class LcaMaterial:
|
||||||
def __init__(self, city, base_path):
|
def __init__(self, city, base_path):
|
||||||
|
@ -15,14 +15,14 @@ class LcaMaterial:
|
||||||
self._lca = None
|
self._lca = None
|
||||||
|
|
||||||
def enrich(self):
|
def enrich(self):
|
||||||
self._city.materials = []
|
self._city.lca_materials = []
|
||||||
path = Path(self._base_path / 'lca_data.xml').resolve()
|
path = Path(self._base_path / 'lca_data.xml').resolve()
|
||||||
|
|
||||||
with open(path) as xml:
|
with open(path) as xml:
|
||||||
self._lca = xmltodict.parse(xml.read())
|
self._lca = xmltodict.parse(xml.read())
|
||||||
|
|
||||||
for material in self._lca["library"]["building_materials"]['material']:
|
for material in self._lca["library"]["building_materials"]['material']:
|
||||||
_material = Material()
|
_material = LMaterial()
|
||||||
_material.type = material['@type']
|
_material.type = material['@type']
|
||||||
_material.id = material['@id']
|
_material.id = material['@id']
|
||||||
_material.name = material['@name']
|
_material.name = material['@name']
|
||||||
|
@ -37,4 +37,4 @@ class LcaMaterial:
|
||||||
_material.cost=material['cost']['#text']
|
_material.cost=material['cost']['#text']
|
||||||
_material._cost_unit=material['cost']['@unit']
|
_material._cost_unit=material['cost']['@unit']
|
||||||
|
|
||||||
self._city.materials.append(_material)
|
self._city.lca_materials.append(_material)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user