Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Python 3 support #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions h3/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, edges=None):

edges = None # Release that memory.

for id, node in self.nodes.iteritems():
for id, node in self.nodes.items():
if node.parent is None:
self.root = node
break
Expand Down Expand Up @@ -88,7 +88,7 @@ def get_leaf_nodes(self):

:returns: A generator of all the leaf nodes in the Tree
"""
for node_id, node in self.nodes.iteritems():
for node_id, node in self.nodes.items():
if not node.children:
yield node.node_id

Expand Down Expand Up @@ -227,7 +227,7 @@ def sort_children_by_radius(self):
for child in self.nodes[node_id].children]
child_size_pair.sort(key=itemgetter(1), reverse=True)
if child_size_pair:
self.nodes[node_id].children = list(zip(*child_size_pair)[0])
self.nodes[node_id].children = list(zip(*child_size_pair))[0]
depth += 1
current_generation = next_generation

Expand All @@ -252,7 +252,7 @@ def sort_children_by_tree_size(self):
for child in self.nodes[node_id].children]
child_size_pair.sort(key=itemgetter(1), reverse=True)
if child_size_pair:
self.nodes[node_id].children = list(zip(*child_size_pair)[0])
self.nodes[node_id].children = list(zip(*child_size_pair))[0]
depth += 1
current_generation = next_generation

Expand Down