From dbbe3d56fca1d2024d936b2a87376511b9baffa2 Mon Sep 17 00:00:00 2001 From: Pilar Date: Tue, 23 Mar 2021 10:13:01 -0400 Subject: [PATCH] before behnam changes in libs --- city_model_structure/city.py | 8 +- data/physics/ca_archetypes_reduced.xml | 40 +++--- data/physics/ca_constructions_reduced.xml | 156 +++++++++++----------- data/usage/ca_archetypes_reduced.xml | 4 +- imports/geometry_feeders/citygml.py | 2 + tests/test_exports.py | 4 +- 6 files changed, 105 insertions(+), 109 deletions(-) diff --git a/city_model_structure/city.py b/city_model_structure/city.py index fc112aeb..f9516f55 100644 --- a/city_model_structure/city.py +++ b/city_model_structure/city.py @@ -15,6 +15,7 @@ from city_model_structure.building import Building from city_model_structure.city_object import CityObject from helpers.geometry_helper import GeometryHelper import math +import time class City: @@ -141,12 +142,6 @@ class City: raise NotImplementedError(new_city_object.type) if self._buildings is None: self._buildings = [] - for building in self.buildings: - if self._geometry.adjacent_locations(building.location, new_city_object.location): - for surface in building.surfaces: - for surface2 in new_city_object.surfaces: - surface.shared(surface2) - self._buildings.append(new_city_object) @property @@ -194,7 +189,6 @@ class City: """ selected_region_lower_corner = [center[0] - radius, center[1] - radius, center[2] - radius] selected_region_upper_corner = [center[0] + radius, center[1] + radius, center[2] + radius] - # todo, ask @Guille: does this create a new instance of city?? selected_region_city = City(selected_region_lower_corner, selected_region_upper_corner, srs_name=self.srs_name) for city_object in self.city_objects: location = city_object.location diff --git a/data/physics/ca_archetypes_reduced.xml b/data/physics/ca_archetypes_reduced.xml index dcb9ee43..54450ff0 100644 --- a/data/physics/ca_archetypes_reduced.xml +++ b/data/physics/ca_archetypes_reduced.xml @@ -14,8 +14,8 @@ 1 90 0.1 - 0.25 - 0.176 + 0.15 + 0.5 0 @@ -32,8 +32,8 @@ 1 90 0.1 - 0.25 - 0.19 + 0.15 + 0.5 0 @@ -49,9 +49,9 @@ 3 1 90 - 0.1 - 0.15 - 0.22 + 0.1 + 0.15 + 0.5 0 @@ -67,16 +67,16 @@ 3 1 90 - 0.1 - 0.15 - 0.32 + 0.1 + 0.15 + 0.5 0 - 0.11 + 0.13 34 @@ -103,9 +103,9 @@ 3 1 90 - 0.1 - 0.15 - 0.53 + 0.05 + 0.15 + 0.3 0 @@ -121,9 +121,9 @@ 3 1 90 - 0.1 - 0.15 - 0.6 + 0.05 + 0.15 + 0.3 0 @@ -139,9 +139,9 @@ 3 1 90 - 0.1 - 0.15 - 0.6 + 0.05 + 0.15 + 0.3 0 diff --git a/data/physics/ca_constructions_reduced.xml b/data/physics/ca_constructions_reduced.xml index cd2ea6ea..69557772 100644 --- a/data/physics/ca_constructions_reduced.xml +++ b/data/physics/ca_constructions_reduced.xml @@ -3,61 +3,61 @@ 0.46 - 0.5 + 0.46 0.3 1.8 0.52 - 0.5 + 0.52 0.3 - 2.702 + 2.7 - 0.14 - 0.7 - 0.3 + 0.202 + 0.8 + 0.2 - 0.17 - 0.7 - 0.3 + 0.187 + 0.8 + 0.2 - 0.19 - 0.7 - 0.3 + 0.217 + 0.8 + 0.2 - 0.2 - 0.7 - 0.3 + 0.236 + 0.8 + 0.2 - 0.25 - 0.7 - 0.3 + 0.253 + 0.8 + 0.2 - 0.26 - 0.7 - 0.3 + 0.253 + 0.8 + 0.2 0.26 - 0.7 - 0.3 + 0.8 + 0.2 - 0.301 - 0.7 - 0.3 + 0.282 + 0.8 + 0.2 #wall above grade - 0.25 + 0.3 0.7 0.3 @@ -77,106 +77,106 @@ 0.3 - 0.333 + 0.327 0.7 0.3 - 0.36 + 0.364 0.7 0.3 - 0.41 + 0.411 0.7 0.3 - 0.48 + 0.411 0.7 0.3 #wall below grade - 0.33 - 0.7 - 0.3 + 0.512 + 0 + 0 - 0.6 - 0.7 - 0.3 + 0.512 + 0 + 0 - 0.6 - 0.7 - 0.3 + 0.67 + 0 + 0 - 0.37 - 0.7 - 0.3 + 0.848 + 0 + 0 - 1.16 - 0.7 - 0.3 + 1.048 + 0 + 0 - 0.60 - 0.7 - 0.3 + 1.154 + 0 + 0 - 0.588 - 0.7 - 0.3 + 1.243 + 0 + 0 - 0.588 - 0.7 - 0.3 + 1.425 + 0 + 0 #slab on grade - 0.3 - 0.7 - 0.3 + 0.512 + 0 + 0 - 0.51 - 0.7 - 0.3 + 0.512 + 0 + 0 0.67 - 0.7 - 0.3 + 0 + 0 - 0.85 - 0.7 - 0.3 + 0.848 + 0 + 0 - 1.05 - 0.7 - 0.3 + 1.048 + 0 + 0 - 1.15 - 0.7 - 0.3 + 1.154 + 0 + 0 - 1.24 - 0.7 - 0.3 + 1.243 + 0 + 0 - 1.43 - 0.7 - 0.3 + 1.425 + 0 + 0 diff --git a/data/usage/ca_archetypes_reduced.xml b/data/usage/ca_archetypes_reduced.xml index 0f1dce65..29eff7ec 100644 --- a/data/usage/ca_archetypes_reduced.xml +++ b/data/usage/ca_archetypes_reduced.xml @@ -2,7 +2,7 @@ Building Usage Library Reduced Library created by Rabeeh from whatever norm - Source? + https://www.engineeringtoolbox.com/metabolic-heat-persons-d_706.html residential All residential buildings @@ -12,7 +12,7 @@ 14 Persons and home appliances - 4.3 + 9.69 0.40 0.50 0.10 diff --git a/imports/geometry_feeders/citygml.py b/imports/geometry_feeders/citygml.py index 422b27de..c8112234 100644 --- a/imports/geometry_feeders/citygml.py +++ b/imports/geometry_feeders/citygml.py @@ -10,6 +10,7 @@ from city_model_structure.city import City from city_model_structure.building import Building from city_model_structure.attributes.surface import Surface from helpers.geometry_helper import GeometryHelper +import time class CityGml: @@ -68,6 +69,7 @@ class CityGml: City model structure enriched with the geometry information :return: City """ + init = time.process_time_ns() if self._city is None: # todo: refactor this method to clearly choose the gml type self._city = City(self._lower_corner, self._upper_corner, self._srs_name) diff --git a/tests/test_exports.py b/tests/test_exports.py index cc828b90..84461af9 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -6,10 +6,10 @@ Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc from pathlib import Path from unittest import TestCase -from imports.geometry_factory import GeometryFactory from exports.exports_factory import ExportsFactory from city_model_structure.city import City + class TestExports(TestCase): """ TestGeometryFactory TestCase 1 @@ -25,7 +25,7 @@ class TestExports(TestCase): def _get_city(self): if self._city_gml is None: - file_path = (self._example_path / 'one_building_in_kelowna_populated_weather_demand.pickle').resolve() + file_path = (self._example_path / 'kelowna.pickle').resolve() self._city_gml = City.load(file_path) return self._city_gml