Final version summercourse with final graphs

This commit is contained in:
Oriol Gavalda 2023-07-17 20:04:15 -04:00
parent 44dff9b47e
commit 95698d61ed
2 changed files with 254 additions and 12 deletions

249
input_files/eilat.geojson Normal file
View File

@ -0,0 +1,249 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 1,
"properties": {
"heightmax": 9,
"ANNEE_CONS": 1978,
"CODE_UTILI": "residential"
},
"geometry": {
"coordinates": [
[
[
34.95217088371581,
29.56694805860026
],
[
34.95262396587913,
29.566952667742285
],
[
34.95261999147337,
29.567024109421467
],
[
34.952169558914704,
29.567019500282157
],
[
34.95217088371581,
29.56694805860026
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"id": 3,
"properties": {
"heightmax": 16,
"ANNEE_CONS": 2012,
"CODE_UTILI": "dormitory"
},
"geometry": {
"coordinates": [
[
[
34.95176644317411,
29.56827388702702
],
[
34.95176550020565,
29.568180388329026
],
[
34.95179850408434,
29.568180388329026
],
[
34.95179850408434,
29.5681303582886
],
[
34.95176644317411,
29.5681303582886
],
[
34.95176644317411,
29.568038499789708
],
[
34.951874884488376,
29.568038499789708
],
[
34.951874884488376,
29.568058183760357
],
[
34.95192391882168,
29.568058183760357
],
[
34.951922032885705,
29.56804178045124
],
[
34.95205216246262,
29.568042600617147
],
[
34.952051219494166,
29.568129538124154
],
[
34.95201821561636,
29.5681303582886
],
[
34.95201821561636,
29.568176287507143
],
[
34.95204839059062,
29.568176287507143
],
[
34.95205027652662,
29.56827552735433
],
[
34.95195503676348,
29.568274707190284
],
[
34.95195597973188,
29.56825830391628
],
[
34.951849424353696,
29.56825830391628
],
[
34.951849424353696,
29.568274707190284
],
[
34.95176644317411,
29.56827388702702
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"id": 2,
"properties": {
"heightmax": 24,
"ANNEE_CONS": 2002,
"CODE_UTILI": "Hotel employ"
},
"geometry": {
"coordinates": [
[
[
34.94972280674813,
29.566224752287738
],
[
34.94974316291999,
29.56597561012454
],
[
34.94989147217407,
29.565980668855033
],
[
34.94987402402688,
29.566233605043536
],
[
34.94972280674813,
29.566224752287738
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"id": 4,
"properties": {
"heightmax": 24,
"ANNEE_CONS": 2002,
"CODE_UTILI": "Hotel employ"
},
"geometry": {
"coordinates": [
[
[
34.9492572120038,
29.565899295950373
],
[
34.949411568175805,
29.565906093785898
],
[
34.94939398329561,
29.56615761339161
],
[
34.94924158099852,
29.566149116117728
],
[
34.9492572120038,
29.565899295950373
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"id": 5,
"properties": {
"heightmax": 9,
"ANNEE_CONS": 1978,
"CODE_UTILI": "residential"
},
"geometry": {
"coordinates": [
[
[
34.95213398400861,
29.567197394967593
],
[
34.95258172690612,
29.56720586098278
],
[
34.95258172690612,
29.56727217807996
],
[
34.952132361751325,
29.56726935607685
],
[
34.95213398400861,
29.567197394967593
]
]
],
"type": "Polygon"
}
}
]
}

17
main.py
View File

@ -3,7 +3,6 @@ from pathlib import Path
from hub.imports.geometry_factory import GeometryFactory
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
from hub.helpers.dictionaries import Dictionaries
from hub.imports.energy_systems_factory import EnergySystemsFactory
import hub.helpers.constants as cte
@ -13,14 +12,11 @@ from sra_engine import SraEngine
try:
file_path = (Path(__file__).parent / 'input_files' / '195_v1.geojson')
file_path = (Path(__file__).parent / 'input_files' / 'eilat.geojson')
climate_reference_city = 'Montreal'
weather_format = 'epw'
construction_format = 'nrcan'
usage_format = 'nrcan'
construction_format = 'eilat'
usage_format = 'eilat'
energy_systems_format = 'montreal_custom'
attic_heated_case = 0
basement_heated_case = 1
out_path = (Path(__file__).parent / 'output_files')
tmp_folder = (Path(__file__).parent / 'tmp')
@ -31,12 +27,9 @@ try:
height_field='heightmax',
year_of_construction_field='ANNEE_CONS',
function_field='CODE_UTILI',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
city.climate_reference_city = climate_reference_city
city.climate_file = (tmp_folder / f'{climate_reference_city}.cli').resolve()
function_to_hub=Dictionaries().eilat_function_to_hub_function).city
print(f'city created from {file_path}')
WeatherFactory(weather_format, city).enrich()
print('enrich weather... done')
ConstructionFactory(construction_format, city).enrich()
print('enrich constructions... done')
UsageFactory(usage_format, city).enrich()