Add code comment to the classes

This commit is contained in:
Guille Gutierrez 2020-06-09 14:07:47 -04:00
parent 2107b0f0f9
commit e613be147f
30 changed files with 164 additions and 4 deletions

View File

@ -1,3 +1,8 @@
"""
CityObject module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from matplotlib import pylab from matplotlib import pylab
from city_model_structure.polyhedron import Polyhedron from city_model_structure.polyhedron import Polyhedron
from city_model_structure.thermal_zone import ThermalZone from city_model_structure.thermal_zone import ThermalZone

View File

@ -1,3 +1,10 @@
"""
InternalGains module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class InternalGains: class InternalGains:
def __init__(self): def __init__(self):
self._average_internal_gain_w_m2 = None self._average_internal_gain_w_m2 = None

View File

@ -1,3 +1,8 @@
"""
Layers module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from city_model_structure.material import Material from city_model_structure.material import Material

View File

@ -1,3 +1,10 @@
"""
Material module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Material: class Material:
def __init__(self): def __init__(self):
self._conductivity_wm_k = None self._conductivity_wm_k = None

View File

@ -1,3 +1,8 @@
"""
Polyhedron module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import numpy as np import numpy as np
import stl import stl
from helpers.geometry import Geometry from helpers.geometry import Geometry

View File

@ -1,3 +1,8 @@
"""
Surface module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from __future__ import annotations from __future__ import annotations
import numpy as np import numpy as np
import pyny3d.geoms as pn import pyny3d.geoms as pn

View File

@ -1,3 +1,8 @@
"""
ThermalBoundary module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from city_model_structure.thermal_opening import ThermalOpening from city_model_structure.thermal_opening import ThermalOpening
from city_model_structure.thermal_zone import ThermalZone from city_model_structure.thermal_zone import ThermalZone
from city_model_structure.layer import Layer from city_model_structure.layer import Layer

View File

@ -1,3 +1,8 @@
"""
ThermalOpening module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from helpers.configuration import Configuration from helpers.configuration import Configuration

View File

@ -1,3 +1,8 @@
"""
ThermalZone module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from typing import List from typing import List
from city_model_structure.thermal_boundary import ThermalBoundary from city_model_structure.thermal_boundary import ThermalBoundary
from city_model_structure.usage_zone import UsageZone from city_model_structure.usage_zone import UsageZone

View File

@ -1,3 +1,8 @@
"""
UsageZone module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from city_model_structure.internal_gains import InternalGains from city_model_structure.internal_gains import InternalGains
from typing import List from typing import List

View File

@ -1,3 +1,10 @@
"""
Window module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Window: class Window:
def __init__(self): def __init__(self):
self._conductivity_wm_k = None self._conductivity_wm_k = None

View File

@ -1,3 +1,8 @@
"""
GeometryFactory retrieve the specific geometric module to load the given format
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from geometry.geometry_feeders.city_gml import CityGml from geometry.geometry_feeders.city_gml import CityGml
from city_model_structure.city import City from city_model_structure.city import City

View File

@ -1,3 +1,8 @@
"""
CityGml module parses citygml files and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict import xmltodict
import numpy as np import numpy as np
from city_model_structure.city import City from city_model_structure.city import City
@ -101,5 +106,3 @@ class CityGml:
self._city.add_city_object(CityObject(name, lod, surfaces, terrains, year_of_construction, function, self._city.add_city_object(CityObject(name, lod, surfaces, terrains, year_of_construction, function,
self._lower_corner)) self._lower_corner))
return self._city return self._city

View File

@ -1,3 +1,8 @@
"""
Configuration helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import configparser import configparser
from pathlib import Path from pathlib import Path

View File

@ -1,3 +1,8 @@
"""
Geometry helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import math import math
import numpy as np import numpy as np

View File

@ -1,3 +1,8 @@
"""
PhysicsFactory retrieve the specific physics module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from physics.physics_feeders.us_new_york_city_physics_parameters import UsNewYorkCityPhysicsParameters from physics.physics_feeders.us_new_york_city_physics_parameters import UsNewYorkCityPhysicsParameters
from physics.physics_feeders.us_physics_parameters import UsPhysicsParameters from physics.physics_feeders.us_physics_parameters import UsPhysicsParameters

View File

@ -1,3 +1,10 @@
"""
UsPlutoToFunction helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class UsPlutoToFunction: class UsPlutoToFunction:
building_function = { building_function = {
'A0': 'single family house', 'A0': 'single family house',

View File

@ -1,3 +1,10 @@
"""
UsToLibraryTypes helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class UsToLibraryTypes(object): class UsToLibraryTypes(object):
standards = { standards = {
'ASHRAE Std189': 1, 'ASHRAE Std189': 1,

View File

@ -1,3 +1,9 @@
"""
UsBasePhysicParameters, model the us archetypes and material, used by UsNewYorkCityPhysicsParameters and
UsPhysicsParameters as base class
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict import xmltodict
from city_model_structure.layer import Layer from city_model_structure.layer import Layer
from city_model_structure.material import Material from city_model_structure.material import Material

View File

@ -1,3 +1,8 @@
"""
UsNewYorkCityPhysicsParameters import the construction and material information for new york city
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from physics.physics_feeders.us_base_physics_parameters import UsBasePhysicsParameters from physics.physics_feeders.us_base_physics_parameters import UsBasePhysicsParameters
from physics.physics_feeders.helpers.us_pluto_to_function import UsPlutoToFunction as Pf from physics.physics_feeders.helpers.us_pluto_to_function import UsPlutoToFunction as Pf

View File

@ -1,3 +1,8 @@
"""
UsPhysicsParameters import the construction and material information for US
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from physics.physics_feeders.us_base_physics_parameters import UsBasePhysicsParameters from physics.physics_feeders.us_base_physics_parameters import UsBasePhysicsParameters
from physics.physics_feeders.helpers.us_to_library_types import UsToLibraryTypes from physics.physics_feeders.helpers.us_to_library_types import UsToLibraryTypes
@ -7,4 +12,3 @@ class UsPhysicsParameters(UsBasePhysicsParameters):
self._city = city self._city = city
self._climate_zone = UsToLibraryTypes.city_to_climate_zone(city.name) self._climate_zone = UsToLibraryTypes.city_to_climate_zone(city.name)
super().__init__(self._climate_zone, self._city.city_objects, lambda function: function, base_path) super().__init__(self._climate_zone, self._city.city_objects, lambda function: function, base_path)

View File

@ -1,3 +1,8 @@
"""
TestGeometryFactory test and validate the city model structure geometric parameters
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from unittest import TestCase from unittest import TestCase
from pathlib import Path from pathlib import Path
from geometry.geometry_factory import GeometryFactory from geometry.geometry_factory import GeometryFactory

View File

@ -1,3 +1,8 @@
"""
TestPhysicsFactory test and validate the city model structure physics parameters
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from unittest import TestCase from unittest import TestCase
from pathlib import Path from pathlib import Path
from geometry.geometry_factory import GeometryFactory from geometry.geometry_factory import GeometryFactory

View File

@ -1,3 +1,8 @@
"""
UsageFactory retrieve the specific usage module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from usage.usage_feeders.de_usage_parameters import DeUsageParameters from usage.usage_feeders.de_usage_parameters import DeUsageParameters
from usage.usage_feeders.us_new_york_city_usage_parameters import UsNewYorkCityUsageParameters from usage.usage_feeders.us_new_york_city_usage_parameters import UsNewYorkCityUsageParameters

View File

@ -1,3 +1,8 @@
"""
DeUsageParameters model the usage properties for a German building
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict import xmltodict
from pathlib import Path from pathlib import Path
from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage
@ -7,7 +12,7 @@ class DeUsageParameters:
def __init__(self, city_objects): def __init__(self, city_objects):
self._city_objects = city_objects self._city_objects = city_objects
# load US Library # load De Library
path = str(Path.cwd() / 'data/usage/de_library.xml') path = str(Path.cwd() / 'data/usage/de_library.xml')
with open(path) as xml: with open(path) as xml:
self._library = xmltodict.parse(xml.read()) self._library = xmltodict.parse(xml.read())

View File

@ -1,3 +1,10 @@
"""
UsFunctionToUsage helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class UsFunctionToUsage: class UsFunctionToUsage:
building_usage = { building_usage = {
'full service restaurant': 'restaurant', 'full service restaurant': 'restaurant',

View File

@ -1,3 +1,8 @@
"""
UsPlutoToUsage helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage

View File

@ -1,3 +1,8 @@
"""
UsBaseUsageParameters base class to model the usage properties for a building in NYC and US
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict import xmltodict
from pathlib import Path from pathlib import Path
from city_model_structure.usage_zone import UsageZone from city_model_structure.usage_zone import UsageZone

View File

@ -1,3 +1,8 @@
"""
UsNewYorkCityUsageParameters model the usage properties for a NYC building
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from usage.usage_feeders.us_base_usage_parameters import UsBaseUsageParameters from usage.usage_feeders.us_base_usage_parameters import UsBaseUsageParameters
from usage.usage_feeders.helpers.us_pluto_to_usage import UsPlutoToUsage as Pu from usage.usage_feeders.helpers.us_pluto_to_usage import UsPlutoToUsage as Pu

View File

@ -1,3 +1,8 @@
"""
UsUsageParameters model the usage properties for a Us building
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from usage.usage_feeders.us_base_usage_parameters import UsBaseUsageParameters from usage.usage_feeders.us_base_usage_parameters import UsBaseUsageParameters
from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage from usage.usage_feeders.helpers.us_function_to_usage import UsFunctionToUsage