diff --git a/main.py b/main.py index 0b261b1..18794d7 100644 --- a/main.py +++ b/main.py @@ -27,9 +27,9 @@ from energy_systems_sizing import EnergySystemsSizing from life_cycle_costs import LifeCycleCosts -def _npv_from_list(discount_rate, list_cashflow): - lcc_value = np.npv(discount_rate,list_cashflow) - raise KeyError('bad inputs') +def _npv_from_list(npv_discount_rate, list_cashflow): + lcc_value = np.npv(npv_discount_rate, list_cashflow) + return lcc_value def _search_archetype(costs_catalog, building_function): costs_archetypes = costs_catalog.entries('archetypes').archetypes @@ -154,8 +154,8 @@ for retrofitting_scenario in retrofitting_scenarios: lcc.calculate_total_operational_costs()['PV_maintenance'] df_operational_incomes = lcc.calculate_total_operational_incomes()['Incomes electricity'] - life_cycle_costs_capital_skin=_npv_from_list(discount_rate , df_capital_costs_skin.values.tolist()) - life_cycle_costs_capital_systems=_npv_from_list(discount_rate , df_capital_costs_systems.values.tolist()) + life_cycle_costs_capital_skin = _npv_from_list(discount_rate, df_capital_costs_skin.values.tolist()) + life_cycle_costs_capital_systems = _npv_from_list(discount_rate, df_capital_costs_systems.values.tolist()) life_cycle_costs_end_of_life_costs = _npv_from_list(discount_rate, df_end_of_life_costs.values.tolist()) life_cycle_operational_costs = _npv_from_list(discount_rate, df_operational_costs.values.tolist()) life_cycle_maintenance_costs = _npv_from_list(discount_rate, df_maintenance_costs.values.tolist()) @@ -176,5 +176,6 @@ for retrofitting_scenario in retrofitting_scenarios: 'total_operational_costs','total_maintenance_costs','life_cycle_costs', 'maintenance_costs'] - life_cycle_results.to_excel(Path(__file__).parent/'out_files'/f'Results{building.name}.xlsx', index=True) + +#life_cycle_results.to_excel(Path(__file__).parent/'out_files'/f'Results{building.name}.xlsx', index=True)