building info can now be retrieved via application, user and scenario

This commit is contained in:
Guille Gutierrez 2023-07-31 16:08:10 -04:00
parent 1abf76125f
commit 2292bff1b8
5 changed files with 12 additions and 7 deletions

View File

@ -34,7 +34,7 @@ class Archetype:
Get name
:return: string
"""
return f'{self._name}_lod{self._lod}'
return self._name
@property
def systems(self) -> List[System]:

View File

@ -55,7 +55,7 @@ class System:
Get name
:return: string
"""
return f'{self._name}_lod{self._lod}'
return self._name
@property
def demand_types(self):

View File

@ -46,7 +46,7 @@ class MontrealCustomEnergySystemParameters:
else:
_generic_energy_systems = city.generic_energy_systems
for building in city.buildings:
archetype_name = f'{building.energy_systems_archetype_name}_lod1.0'
archetype_name = building.energy_systems_archetype_name
try:
archetype = self._search_archetypes(montreal_custom_catalog, archetype_name)
except KeyError:
@ -54,9 +54,12 @@ class MontrealCustomEnergySystemParameters:
archetype_name)
continue
_energy_systems_connection_table, _generic_energy_systems \
= self._create_generic_systems(archetype, building,
_energy_systems_connection_table, _generic_energy_systems)
_energy_systems_connection_table, _generic_energy_systems = self._create_generic_systems(
archetype,
building,
_energy_systems_connection_table,
_generic_energy_systems
)
city.energy_systems_connection_table = _energy_systems_connection_table
city.generic_energy_systems = _generic_energy_systems
@ -85,7 +88,7 @@ class MontrealCustomEnergySystemParameters:
energy_system.demand_types = _hub_demand_types
_generation_system = GenericGenerationSystem()
archetype_generation_equipment = system.generation_system
_type = str(system.name).split('_', maxsplit=1)[0]
_type = system.name
_generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[
_type]
_fuel_type = EnergySystemsHelper().montreal_custom_fuel_to_hub_fuel(archetype_generation_equipment.fuel_type)

View File

@ -33,6 +33,7 @@ class CityObject(Models):
wall_area = Column(Float, nullable=False)
windows_area = Column(Float, nullable=False)
roof_area = Column(Float, nullable=False)
total_pv_area = Column(Float, nullable=False)
system_name = Column(String, nullable=False)
created = Column(DateTime, default=datetime.datetime.utcnow)
updated = Column(DateTime, default=datetime.datetime.utcnow)
@ -48,6 +49,7 @@ class CityObject(Models):
self.volume = building.volume
self.area = building.floor_area
self.roof_area = sum(roof.solid_polygon.area for roof in building.roofs)
self.total_pv_area = sum(roof.solid_polygon.area * roof.solar_collectors_area_reduction_factor for roof in building.roofs)
storeys = building.storeys_above_ground
if storeys is None:
storeys = building.max_height / building.average_storey_height

Binary file not shown.