Merge remote-tracking branch 'origin/master'

# Conflicts:
#	physics/physics_feeders/us_base_physics_parameters.py
This commit is contained in:
Guille Gutierrez 2020-06-26 10:09:42 -04:00
commit c1b32b22a3
11 changed files with 65 additions and 5 deletions

58
WINDOWS_INSTALL.md Normal file
View File

@ -0,0 +1,58 @@
# Get the code.
1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recomend PyCharm community edition, a wonderful open source python editor
[PyCharm Community edition](https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC)
2. Run the installer, and follow the instalation instructions for PyCharm, you may change a few options, but the default ones, should be fine.
3. Open pycharm and click on **"Get from Version Control"**.
![pycharm wellcome screen](./docs/img/img_0.png)
4. Select Git as the version control and set the url to [libs repository](https://binarycat.org/git/Guille/libs.git) as shown in the picture.
![pycharm get from version control screen](./docs/img/img_1.png)
You may need to install git, by clicking at ***Download and install***
5. Click Clone to download CERC libs source code.
![pycharm project screen](./docs/img/img_2.png)
you will end with a project like this.
# Configure PyCharm.
We use 2 spaces as a tab instead standard [pep8](https://www.python.org/dev/peps/pep-0008/) 4 spaces indentation.
this option could be configured in PyCharm at the settings screen as shown in the picture.
![pycharm configuration screen](./docs/img/img_5.png)
# Start your own project.
1. Click on file new project like in the image
![pycharm new project screen](./docs/img/img_3.png)
2. Go to project settings and add the libs project to your own as shown in the picture
![pycharm new project screen](./docs/img/img_4.png)
3. Add your first file to your project and click in install requirements to automatically download all the dependencies
4. When all the dependencies are satistied, we are good to go to start importing our first model.
by adding the following code to our main.py
```
from geometry.geometry_factory import GeometryFactory
city = GeometryFactory('citygml', 'myfile.gml').city
```

BIN
docs/img/img_0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
docs/img/img_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/img/img_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
docs/img/img_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
docs/img/img_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
docs/img/img_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -11,6 +11,7 @@ from city_model_structure.building import Building
from city_model_structure.surface import Surface
from helpers.geometry_helper import GeometryHelper
class CityGml:
"""
CityGml class

View File

@ -20,7 +20,6 @@ class UsBasePhysicsParameters:
def __init__(self, climate_zone, buildings, function_to_type, base_path):
self._climate_zone = climate_zone
self._buildings = buildings
print(buildings)
# load US Library
path = str(Path.cwd() / base_path / 'us_constructions.xml')
with open(path) as xml:
@ -36,14 +35,15 @@ class UsBasePhysicsParameters:
if building_type is None:
return
archetype = self._search_archetype(building_type,
UsToLibraryTypes.yoc_to_standard(building.year_of_construction),
UsToLibraryTypes.yoc_to_standard(city_object.year_of_construction),
self._climate_zone)
# ToDo: remove this in the future
# ToDo: Raise WrongArchetype if not all the surface types are defined for the given city_object
if archetype is None:
print(building_type, UsToLibraryTypes.yoc_to_standard(building.year_of_construction),
print('Building ', city_object.name, 'has unknown archetype')
print('type: ', building_type, UsToLibraryTypes.yoc_to_standard(city_object.year_of_construction),
self._climate_zone)
raise Exception('Archetype not found for building')
continue
building.average_storey_height = archetype['average_storey_height']['#text']
building.storeys_above_ground = archetype['number_of_storeys']['#text']

View File

@ -623,4 +623,4 @@
<function>I1</function>
</Building>
</cityObjectMember>
</CityModel>
</CityModel>

View File

@ -17,6 +17,7 @@ class UsBaseUsageParameters:
"""
def __init__(self, city, function_to_usage):
self._city = city
# todo: control not archetype found
# ToDo: this is using the german library as a temporary approach, need to use/define a library for US
path = str(Path.cwd() / 'data/usage/de_library.xml')
with open(path) as xml: