Skip to content

Commit

Permalink
Restore functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
invisibleroads committed Oct 30, 2017
1 parent 22dc16f commit 6aa9e8e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
18 changes: 0 additions & 18 deletions cc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ demographic_by_year_table_year_column = Year
demographic_by_year_table_population_column = Population
default_yearly_population_growth_percent = 1.06

python.dependencies =
crosscompute_table
invisibleroads_macros
numpy
pandas
scikit-learn

[crosscompute forecast-electricity-consumption]
command_template = python forecast_electricity_consumption.py
--target_folder {target_folder}
Expand Down Expand Up @@ -79,14 +72,6 @@ electricity_consumption_per_capita_by_year_table_year_column = Year
electricity_consumption_per_capita_by_year_table_consumption_per_capita_column = kWh per Capita
default_yearly_electricity_consumption_growth_percent = 2.4

python.dependencies =
crosscompute_table
invisibleroads_macros
numpy
pandas
scikit-learn
scipy

[crosscompute estimate-electricity-cost-by-technology-from-population]
command_template = python estimate_electricity_cost_by_technology_from_population.py
--target_folder {target_folder}
Expand Down Expand Up @@ -260,9 +245,6 @@ solar_mini_grid_lv_connection_installation_cost_as_percent_of_raw_cost = 0
solar_mini_grid_lv_connection_maintenance_cost_per_year_as_percent_of_raw_cost = 1
solar_mini_grid_lv_connection_lifetime_in_years = 99999999

python.dependencies =
geopy

tool_template_path = templates/estimate-electricity-cost-by-technology-from-population/tool.md
result_template_path = templates/estimate-electricity-cost-by-technology-from-population/result.md

Expand Down
2 changes: 1 addition & 1 deletion estimate_distance_between_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def run(location_geotable):
graph = Graph()
for index, row in location_geotable.iterrows():
graph.add_node(index, {
graph.add_node(index, **{
'lat': row['Latitude'], 'lon': row['Longitude']})
for node1_id in range(min(graph), max(graph)):
for node2_id in range(node1_id + 1, max(graph) + 1):
Expand Down
4 changes: 2 additions & 2 deletions infrastructure_planning/electricity/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def assemble_total_grid_mv_line_network(
nwk = NetworkerRunner(nwk_settings, drafts_folder)
nwk.validate()
msf = nwk.run()
for node_id in msf.nodes_iter():
for node_id in msf.nodes():
if node_id in infrastructure_graph:
continue
# Add fake nodes so we can add edges to fake nodes
longitude, latitude = msf.coords[node_id]
infrastructure_graph.add_node(node_id, {
infrastructure_graph.add_node(node_id, **{
'longitude': longitude, 'latitude': latitude, 'population': 0,
'peak_demand_in_kw': 0})
infrastructure_graph.add_edges_from(msf.edges_iter())
Expand Down
4 changes: 2 additions & 2 deletions infrastructure_planning/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, *args, **kw):
class InfrastructureGraph(Graph):

def cycle_nodes(self):
for node_id, node_d in self.nodes_iter(data=True):
for node_id, node_d in self.nodes(data=True):
if 'name' not in node_d:
continue # We have a fake node
yield node_id, node_d
Expand Down Expand Up @@ -243,7 +243,7 @@ def make_zero_by_year(value_by_year):
def get_graph_from_table(table):
graph = InfrastructureGraph()
for index, row in table.iterrows():
graph.add_node(index, dict(row))
graph.add_node(index, **dict(row))
return graph


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'invisibleroads-macros>=0.7.4',
'matplotlib',
# 'networker',
'networkx',
'networkx<2',
'numpy',
'pandas',
'python-dateutil',
Expand Down

0 comments on commit 6aa9e8e

Please sign in to comment.