Skip to content

Commit

Permalink
Separate functions into modules
Browse files Browse the repository at this point in the history
  • Loading branch information
invisibleroads committed May 28, 2016
1 parent b5cbad3 commit a06cc50
Show file tree
Hide file tree
Showing 19 changed files with 837 additions and 784 deletions.
10 changes: 6 additions & 4 deletions cc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ python.dependencies =
[crosscompute estimate-electricity-cost-by-technology-from-population]
command_template = python estimate_electricity_cost_by_technology_from_population.py
--target_folder {target_folder}
--selected_technologies_text_path {selected_technologies_text_path}

--financing_year {financing_year}
--time_horizon_in_years {time_horizon_in_years}
Expand All @@ -115,8 +116,9 @@ command_template = python estimate_electricity_cost_by_technology_from_populatio

--line_length_adjustment_factor {line_length_adjustment_factor}
--average_distance_between_buildings_in_meters {average_distance_between_buildings_in_meters}
--connection_count_per_thousand_people {connection_count_per_thousand_people}
--peak_hours_of_sun_per_year {peak_hours_of_sun_per_year}

--number_of_people_per_connection {number_of_people_per_connection}
--consumption_per_connection_in_kwh {consumption_per_connection_in_kwh}
--consumption_during_peak_hours_as_percent_of_total_consumption {consumption_during_peak_hours_as_percent_of_total_consumption}
--peak_hours_of_consumption_per_year {peak_hours_of_consumption_per_year}
Expand Down Expand Up @@ -148,7 +150,6 @@ command_template = python estimate_electricity_cost_by_technology_from_populatio
--diesel_mini_grid_lv_connection_maintenance_lm_cost_per_connection_per_year {diesel_mini_grid_lv_connection_maintenance_lm_cost_per_connection_per_year}
--diesel_mini_grid_lv_connection_lifetime_in_years {diesel_mini_grid_lv_connection_lifetime_in_years}

--peak_hours_of_sun_per_year {peak_hours_of_sun_per_year}
--solar_home_system_loss_as_percent_of_total_production {solar_home_system_loss_as_percent_of_total_production}
--solar_home_panel_table_path {solar_home_panel_table_path}
--solar_home_battery_kwh_per_panel_kw {solar_home_battery_kwh_per_panel_kw}
Expand All @@ -159,6 +160,7 @@ command_template = python estimate_electricity_cost_by_technology_from_populatio
--solar_home_balance_maintenance_lm_cost_per_panel_kw_per_year {solar_home_balance_maintenance_lm_cost_per_panel_kw_per_year}
--solar_home_balance_lifetime_in_years {solar_home_balance_lifetime_in_years}

selected_technologies_text_path = datasets/technologies.txt
financing_year = 2016
time_horizon_in_years = 10
discount_rate_as_percent_of_cash_flow_per_year = 10
Expand All @@ -169,8 +171,9 @@ population_growth_as_percent_of_population_per_year = 10

line_length_adjustment_factor = 1.4
average_distance_between_buildings_in_meters = 25
connection_count_per_thousand_people = 120
peak_hours_of_sun_per_year = 1320

number_of_people_per_connection = 8.33
consumption_per_connection_in_kwh = 456
consumption_during_peak_hours_as_percent_of_total_consumption = 40
peak_hours_of_consumption_per_year = 1460
Expand Down Expand Up @@ -202,7 +205,6 @@ diesel_mini_grid_lv_connection_installation_lm_cost_per_connection = 330
diesel_mini_grid_lv_connection_maintenance_lm_cost_per_connection_per_year = 3
diesel_mini_grid_lv_connection_lifetime_in_years = 10

peak_hours_of_sun_per_year = 1320
solar_home_system_loss_as_percent_of_total_production = 35
solar_home_panel_table_path = datasets/example-solar-home-panel-by-capacity.csv
solar_home_battery_kwh_per_panel_kw = 5
Expand Down
4 changes: 2 additions & 2 deletions compute_discounted_cash_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pandas import read_csv

from infrastructure_planning.finance.valuation import (
compute_discounted_cash_flow,
compute_discounted_cash_flow_xxx,
compute_break_even_time,
compute_internal_return_rate)

Expand All @@ -13,7 +13,7 @@ def run(
time_column, value_column,
discount_rate_percent):
time_value_packs = time_value_table[[time_column, value_column]].values
discounted_cash_flow = compute_discounted_cash_flow(
discounted_cash_flow = compute_discounted_cash_flow_xxx(
time_value_packs, discount_rate_percent)
break_even_time = compute_break_even_time(
time_value_packs, discount_rate_percent)
Expand Down
3 changes: 3 additions & 0 deletions datasets/technologies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
grid
diesel_mini_grid
solar_home
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"selected_technologies": "grid diesel_mini_grid solar_home",

"financing_year": 2016,
"time_horizon_in_years": 10,
"discount_rate_as_percent_of_cash_flow_per_year": 10,
Expand All @@ -9,7 +11,7 @@

"line_length_adjustment_factor": 1.4,
"average_distance_between_buildings_in_meters": 25,
"connection_count_per_thousand_people": 120,
"number_of_people_per_connection": 8.33,

"consumption_per_connection_in_kwh": 456,
"consumption_during_peak_hours_as_percent_of_total_consumption": 40,
Expand Down
Loading

0 comments on commit a06cc50

Please sign in to comment.