diff --git a/hub/catalog_factories/construction/nrcan_catalog.py b/hub/catalog_factories/construction/nrcan_catalog.py index 1e9d9455..19690b0a 100644 --- a/hub/catalog_factories/construction/nrcan_catalog.py +++ b/hub/catalog_factories/construction/nrcan_catalog.py @@ -122,8 +122,12 @@ class NrcanCatalog(Catalog): average_storey_height = archetype['average_storey_height'] thermal_capacity = float(archetype['thermal_capacity']) * 1000 extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_thermal_bridges'] - infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS - infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS + infiltration_rate_for_ventilation_system_off = ( + archetype['infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS + ) + infiltration_rate_for_ventilation_system_on = ( + archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS + ) archetype_constructions = [] for archetype_construction in archetype['constructions']: diff --git a/hub/catalog_factories/data_models/cost/fuel.py b/hub/catalog_factories/data_models/cost/fuel.py index 79527b62..f785cc59 100644 --- a/hub/catalog_factories/data_models/cost/fuel.py +++ b/hub/catalog_factories/data_models/cost/fuel.py @@ -48,8 +48,7 @@ class Fuel: """ if self._fixed_power is not None: return self._fixed_power/1000 - else: - return None + return None @property def variable(self) -> Union[tuple[None, None], tuple[float, str]]: diff --git a/hub/catalog_factories/data_models/energy_systems/distribution_system.py b/hub/catalog_factories/data_models/energy_systems/distribution_system.py index aa195649..e24ba64c 100644 --- a/hub/catalog_factories/data_models/energy_systems/distribution_system.py +++ b/hub/catalog_factories/data_models/energy_systems/distribution_system.py @@ -10,9 +10,9 @@ class DistributionSystem: """ Distribution system class """ + def __init__(self, system_id, name, system_type, supply_temperature, distribution_consumption_fix_flow, distribution_consumption_variable_flow, heat_losses): - self._system_id = system_id self._name = name self._type = system_type @@ -80,13 +80,15 @@ class DistributionSystem: def to_dictionary(self): """Class content to dictionary""" - content = {'Layer': {'id': self.id, - 'name': self.name, - 'type': self.type, - 'supply temperature [Celsius]': self.supply_temperature, - 'distribution consumption if fix flow over peak power [W/W]': self.distribution_consumption_fix_flow, - 'distribution consumption if variable flow over peak power [J/J]': self.distribution_consumption_variable_flow, - 'heat losses per energy produced [J/J]': self.heat_losses - } - } + content = { + 'Layer': { + 'id': self.id, + 'name': self.name, + 'type': self.type, + 'supply temperature [Celsius]': self.supply_temperature, + 'distribution consumption if fix flow over peak power [W/W]': self.distribution_consumption_fix_flow, + 'distribution consumption if variable flow over peak power [J/J]': self.distribution_consumption_variable_flow, + 'heat losses per energy produced [J/J]': self.heat_losses + } + } return content diff --git a/hub/exports/building_energy/idf.py b/hub/exports/building_energy/idf.py index 57b53074..02de155e 100644 --- a/hub/exports/building_energy/idf.py +++ b/hub/exports/building_energy/idf.py @@ -395,7 +395,9 @@ class Idf: def _add_occupancy(self, thermal_zone, zone_name): number_of_people = thermal_zone.occupancy.occupancy_density * thermal_zone.total_floor_area fraction_radiant = 0 - total_sensible = thermal_zone.occupancy.sensible_radiative_internal_gain + thermal_zone.occupancy.sensible_convective_internal_gain + total_sensible = ( + thermal_zone.occupancy.sensible_radiative_internal_gain + thermal_zone.occupancy.sensible_convective_internal_gain + ) if total_sensible != 0: fraction_radiant = thermal_zone.occupancy.sensible_radiative_internal_gain / total_sensible diff --git a/hub/imports/construction/eilat_physics_parameters.py b/hub/imports/construction/eilat_physics_parameters.py index 51760e03..ea088178 100644 --- a/hub/imports/construction/eilat_physics_parameters.py +++ b/hub/imports/construction/eilat_physics_parameters.py @@ -33,15 +33,15 @@ class EilatPhysicsParameters: eilat_catalog = ConstructionCatalogFactory('eilat').catalog for building in city.buildings: if building.function not in Dictionaries().hub_function_to_eilat_construction_function.keys(): - logging.error(f'Building %s has an unknown building function %s', building.name, building.function) + logging.error('Building %s has an unknown building function %s', building.name, building.function) continue function = Dictionaries().hub_function_to_eilat_construction_function[building.function] try: archetype = self._search_archetype(eilat_catalog, function, building.year_of_construction, self._climate_zone) except KeyError: - logging.error(f'Building %s has unknown construction archetype for building function: %s ' - f'[%s], building year of construction: %s and climate zone %s', building.name, function, + logging.error('Building %s has unknown construction archetype for building function: %s ' + '[%s], building year of construction: %s and climate zone %s', building.name, function, building.function, building.year_of_construction, self._climate_zone) continue thermal_archetype = ThermalArchetype() diff --git a/hub/imports/construction/helpers/construction_helper.py b/hub/imports/construction/helpers/construction_helper.py index 5eb60345..cece5716 100644 --- a/hub/imports/construction/helpers/construction_helper.py +++ b/hub/imports/construction/helpers/construction_helper.py @@ -42,12 +42,7 @@ class ConstructionHelper: 'Varennes': '6', 'Laval': '6', 'Longueuil': '6', - 'Saint-Leonard': '6', - '': '6', - '': '6', - '': '6', - '': '6', - '': '6', + 'Saint-Leonard': '6' } _reference_city_to_israel_climate_zone = { diff --git a/hub/imports/construction/nrcan_physics_parameters.py b/hub/imports/construction/nrcan_physics_parameters.py index b2c40fee..9ab9964c 100644 --- a/hub/imports/construction/nrcan_physics_parameters.py +++ b/hub/imports/construction/nrcan_physics_parameters.py @@ -40,8 +40,8 @@ class NrcanPhysicsParameters: archetype = self._search_archetype(nrcan_catalog, function, building.year_of_construction, self._climate_zone) except KeyError: - logging.error(f'Building %s has unknown construction archetype for building function: %s ' - f'[%s], building year of construction: %s and climate zone %s', building.name, function, + logging.error('Building %s has unknown construction archetype for building function: %s ' + '[%s], building year of construction: %s and climate zone %s', building.name, function, building.function, building.year_of_construction, self._climate_zone) continue thermal_archetype = ThermalArchetype() diff --git a/hub/imports/construction/nrel_physics_parameters.py b/hub/imports/construction/nrel_physics_parameters.py index 8fd2e46f..55b4d3b7 100644 --- a/hub/imports/construction/nrel_physics_parameters.py +++ b/hub/imports/construction/nrel_physics_parameters.py @@ -33,15 +33,15 @@ class NrelPhysicsParameters: nrel_catalog = ConstructionCatalogFactory('nrel').catalog for building in city.buildings: if building.function not in Dictionaries().hub_function_to_nrel_construction_function: - logging.error(f'Building %s has unknown function %s', building.name, building.function) + logging.error('Building %s has unknown function %s', building.name, building.function) continue function = Dictionaries().hub_function_to_nrel_construction_function[building.function] try: archetype = self._search_archetype(nrel_catalog, function, building.year_of_construction, self._climate_zone) except KeyError: - logging.error(f'Building {building.name} has unknown construction archetype for building function: {function} ' - f'[{building.function}], building year of construction: {building.year_of_construction}' - f' and climate zone {self._climate_zone}\n') + logging.error('Building %s has unknown construction archetype for building function: %s ' + '[%s], building year of construction: %s and climate zone %s\n', building.name, function, + building.function, building.year_of_construction, self._climate_zone) continue thermal_archetype = ThermalArchetype()