forked from s_ranjbar/city_retrofit
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d6c3f3ef67
170
hub/catalog_factories/cost/montreal_custom_catalog.py
Normal file
170
hub/catalog_factories/cost/montreal_custom_catalog.py
Normal file
|
@ -0,0 +1,170 @@
|
|||
"""
|
||||
Cost catalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
import xmltodict
|
||||
from hub.catalog_factories.catalog import Catalog
|
||||
from hub.catalog_factories.data_models.cost.capital_cost import CapitalCost
|
||||
from hub.catalog_factories.data_models.cost.envelope import Envelope
|
||||
from hub.catalog_factories.data_models.cost.systems import Systems
|
||||
from hub.catalog_factories.data_models.cost.hvac import Hvac
|
||||
from hub.catalog_factories.data_models.cost.operational_cost import OperationalCost
|
||||
from hub.catalog_factories.data_models.cost.income import Income
|
||||
from hub.catalog_factories.data_models.cost.archetype import Archetype
|
||||
from hub.catalog_factories.data_models.cost.content import Content
|
||||
|
||||
|
||||
class MontrealCustomCatalog(Catalog):
|
||||
def __init__(self, path):
|
||||
path = str(path / 'montreal_costs.xml')
|
||||
with open(path) as xml:
|
||||
self._archetypes = xmltodict.parse(xml.read(), force_list='archetype')
|
||||
|
||||
# store the full catalog data model in self._content
|
||||
self._content = Content(self._load_archetypes())
|
||||
|
||||
@staticmethod
|
||||
def _get_threesome(entry):
|
||||
_reposition = float(entry['reposition']['#text'])
|
||||
_investment = float(entry['initial_investment']['#text'])
|
||||
_lifetime = float(entry['lifetime_equipment']['#text'])
|
||||
return _reposition, _investment, _lifetime
|
||||
|
||||
def _get_capital_costs(self, entry):
|
||||
structural = float(entry['structural']['#text'])
|
||||
sub_structural = float(entry['sub_structural']['#text'])
|
||||
surface_finish = float(entry['surface_finish']['#text'])
|
||||
engineer = float(entry['engineer']['#text'])
|
||||
opaque_reposition, opaque_initial_investment, opaque_lifetime = \
|
||||
self._get_threesome(entry['envelope']['opaque'])
|
||||
transparent_reposition, transparent_initial_investment, transparent_lifetime = \
|
||||
self._get_threesome(entry['envelope']['transparent'])
|
||||
envelope = Envelope(opaque_reposition,
|
||||
opaque_initial_investment,
|
||||
opaque_lifetime,
|
||||
transparent_reposition,
|
||||
transparent_initial_investment,
|
||||
transparent_lifetime)
|
||||
heating_equipment_reposition, heating_equipment_initial_investment, heating_equipment_lifetime = \
|
||||
self._get_threesome(entry['systems']['hvac']['heating_equipment_cost'])
|
||||
heating_equipment_reposition = heating_equipment_reposition / 1000
|
||||
heating_equipment_initial_investment = heating_equipment_initial_investment / 1000
|
||||
cooling_equipment_reposition, cooling_equipment_initial_investment, cooling_equipment_lifetime = \
|
||||
self._get_threesome(entry['systems']['hvac']['cooling_equipment_cost'])
|
||||
cooling_equipment_reposition = cooling_equipment_reposition / 1000
|
||||
cooling_equipment_initial_investment = cooling_equipment_initial_investment / 1000
|
||||
general_hvac_equipment_reposition, general_hvac_equipment_initial_investment, general_hvac_equipment_lifetime = \
|
||||
self._get_threesome(entry['systems']['hvac']['general_hvac_equipment_cost'])
|
||||
general_hvac_equipment_reposition = general_hvac_equipment_reposition * 3600
|
||||
general_hvac_equipment_initial_investment = general_hvac_equipment_initial_investment * 3600
|
||||
hvac = Hvac(heating_equipment_reposition, heating_equipment_initial_investment, heating_equipment_lifetime,
|
||||
cooling_equipment_reposition, cooling_equipment_initial_investment, cooling_equipment_lifetime,
|
||||
general_hvac_equipment_reposition, general_hvac_equipment_initial_investment,
|
||||
general_hvac_equipment_lifetime)
|
||||
|
||||
photovoltaic_system_reposition, photovoltaic_system_initial_investment, photovoltaic_system_lifetime = \
|
||||
self._get_threesome(entry['systems']['photovoltaic_system'])
|
||||
other_conditioning_systems_reposition, other_conditioning_systems_initial_investment, \
|
||||
other_conditioning_systems_lifetime = self._get_threesome(entry['systems']['other_systems'])
|
||||
lighting_reposition, lighting_initial_investment, lighting_lifetime = \
|
||||
self._get_threesome(entry['systems']['lighting'])
|
||||
systems = Systems(hvac,
|
||||
photovoltaic_system_reposition,
|
||||
photovoltaic_system_initial_investment,
|
||||
photovoltaic_system_lifetime,
|
||||
other_conditioning_systems_reposition,
|
||||
other_conditioning_systems_initial_investment,
|
||||
other_conditioning_systems_lifetime,
|
||||
lighting_reposition,
|
||||
lighting_initial_investment,
|
||||
lighting_lifetime)
|
||||
_capital_cost = CapitalCost(structural,
|
||||
sub_structural,
|
||||
envelope,
|
||||
systems,
|
||||
surface_finish,
|
||||
engineer)
|
||||
|
||||
return _capital_cost
|
||||
|
||||
@staticmethod
|
||||
def _get_operational_costs(entry):
|
||||
fuel_type = entry['fuel']['@fuel_type']
|
||||
fuel_fixed_operational_monthly = float(entry['fuel']['fixed']['fixed_monthly']['#text'])
|
||||
fuel_fixed_operational_peak = float(entry['fuel']['fixed']['fixed_power']['#text']) / 1000
|
||||
fuel_variable_operational = float(entry['fuel']['variable']['#text']) / 1000 / 3600
|
||||
heating_equipment_maintenance = float(entry['maintenance']['heating_equipment']['#text']) / 1000
|
||||
cooling_equipment_maintenance = float(entry['maintenance']['cooling_equipment']['#text']) / 1000
|
||||
general_hvac_equipment_maintenance = float(entry['maintenance']['general_hvac_equipment']['#text']) * 3600
|
||||
photovoltaic_system_maintenance = float(entry['maintenance']['photovoltaic_system']['#text'])
|
||||
other_systems_maintenance = float(entry['maintenance']['other_systems']['#text'])
|
||||
co2_emissions = float(entry['CO2_cost']['#text'])
|
||||
_operational_cost = OperationalCost(fuel_type,
|
||||
fuel_fixed_operational_monthly,
|
||||
fuel_fixed_operational_peak,
|
||||
fuel_variable_operational,
|
||||
heating_equipment_maintenance,
|
||||
cooling_equipment_maintenance,
|
||||
general_hvac_equipment_maintenance,
|
||||
photovoltaic_system_maintenance,
|
||||
other_systems_maintenance,
|
||||
co2_emissions)
|
||||
return _operational_cost
|
||||
|
||||
def _load_archetypes(self):
|
||||
_catalog_archetypes = []
|
||||
archetypes = self._archetypes['archetypes']['archetype']
|
||||
for archetype in archetypes:
|
||||
function = archetype['@function']
|
||||
municipality = archetype['@municipality']
|
||||
currency = archetype['@currency']
|
||||
capital_cost = self._get_capital_costs(archetype['capital_cost'])
|
||||
operational_cost = self._get_operational_costs(archetype['operational_cost'])
|
||||
end_of_life_cost = float(archetype['end_of_life_cost']['#text'])
|
||||
construction = float(archetype['incomes']['subsidies']['construction_subsidy']['#text'])
|
||||
hvac = float(archetype['incomes']['subsidies']['hvac_subsidy']['#text'])
|
||||
photovoltaic_system = float(archetype['incomes']['subsidies']['photovoltaic_subsidy']['#text'])
|
||||
electricity_exports = float(archetype['incomes']['energy_exports']['electricity']['#text']) / 1000 / 3600
|
||||
heat_exports = float(archetype['incomes']['energy_exports']['heat']['#text']) / 1000 / 3600
|
||||
co2 = float(archetype['incomes']['CO2_income']['#text'])
|
||||
income = Income(construction, hvac, photovoltaic_system, electricity_exports, heat_exports, co2)
|
||||
_catalog_archetypes.append(Archetype(function,
|
||||
municipality,
|
||||
currency,
|
||||
capital_cost,
|
||||
operational_cost,
|
||||
end_of_life_cost,
|
||||
income))
|
||||
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
"""
|
||||
Get the catalog elements names
|
||||
:parm: for costs catalog category filter does nothing as there is only one category (archetypes)
|
||||
"""
|
||||
_names = {'archetypes': []}
|
||||
for archetype in self._content.archetypes:
|
||||
_names['archetypes'].append(archetype.name)
|
||||
return _names
|
||||
|
||||
def entries(self, category=None):
|
||||
"""
|
||||
Get the catalog elements
|
||||
:parm: for costs catalog category filter does nothing as there is only one category (archetypes)
|
||||
"""
|
||||
return self._content
|
||||
|
||||
def get_entry(self, name):
|
||||
"""
|
||||
Get one catalog element by names
|
||||
:parm: entry name
|
||||
"""
|
||||
for entry in self._content.archetypes:
|
||||
if entry.name.lower() == name.lower():
|
||||
return entry
|
||||
raise IndexError(f"{name} doesn't exists in the catalog")
|
39
hub/catalog_factories/costs_catalog_factory.py
Normal file
39
hub/catalog_factories/costs_catalog_factory.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
"""
|
||||
Cost catalog publish the life cycle cost
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
from hub.catalog_factories.cost.montreal_custom_catalog import MontrealCustomCatalog
|
||||
|
||||
Catalog = TypeVar('Catalog')
|
||||
|
||||
|
||||
class CostCatalogFactory:
|
||||
"""
|
||||
CostsCatalogFactory class
|
||||
"""
|
||||
def __init__(self, file_type, base_path=None):
|
||||
if base_path is None:
|
||||
base_path = Path(Path(__file__).parent.parent / 'data/costs')
|
||||
self._catalog_type = '_' + file_type.lower()
|
||||
self._path = base_path
|
||||
|
||||
@property
|
||||
def _montreal_custom(self):
|
||||
"""
|
||||
Retrieve Montreal Custom catalog
|
||||
"""
|
||||
return MontrealCustomCatalog(self._path)
|
||||
|
||||
@property
|
||||
def catalog(self) -> Catalog:
|
||||
"""
|
||||
Return a cost catalog
|
||||
:return: CostCatalog
|
||||
"""
|
||||
return getattr(self, self._catalog_type, lambda: None)
|
|
@ -16,7 +16,7 @@ class Content:
|
|||
@property
|
||||
def archetypes(self):
|
||||
"""
|
||||
All archetypes in the catalogUsageZone
|
||||
All archetypes in the catalog
|
||||
"""
|
||||
return self._archetypes
|
||||
|
||||
|
|
85
hub/catalog_factories/data_models/cost/archetype.py
Normal file
85
hub/catalog_factories/data_models/cost/archetype.py
Normal file
|
@ -0,0 +1,85 @@
|
|||
"""
|
||||
Archetype catalog Cost
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
"""
|
||||
|
||||
from hub.catalog_factories.data_models.cost.capital_cost import CapitalCost
|
||||
from hub.catalog_factories.data_models.cost.operational_cost import OperationalCost
|
||||
from hub.catalog_factories.data_models.cost.income import Income
|
||||
|
||||
|
||||
class Archetype:
|
||||
def __init__(self, function, municipality, currency, capital_cost, operational_cost, end_of_life_cost, income):
|
||||
self._function = function
|
||||
self._municipality = municipality
|
||||
self._currency = currency
|
||||
self._capital_cost = capital_cost
|
||||
self._operational_cost = operational_cost
|
||||
self._end_of_life_cost = end_of_life_cost
|
||||
self._income = income
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
Get name
|
||||
:return: string
|
||||
"""
|
||||
return f'{self._municipality}_{self._function}'
|
||||
|
||||
@property
|
||||
def function(self):
|
||||
"""
|
||||
Get function
|
||||
:return: string
|
||||
"""
|
||||
return self._function
|
||||
|
||||
@property
|
||||
def municipality(self):
|
||||
"""
|
||||
Get municipality
|
||||
:return: string
|
||||
"""
|
||||
return self._municipality
|
||||
|
||||
@property
|
||||
def currency(self):
|
||||
"""
|
||||
Get currency
|
||||
:return: string
|
||||
"""
|
||||
return self._currency
|
||||
|
||||
@property
|
||||
def capital_cost(self) -> CapitalCost:
|
||||
"""
|
||||
Get capital cost
|
||||
:return: CapitalCost
|
||||
"""
|
||||
return self._capital_cost
|
||||
|
||||
@property
|
||||
def operational_cost(self) -> OperationalCost:
|
||||
"""
|
||||
Get operational cost
|
||||
:return: OperationalCost
|
||||
"""
|
||||
return self._operational_cost
|
||||
|
||||
@property
|
||||
def end_of_life_cost(self):
|
||||
"""
|
||||
Get end of life cost in given currency
|
||||
:return: float
|
||||
"""
|
||||
return self._end_of_life_cost
|
||||
|
||||
@property
|
||||
def income(self) -> Income:
|
||||
"""
|
||||
Get income
|
||||
:return: Income
|
||||
"""
|
||||
return self._income
|
68
hub/catalog_factories/data_models/cost/capital_cost.py
Normal file
68
hub/catalog_factories/data_models/cost/capital_cost.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
"""
|
||||
Cost catalog CapitalCost
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
from hub.catalog_factories.data_models.cost.envelope import Envelope
|
||||
from hub.catalog_factories.data_models.cost.systems import Systems
|
||||
|
||||
|
||||
class CapitalCost:
|
||||
def __init__(self, structural, sub_structural, envelope, systems, surface_finish, engineer):
|
||||
self._structural = structural
|
||||
self._sub_structural = sub_structural
|
||||
self._envelope = envelope
|
||||
self._systems = systems
|
||||
self._surface_finish = surface_finish
|
||||
self._engineer = engineer
|
||||
|
||||
@property
|
||||
def structural(self):
|
||||
"""
|
||||
Get structural cost per building volume in currency/m3
|
||||
:return: float
|
||||
"""
|
||||
return self._structural
|
||||
|
||||
@property
|
||||
def sub_structural(self):
|
||||
"""
|
||||
Get sub structural cost per building foot-print in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._sub_structural
|
||||
|
||||
@property
|
||||
def envelope(self) -> Envelope:
|
||||
"""
|
||||
Get envelope cost
|
||||
:return: Envelope
|
||||
"""
|
||||
return self._envelope
|
||||
|
||||
@property
|
||||
def systems(self) -> Systems:
|
||||
"""
|
||||
Get systems cost
|
||||
:return: Systems
|
||||
"""
|
||||
return self._systems
|
||||
|
||||
@property
|
||||
def surface_finish(self):
|
||||
"""
|
||||
Get surface finish cost per external surfaces areas in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._surface_finish
|
||||
|
||||
@property
|
||||
def engineer(self):
|
||||
"""
|
||||
Get engineer cost in %
|
||||
:return: float
|
||||
"""
|
||||
return self._engineer
|
19
hub/catalog_factories/data_models/cost/content.py
Normal file
19
hub/catalog_factories/data_models/cost/content.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
"""
|
||||
Cost catalog content
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
|
||||
class Content:
|
||||
def __init__(self, archetypes):
|
||||
self._archetypes = archetypes
|
||||
|
||||
@property
|
||||
def archetypes(self):
|
||||
"""
|
||||
All archetypes in the catalog
|
||||
"""
|
||||
return self._archetypes
|
66
hub/catalog_factories/data_models/cost/envelope.py
Normal file
66
hub/catalog_factories/data_models/cost/envelope.py
Normal file
|
@ -0,0 +1,66 @@
|
|||
"""
|
||||
Envelope costs from Cost catalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
|
||||
class Envelope:
|
||||
def __init__(self, opaque_reposition, opaque_initial_investment, opaque_lifetime,
|
||||
transparent_reposition, transparent_initial_investment, transparent_lifetime):
|
||||
self._opaque_reposition = opaque_reposition
|
||||
self._opaque_initial_investment = opaque_initial_investment
|
||||
self._opaque_lifetime = opaque_lifetime
|
||||
self._transparent_reposition = transparent_reposition
|
||||
self._transparent_initial_investment = transparent_initial_investment
|
||||
self._transparent_lifetime = transparent_lifetime
|
||||
|
||||
@property
|
||||
def opaque_reposition(self):
|
||||
"""
|
||||
Get reposition costs for opaque envelope per area of external opaque surfaces in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._opaque_reposition
|
||||
|
||||
@property
|
||||
def opaque_initial_investment(self):
|
||||
"""
|
||||
Get initial investment for opaque envelope per area of external opaque surfaces in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._opaque_initial_investment
|
||||
|
||||
@property
|
||||
def opaque_lifetime(self):
|
||||
"""
|
||||
Get lifetime of opaque envelope in years
|
||||
:return: float
|
||||
"""
|
||||
return self._opaque_lifetime
|
||||
|
||||
@property
|
||||
def transparent_reposition(self):
|
||||
"""
|
||||
Get reposition costs for transparent envelope per area of windows in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._transparent_reposition
|
||||
|
||||
@property
|
||||
def transparent_initial_investment(self):
|
||||
"""
|
||||
Get initial investment for transparent envelope per area of windows in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._transparent_initial_investment
|
||||
|
||||
@property
|
||||
def transparent_lifetime(self):
|
||||
"""
|
||||
Get lifetime of transparent envelope in years
|
||||
:return: float
|
||||
"""
|
||||
return self._transparent_lifetime
|
96
hub/catalog_factories/data_models/cost/hvac.py
Normal file
96
hub/catalog_factories/data_models/cost/hvac.py
Normal file
|
@ -0,0 +1,96 @@
|
|||
"""
|
||||
Hvac costs
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
|
||||
class Hvac:
|
||||
def __init__(self, heating_equipment_reposition, heating_equipment_initial_investment,
|
||||
heating_equipment_lifetime, cooling_equipment_reposition,
|
||||
cooling_equipment_initial_investment, cooling_equipment_lifetime,
|
||||
general_hvac_equipment_reposition, general_hvac_equipment_initial_investment,
|
||||
general_hvac_equipment_lifetime):
|
||||
|
||||
self._heating_equipment_reposition = heating_equipment_reposition
|
||||
self._heating_equipment_initial_investment = heating_equipment_initial_investment
|
||||
self._heating_equipment_lifetime = heating_equipment_lifetime
|
||||
self._cooling_equipment_reposition = cooling_equipment_reposition
|
||||
self._cooling_equipment_initial_investment = cooling_equipment_initial_investment
|
||||
self._cooling_equipment_lifetime = cooling_equipment_lifetime
|
||||
self._general_hvac_equipment_reposition = general_hvac_equipment_reposition
|
||||
self._general_hvac_equipment_initial_investment = general_hvac_equipment_initial_investment
|
||||
self._general_hvac_equipment_lifetime = general_hvac_equipment_lifetime
|
||||
|
||||
@property
|
||||
def heating_equipment_reposition(self):
|
||||
"""
|
||||
Get reposition costs of heating equipment per peak-load in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._heating_equipment_reposition
|
||||
|
||||
@property
|
||||
def heating_equipment_initial_investment(self):
|
||||
"""
|
||||
Get initial investment costs of heating equipment per peak-load in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._heating_equipment_initial_investment
|
||||
|
||||
@property
|
||||
def heating_equipment_lifetime(self):
|
||||
"""
|
||||
Get lifetime of heating equipment in years
|
||||
:return: float
|
||||
"""
|
||||
return self._heating_equipment_lifetime
|
||||
|
||||
@property
|
||||
def cooling_equipment_reposition(self):
|
||||
"""
|
||||
Get reposition costs of cooling equipment per peak-load in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._cooling_equipment_reposition
|
||||
|
||||
@property
|
||||
def cooling_equipment_initial_investment(self):
|
||||
"""
|
||||
Get initial investment costs of cooling equipment per peak-load in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._cooling_equipment_initial_investment
|
||||
|
||||
@property
|
||||
def cooling_equipment_lifetime(self):
|
||||
"""
|
||||
Get lifetime of cooling equipment in years
|
||||
:return: float
|
||||
"""
|
||||
return self._cooling_equipment_lifetime
|
||||
|
||||
@property
|
||||
def general_hvac_equipment_reposition(self):
|
||||
"""
|
||||
Get reposition costs of general hvac equipment per peak-air-flow in currency/(m3/s)
|
||||
:return: float
|
||||
"""
|
||||
return self._general_hvac_equipment_reposition
|
||||
|
||||
@property
|
||||
def general_hvac_equipment_initial_investment(self):
|
||||
"""
|
||||
Get initial investment costs of cooling equipment per peak-air-flow in currency/(m3/s)
|
||||
:return: float
|
||||
"""
|
||||
return self._general_hvac_equipment_initial_investment
|
||||
|
||||
@property
|
||||
def general_hvac_equipment_lifetime(self):
|
||||
"""
|
||||
Get lifetime of cooling equipment in years
|
||||
:return: float
|
||||
"""
|
||||
return self._general_hvac_equipment_lifetime
|
64
hub/catalog_factories/data_models/cost/income.py
Normal file
64
hub/catalog_factories/data_models/cost/income.py
Normal file
|
@ -0,0 +1,64 @@
|
|||
"""
|
||||
Income from costs catalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
|
||||
class Income:
|
||||
def __init__(self, construction, hvac, photovoltaic_system, electricity_exports, heat_exports, co2):
|
||||
self._construction = construction
|
||||
self._hvac = hvac
|
||||
self._photovoltaic_system = photovoltaic_system
|
||||
self._electricity_exports = electricity_exports
|
||||
self._heat_exports = heat_exports
|
||||
self._co2 = co2
|
||||
|
||||
@property
|
||||
def construction(self):
|
||||
"""
|
||||
Get construction subsidy in % of total investment construction cost
|
||||
:return: float
|
||||
"""
|
||||
return self._construction
|
||||
|
||||
@property
|
||||
def hvac(self):
|
||||
"""
|
||||
Get hvac subsidy in % of total investment HVAC cost
|
||||
:return: float
|
||||
"""
|
||||
return self._hvac
|
||||
|
||||
@property
|
||||
def photovoltaic_system(self):
|
||||
"""
|
||||
Get photovoltaic system subsidy in % of total investment photovoltaic cost
|
||||
:return: float
|
||||
"""
|
||||
return self._photovoltaic_system
|
||||
|
||||
@property
|
||||
def electricity_exports(self):
|
||||
"""
|
||||
Get electricity exports gains in currency/J
|
||||
:return: float
|
||||
"""
|
||||
return self._construction
|
||||
|
||||
@property
|
||||
def heat_exports(self):
|
||||
"""
|
||||
Get heat exports gains in currency/J
|
||||
:return: float
|
||||
"""
|
||||
return self._heat_exports
|
||||
|
||||
@property
|
||||
def co2(self):
|
||||
"""
|
||||
Get co2 income in currency/kg
|
||||
:return: float
|
||||
"""
|
||||
return self._co2
|
104
hub/catalog_factories/data_models/cost/operational_cost.py
Normal file
104
hub/catalog_factories/data_models/cost/operational_cost.py
Normal file
|
@ -0,0 +1,104 @@
|
|||
"""
|
||||
Cost catalog OperationalCost
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
|
||||
class OperationalCost:
|
||||
def __init__(self, fuel_type, fuel_fixed_operational_monthly, fuel_fixed_operational_peak,
|
||||
fuel_variable_operational, heating_equipment_maintenance, cooling_equipment_maintenance,
|
||||
general_hvac_equipment_maintenance, photovoltaic_system_maintenance, other_systems_maintenance,
|
||||
co2_emissions):
|
||||
self._fuel_type = fuel_type
|
||||
self._fuel_fixed_operational_monthly = fuel_fixed_operational_monthly
|
||||
self._fuel_fixed_operational_peak = fuel_fixed_operational_peak
|
||||
self._fuel_variable_operational = fuel_variable_operational
|
||||
self._heating_equipment_maintenance = heating_equipment_maintenance
|
||||
self._cooling_equipment_maintenance = cooling_equipment_maintenance
|
||||
self._general_hvac_equipment_maintenance = general_hvac_equipment_maintenance
|
||||
self._photovoltaic_system_maintenance = photovoltaic_system_maintenance
|
||||
self._other_systems_maintenance = other_systems_maintenance
|
||||
self._co2_emissions = co2_emissions
|
||||
|
||||
@property
|
||||
def fuel_type(self):
|
||||
"""
|
||||
Get fuel type
|
||||
:return: string
|
||||
"""
|
||||
return self._fuel_type
|
||||
|
||||
@property
|
||||
def fuel_fixed_operational_monthly(self):
|
||||
"""
|
||||
Get fuel fixed operational cost in currency/month
|
||||
:return: float
|
||||
"""
|
||||
return self._fuel_fixed_operational_monthly
|
||||
|
||||
@property
|
||||
def fuel_fixed_operational_peak(self):
|
||||
"""
|
||||
Get fuel fixed operational cost per peak power in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._fuel_fixed_operational_peak
|
||||
|
||||
@property
|
||||
def fuel_variable_operational(self):
|
||||
"""
|
||||
Get fuel variable operational cost in currency/J
|
||||
:return: float
|
||||
"""
|
||||
return self._fuel_variable_operational
|
||||
|
||||
@property
|
||||
def heating_equipment_maintenance(self):
|
||||
"""
|
||||
Get heating equipment maintenance cost per peak power in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._heating_equipment_maintenance
|
||||
|
||||
@property
|
||||
def cooling_equipment_maintenance(self):
|
||||
"""
|
||||
Get cooling equipment maintenance cost per peak power in currency/W
|
||||
:return: float
|
||||
"""
|
||||
return self._cooling_equipment_maintenance
|
||||
|
||||
@property
|
||||
def general_hvac_equipment_maintenance(self):
|
||||
"""
|
||||
Get general hvac equipment maintenance cost per peak-air-flow in currency/(m3/s)
|
||||
:return: float
|
||||
"""
|
||||
return self._general_hvac_equipment_maintenance
|
||||
|
||||
@property
|
||||
def photovoltaic_system_maintenance(self):
|
||||
"""
|
||||
Get photovoltaic system maintenance cost per panels area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._photovoltaic_system_maintenance
|
||||
|
||||
@property
|
||||
def other_systems_maintenance(self):
|
||||
"""
|
||||
Get other systems' maintenance cost per building's foot-print area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._other_systems_maintenance
|
||||
|
||||
@property
|
||||
def co2_emissions(self):
|
||||
"""
|
||||
Get CO2 emissions cost in currency/kg
|
||||
:return: float
|
||||
"""
|
||||
return self._co2_emissions
|
106
hub/catalog_factories/data_models/cost/systems.py
Normal file
106
hub/catalog_factories/data_models/cost/systems.py
Normal file
|
@ -0,0 +1,106 @@
|
|||
"""
|
||||
Systems cost catalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
from hub.catalog_factories.data_models.cost.hvac import Hvac
|
||||
|
||||
|
||||
class Systems:
|
||||
def __init__(self, hvac, photovoltaic_system_reposition, photovoltaic_system_initial_investment,
|
||||
photovoltaic_system_lifetime, other_conditioning_systems_reposition,
|
||||
other_conditioning_systems_initial_investment, other_conditioning_systems_lifetime,
|
||||
lighting_reposition, lighting_initial_investment, lighting_lifetime):
|
||||
self._hvac = hvac
|
||||
self._photovoltaic_system_reposition = photovoltaic_system_reposition
|
||||
self._photovoltaic_system_initial_investment = photovoltaic_system_initial_investment
|
||||
self._photovoltaic_system_lifetime = photovoltaic_system_lifetime
|
||||
self._other_conditioning_systems_reposition = other_conditioning_systems_reposition
|
||||
self._other_conditioning_systems_initial_investment = other_conditioning_systems_initial_investment
|
||||
self._other_conditioning_systems_lifetime = other_conditioning_systems_lifetime
|
||||
self._lighting_reposition = lighting_reposition
|
||||
self._lighting_initial_investment = lighting_initial_investment
|
||||
self._lighting_lifetime = lighting_lifetime
|
||||
|
||||
@property
|
||||
def hvac(self) -> Hvac:
|
||||
"""
|
||||
Get hvac capital cost
|
||||
:return: Hvac
|
||||
"""
|
||||
return self._hvac
|
||||
|
||||
@property
|
||||
def photovoltaic_system_reposition(self):
|
||||
"""
|
||||
Get photovoltaic system reposition cost per area of panels in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._photovoltaic_system_reposition
|
||||
|
||||
@property
|
||||
def photovoltaic_system_initial_investment(self):
|
||||
"""
|
||||
Get photovoltaic system initial investment per area of panels in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._photovoltaic_system_initial_investment
|
||||
|
||||
@property
|
||||
def photovoltaic_system_lifetime(self):
|
||||
"""
|
||||
Get photovoltaic system lifetime in years
|
||||
:return: float
|
||||
"""
|
||||
return self._photovoltaic_system_lifetime
|
||||
|
||||
@property
|
||||
def other_conditioning_systems_reposition(self):
|
||||
"""
|
||||
Get other conditioning systems reposition cost per building's foot-print area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._other_conditioning_systems_reposition
|
||||
|
||||
@property
|
||||
def other_conditioning_systems_initial_investment(self):
|
||||
"""
|
||||
Get other conditioning systems initial investment per building's foot-print area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._other_conditioning_systems_initial_investment
|
||||
|
||||
@property
|
||||
def other_conditioning_systems_lifetime(self):
|
||||
"""
|
||||
Get other conditioning systems lifetime in years
|
||||
:return: float
|
||||
"""
|
||||
return self._other_conditioning_systems_lifetime
|
||||
|
||||
@property
|
||||
def lighting_reposition(self):
|
||||
"""
|
||||
Get lighting reposition cost per building's foot-print area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._lighting_reposition
|
||||
|
||||
@property
|
||||
def lighting_initial_investment(self):
|
||||
"""
|
||||
Get lighting initial investment per building's foot-print area in currency/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._lighting_initial_investment
|
||||
|
||||
@property
|
||||
def lighting_lifetime(self):
|
||||
"""
|
||||
Get lighting lifetime in years
|
||||
:return: float
|
||||
"""
|
||||
return self._lighting_lifetime
|
|
@ -13,7 +13,7 @@ from hub.catalog_factories.data_models.usages.thermal_control import ThermalCont
|
|||
|
||||
|
||||
class Usage:
|
||||
def __init__(self, usage,
|
||||
def __init__(self, name,
|
||||
hours_day,
|
||||
days_year,
|
||||
mechanical_air_change,
|
||||
|
@ -22,7 +22,7 @@ class Usage:
|
|||
lighting,
|
||||
appliances,
|
||||
thermal_control):
|
||||
self._name = usage
|
||||
self._name = name
|
||||
self._hours_day = hours_day
|
||||
self._days_year = days_year
|
||||
self._mechanical_air_change = mechanical_air_change
|
||||
|
|
89
hub/data/costs/montreal_costs.xml
Normal file
89
hub/data/costs/montreal_costs.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<archetypes>
|
||||
<archetype function="residential" municipality="montreal" currency="CAD">
|
||||
<capital_cost>
|
||||
<structural cost_unit="currency/m3"> 56 </structural>
|
||||
<sub_structural cost_unit="currency/m2"> 9.8 </sub_structural>
|
||||
<envelope>
|
||||
<opaque>
|
||||
<reposition cost_unit="currency/m2"> 43.4 </reposition>
|
||||
<initial_investment cost_unit="currency/m2"> 36 </initial_investment>
|
||||
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
|
||||
</opaque>
|
||||
<transparent>
|
||||
<reposition cost_unit="currency/m2"> 78 </reposition>
|
||||
<initial_investment cost_unit="currency/m2"> 984.5 </initial_investment>
|
||||
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
|
||||
</transparent>
|
||||
</envelope>
|
||||
<systems>
|
||||
<hvac>
|
||||
<heating_equipment_cost>
|
||||
<initial_investment cost_unit="currency/kW"> 363.5 </initial_investment>
|
||||
<reposition cost_unit="currency/kW"> 363.5 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</heating_equipment_cost>
|
||||
<cooling_equipment_cost>
|
||||
<initial_investment cost_unit="currency/kW"> 363.5 </initial_investment>
|
||||
<reposition cost_unit="currency/kW"> 363.5 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</cooling_equipment_cost>
|
||||
<general_hvac_equipment_cost>
|
||||
<initial_investment cost_unit="currency/(m3/h)"> 363.5 </initial_investment>
|
||||
<reposition cost_unit="currency/(m3/h)"> 363.5 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</general_hvac_equipment_cost>
|
||||
</hvac>
|
||||
<photovoltaic_system>
|
||||
<initial_investment cost_unit="currency/m2"> 17 </initial_investment>
|
||||
<reposition cost_unit="currency/m2"> 17 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</photovoltaic_system>
|
||||
<other_systems>
|
||||
<initial_investment cost_unit="currency/m2"> 365 </initial_investment>
|
||||
<reposition cost_unit="currency/m2"> 365 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</other_systems>
|
||||
<lighting>
|
||||
<initial_investment cost_unit="currency/m2"> 365 </initial_investment>
|
||||
<reposition cost_unit="currency/m2"> 365 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</lighting>
|
||||
</systems>
|
||||
<surface_finish cost_unit="currency/m2"> 88 </surface_finish>
|
||||
<engineer cost_unit="%"> 2.5 </engineer>
|
||||
</capital_cost>
|
||||
<operational_cost>
|
||||
<fuel fuel_type="electricity">
|
||||
<fixed>
|
||||
<fixed_monthly cost_unit="currency/month"> 0 </fixed_monthly>
|
||||
<fixed_power cost_unit="currency/kW"> 0 </fixed_power>
|
||||
</fixed>
|
||||
<variable cost_unit="currency/kWh"> 5.6 </variable>
|
||||
</fuel>
|
||||
<maintenance>
|
||||
<heating_equipment cost_unit="currency/kW"> 40 </heating_equipment>
|
||||
<cooling_equipment cost_unit="currency/kW"> 40 </cooling_equipment>
|
||||
<general_hvac_equipment cost_unit="currency/(m3/h)"> 0.05 </general_hvac_equipment>
|
||||
<photovoltaic_system cost_unit="currency/m2"> 1 </photovoltaic_system>
|
||||
<other_systems cost_unit="currency/m2"> 4.6 </other_systems>
|
||||
</maintenance>
|
||||
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
|
||||
</operational_cost>
|
||||
<end_of_life_cost cost_unit="currency/m2"> 6.3 </end_of_life_cost>
|
||||
<incomes>
|
||||
<subsidies>
|
||||
<construction_subsidy cost_unit="%"> 2 </construction_subsidy>
|
||||
<hvac_subsidy cost_unit="%"> 1.5 </hvac_subsidy>
|
||||
<photovoltaic_subsidy cost_unit="%"> 3.6 </photovoltaic_subsidy>
|
||||
</subsidies>
|
||||
<energy_exports>
|
||||
<electricity cost_unit="currency/kWh"> 0 </electricity>
|
||||
<heat cost_unit="currency/kWh"> 0 </heat>
|
||||
</energy_exports>
|
||||
<tax_reductions>
|
||||
<reductions_taxes cost_unit="%"> 2 </reductions_taxes>
|
||||
</tax_reductions>
|
||||
<CO2_income cost_unit="currency/kgCO2exported"> 0 </CO2_income>
|
||||
</incomes>
|
||||
</archetype>
|
||||
</archetypes>
|
28
hub/unittests/test_costs_catalog.py
Normal file
28
hub/unittests/test_costs_catalog.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
"""
|
||||
TestMontrealCustomCatalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Atiya atiya.atiya@mail.concordia.ca
|
||||
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
from unittest import TestCase
|
||||
from hub.catalog_factories.costs_catalog_factory import CostCatalogFactory
|
||||
|
||||
|
||||
class TestCostsCatalog(TestCase):
|
||||
|
||||
def test_costs_catalog(self):
|
||||
catalog = CostCatalogFactory('montreal_custom').catalog
|
||||
catalog_categories = catalog.names()
|
||||
self.assertIsNotNone(catalog, 'catalog is none')
|
||||
content = catalog.entries()
|
||||
self.assertTrue(len(content.archetypes) == 1)
|
||||
|
||||
# retrieving all the entries should not raise any exceptions
|
||||
for category in catalog_categories:
|
||||
for value in catalog_categories[category]:
|
||||
catalog.get_entry(value)
|
||||
|
||||
with self.assertRaises(IndexError):
|
||||
catalog.get_entry('unknown')
|
Loading…
Reference in New Issue
Block a user