fixed costs catalog factory
This commit is contained in:
parent
559e56dd71
commit
32d23d6bdd
|
@ -54,35 +54,38 @@ class MontrealCustomCatalog(Catalog):
|
|||
def _get_capital_costs(self, entry):
|
||||
general_chapters = []
|
||||
chapters_titles = CostHelper().chapters_in_lod1
|
||||
shell = entry['B_shell']
|
||||
items_list = []
|
||||
item_type = 'B10_superstructure'
|
||||
item_description = self._item_with_refurbishment_values(entry, item_type)
|
||||
item_description = self._item_with_refurbishment_values(shell, item_type)
|
||||
items_list.append(item_description)
|
||||
for item in entry['B20_envelope']:
|
||||
for item in shell['B20_envelope']:
|
||||
item_type = item
|
||||
item_description = self._item_with_refurbishment_values(entry['B20_envelope'], item_type)
|
||||
item_description = self._item_with_refurbishment_values(shell['B20_envelope'], item_type)
|
||||
items_list.append(item_description)
|
||||
item_type = 'B30_roofing'
|
||||
item_description = self._item_with_refurbishment_values(entry, item_type)
|
||||
item_type = 'B3010_opaque_roof'
|
||||
item_description = self._item_with_refurbishment_values(shell['B30_roofing'], item_type)
|
||||
items_list.append(item_description)
|
||||
general_chapters.append(Chapter('B_shell', items_list))
|
||||
|
||||
items_list = []
|
||||
item_type = 'D301010_photovoltaic_system'
|
||||
item_description = self._item_with_threesome(entry['D30_hvac']['D3010_energy_supply'], item_type)
|
||||
services = entry['D_services']
|
||||
item_description = self._item_with_threesome(services['D30_hvac']['D3010_energy_supply'], item_type)
|
||||
items_list.append(item_description)
|
||||
item_type_list = ['D3020_heat_generating_systems', 'D3030_cooling_generation_systems', 'D3040_distribution_systems',
|
||||
'D3080_other_hvac_ahu']
|
||||
for item_type in item_type_list:
|
||||
item_description = self._item_with_threesome(entry['D30_hvac'], item_type)
|
||||
item_description = self._item_with_threesome(services['D30_hvac'], item_type)
|
||||
items_list.append(item_description)
|
||||
item_type = 'D5020lighting_and_branch_wiring'
|
||||
item_description = self._item_with_threesome(entry['D50_electrical'], item_type)
|
||||
item_type = 'D5020_lighting_and_branch_wiring'
|
||||
item_description = self._item_with_threesome(services['D50_electrical'], item_type)
|
||||
items_list.append(item_description)
|
||||
general_chapters.append(Chapter('D_services', items_list))
|
||||
|
||||
design_allowance = float(entry['Z_allowances_overhead_profit']['Z10_design_allowance']['#text']) / 100
|
||||
overhead_and_profit = float(entry['Z_allowances_overhead_profit']['Z10_overhead_and_profit']['#text']) / 100
|
||||
allowances = entry['Z_allowances_overhead_profit']
|
||||
design_allowance = float(allowances['Z10_design_allowance']['#text']) / 100
|
||||
overhead_and_profit = float(allowances['Z20_overhead_profit']['#text']) / 100
|
||||
_capital_cost = CapitalCost(general_chapters, design_allowance, overhead_and_profit)
|
||||
|
||||
return _capital_cost
|
||||
|
@ -90,17 +93,17 @@ class MontrealCustomCatalog(Catalog):
|
|||
@staticmethod
|
||||
def _get_operational_costs(entry):
|
||||
fuels = []
|
||||
for item in entry['fuels']:
|
||||
fuel_type = item['fuel']['@fuel_type']
|
||||
fuel_variable = float(entry['fuel']['variable']['#text'])
|
||||
fuel_variable_units = float(entry['fuel']['variable']['@cost_unit'])
|
||||
for item in entry['fuels']['fuel']:
|
||||
fuel_type = item['@fuel_type']
|
||||
fuel_variable = float(item['variable']['#text'])
|
||||
fuel_variable_units = item['variable']['@cost_unit']
|
||||
fuel_fixed_monthly = None
|
||||
fuel_fixed_peak = None
|
||||
if fuel_type == 'electricity':
|
||||
fuel_fixed_monthly = float(entry['fuel']['fixed']['fixed_monthly']['#text'])
|
||||
fuel_fixed_peak = float(entry['fuel']['fixed']['fixed_power']['#text']) / 1000
|
||||
fuel_fixed_monthly = float(item['fixed_monthly']['#text'])
|
||||
fuel_fixed_peak = float(item['fixed_power']['#text']) / 1000
|
||||
elif fuel_type == 'gas':
|
||||
fuel_fixed_monthly = float(entry['fuel']['fixed']['fixed_monthly']['#text'])
|
||||
fuel_fixed_monthly = float(item['fixed_monthly']['#text'])
|
||||
fuel = Fuel(fuel_type,
|
||||
fixed_monthly=fuel_fixed_monthly,
|
||||
fixed_power=fuel_fixed_peak,
|
||||
|
@ -110,7 +113,7 @@ class MontrealCustomCatalog(Catalog):
|
|||
heating_equipment_maintenance = float(entry['maintenance']['heating_equipment']['#text']) / 1000
|
||||
cooling_equipment_maintenance = float(entry['maintenance']['cooling_equipment']['#text']) / 1000
|
||||
photovoltaic_system_maintenance = float(entry['maintenance']['photovoltaic_system']['#text'])
|
||||
co2_emissions = float(entry['CO2_cost']['#text'])
|
||||
co2_emissions = float(entry['co2_cost']['#text'])
|
||||
_operational_cost = OperationalCost(fuels,
|
||||
heating_equipment_maintenance,
|
||||
cooling_equipment_maintenance,
|
||||
|
@ -127,14 +130,13 @@ class MontrealCustomCatalog(Catalog):
|
|||
country = archetype['@country']
|
||||
lod = float(archetype['@lod'])
|
||||
currency = archetype['currency']
|
||||
print(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
|
||||
construction = float(archetype['incomes']['subsidies']['construction']['#text'])
|
||||
hvac = float(archetype['incomes']['subsidies']['hvac']['#text'])
|
||||
photovoltaic_system = float(archetype['incomes']['subsidies']['photovoltaic']['#text'])
|
||||
electricity_exports = float(archetype['incomes']['electricity_export']['#text']) / 1000 / 3600
|
||||
reduction_tax = float(archetype['incomes']['tax_reduction']['#text']) / 100
|
||||
income = Income(construction_subsidy=construction,
|
||||
hvac_subsidy=hvac,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<capital_cost>
|
||||
<B_shell>
|
||||
<B10_superstructure>
|
||||
<refurbishment_cost_basement cost_unit="currency/m2"> 0 </refurbishment_cost_basement>
|
||||
<refurbishment_cost cost_unit="currency/m2"> 0 </refurbishment_cost>
|
||||
</B10_superstructure>
|
||||
<B20_envelope>
|
||||
<B2010_opaque_walls>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<D30_hvac>
|
||||
<D3010_energy_supply>
|
||||
<D301010_photovoltaic_system>
|
||||
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
|
||||
<investment_cost cost_unit="currency/m2"> 800 </investment_cost>
|
||||
<reposition cost_unit="currency/m2"> 800 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
|
||||
</D301010_photovoltaic_system>
|
||||
|
@ -51,16 +51,16 @@
|
|||
</D3080_other_hvac_ahu>
|
||||
</D30_hvac>
|
||||
<D50_electrical>
|
||||
<D5020lighting_and_branch_wiring>
|
||||
<refurbishment_cost cost_unit="currency/kW"> 139 </refurbishment_cost>
|
||||
<D5020_lighting_and_branch_wiring>
|
||||
<investment_cost cost_unit="currency/kW"> 139 </investment_cost>
|
||||
<reposition cost_unit="currency/kW"> 139 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
|
||||
</D5020lighting_and_branch_wiring>
|
||||
</D5020_lighting_and_branch_wiring>
|
||||
</D50_electrical>
|
||||
</D_services>
|
||||
<Z_allowances_overhead_profit>
|
||||
<Z10_design_allowance cost_unit="%"> 2.5 </Z10_design_allowance>
|
||||
<Z10_overhead_and_profit cost_unit="%"> 14 </Z10_overhead_and_profit>
|
||||
<Z20_overhead_profit cost_unit="%"> 14 </Z20_overhead_profit>
|
||||
</Z_allowances_overhead_profit>
|
||||
</capital_cost>
|
||||
<operational_cost>
|
||||
|
@ -81,23 +81,21 @@
|
|||
<variable cost_unit="currency/kg"> 0.09 </variable>
|
||||
</fuel>
|
||||
</fuels>
|
||||
<maintenances>
|
||||
<maintenance type="heating_equipment" cost_unit="currency/kW">40</maintenance>
|
||||
<maintenance type="cooling_equipment" cost_unit="currency/kW">40</maintenance>
|
||||
<maintenance type="photovoltaic_system" cost_unit="currency/m2">1</maintenance>
|
||||
</maintenances>
|
||||
<maintenance>
|
||||
<heating_equipment cost_unit="currency/kW">40</heating_equipment>
|
||||
<cooling_equipment cost_unit="currency/kW">40</cooling_equipment>
|
||||
<photovoltaic_system cost_unit="currency/m2">1</photovoltaic_system>
|
||||
</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>
|
||||
<subsidy type="construction" cost_unit="%">2</subsidy>
|
||||
<subsidy type="hvac" cost_unit="%">1.5</subsidy>
|
||||
<subsidy type="photovoltaic" cost_unit="%">3.6</subsidy>
|
||||
<construction cost_unit="%">2</construction>
|
||||
<hvac cost_unit="%">1.5</hvac>
|
||||
<photovoltaic cost_unit="%">3.6</photovoltaic>
|
||||
</subsidies>
|
||||
<energy_exports>
|
||||
<energy_export type="electricity" cost_unit="currency/kWh">0</energy_export>
|
||||
</energy_exports>
|
||||
<electricity_export cost_unit="currency/kWh">0</electricity_export>
|
||||
<tax_reduction cost_unit="%">2</tax_reduction>
|
||||
</incomes>
|
||||
</archetype>
|
||||
|
@ -106,7 +104,7 @@
|
|||
<capital_cost>
|
||||
<B_shell>
|
||||
<B10_superstructure>
|
||||
<refurbishment_cost_basement cost_unit="currency/m2"> 0 </refurbishment_cost_basement>
|
||||
<refurbishment_cost cost_unit="currency/m2"> 0 </refurbishment_cost>
|
||||
</B10_superstructure>
|
||||
<B20_envelope>
|
||||
<B2010_opaque_walls>
|
||||
|
@ -126,7 +124,7 @@
|
|||
<D30_hvac>
|
||||
<D3010_energy_supply>
|
||||
<D301010_photovoltaic_system>
|
||||
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
|
||||
<investment_cost cost_unit="currency/m2"> 800 </investment_cost>
|
||||
<reposition cost_unit="currency/m2"> 800 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
|
||||
</D301010_photovoltaic_system>
|
||||
|
@ -142,7 +140,7 @@
|
|||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</D3030_cooling_generation_systems>
|
||||
<D3040_distribution_systems>
|
||||
<refurbishment_cost cost_unit="currency/m2"> 0 </refurbishment_cost>
|
||||
<investment_cost cost_unit="currency/m2"> 0 </investment_cost>
|
||||
<reposition cost_unit="currency/kW"> 0 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
|
||||
</D3040_distribution_systems>
|
||||
|
@ -154,7 +152,7 @@
|
|||
</D30_hvac>
|
||||
<D50_electrical>
|
||||
<D5020_lighting_and_branch_wiring>
|
||||
<refurbishment_cost cost_unit="currency/kW"> 139 </refurbishment_cost>
|
||||
<investment_cost cost_unit="currency/kW"> 139 </investment_cost>
|
||||
<reposition cost_unit="currency/kW"> 139 </reposition>
|
||||
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
|
||||
</D5020_lighting_and_branch_wiring>
|
||||
|
@ -166,38 +164,38 @@
|
|||
</Z_allowances_overhead_profit>
|
||||
</capital_cost>
|
||||
<operational_cost>
|
||||
<fuel fuel_type="electricity">
|
||||
<fixed_monthly cost_unit="currency/month"> 12.27 </fixed_monthly>
|
||||
<fixed_power cost_unit="currency/(month*kW)"> 0 </fixed_power>
|
||||
<variable cost_unit="currency/kWh"> 0.075 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="gas">
|
||||
<fixed_monthly cost_unit="currency/month"> 17.71 </fixed_monthly>
|
||||
<variable cost_unit="currency/m3"> 0.640 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="diesel">
|
||||
<variable cost_unit="currency/l"> 1.2 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="biomass">
|
||||
<variable cost_unit="currency/kg"> 0.09 </variable>
|
||||
</fuel>
|
||||
<maintenances>
|
||||
<maintenance type="heating_equipment" cost_unit="currency/kW">40</maintenance>
|
||||
<maintenance type="cooling_equipment" cost_unit="currency/kW">40</maintenance>
|
||||
<maintenance type="photovoltaic_system" cost_unit="currency/m2">1</maintenance>
|
||||
</maintenances>
|
||||
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
|
||||
<fuels>
|
||||
<fuel fuel_type="electricity">
|
||||
<fixed_monthly cost_unit="currency/month"> 12.27 </fixed_monthly>
|
||||
<fixed_power cost_unit="currency/(month*kW)"> 0 </fixed_power>
|
||||
<variable cost_unit="currency/kWh"> 0.075 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="gas">
|
||||
<fixed_monthly cost_unit="currency/month"> 17.71 </fixed_monthly>
|
||||
<variable cost_unit="currency/m3"> 0.640 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="diesel">
|
||||
<variable cost_unit="currency/l"> 1.2 </variable>
|
||||
</fuel>
|
||||
<fuel fuel_type="biomass">
|
||||
<variable cost_unit="currency/kg"> 0.09 </variable>
|
||||
</fuel>
|
||||
</fuels>
|
||||
<maintenance>
|
||||
<heating_equipment cost_unit="currency/kW">40</heating_equipment>
|
||||
<cooling_equipment cost_unit="currency/kW">40</cooling_equipment>
|
||||
<photovoltaic_system cost_unit="currency/m2">1</photovoltaic_system>
|
||||
</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>
|
||||
<subsidy type="construction" cost_unit="%">2</subsidy>
|
||||
<subsidy type="hvac" cost_unit="%">1.5</subsidy>
|
||||
<subsidy type="photovoltaic" cost_unit="%">3.6</subsidy>
|
||||
<construction cost_unit="%">2</construction>
|
||||
<hvac cost_unit="%">1.5</hvac>
|
||||
<photovoltaic cost_unit="%">3.6</photovoltaic>
|
||||
</subsidies>
|
||||
<energy_exports>
|
||||
<energy_export type="electricity" cost_unit="currency/kWh">0</energy_export>
|
||||
</energy_exports>
|
||||
<electricity_export cost_unit="currency/kWh">0</electricity_export>
|
||||
<tax_reduction cost_unit="%">2</tax_reduction>
|
||||
</incomes>
|
||||
</archetype>
|
||||
|
|
|
@ -17,7 +17,7 @@ class TestCostsCatalog(TestCase):
|
|||
catalog_categories = catalog.names()
|
||||
self.assertIsNotNone(catalog, 'catalog is none')
|
||||
content = catalog.entries()
|
||||
self.assertTrue(len(content.archetypes) == 1)
|
||||
self.assertTrue(len(content.archetypes) == 2)
|
||||
|
||||
# retrieving all the entries should not raise any exceptions
|
||||
for category in catalog_categories:
|
||||
|
|
Loading…
Reference in New Issue
Block a user