Skip to content

Commit

Permalink
Renamed sorted_by_idx to _sorted_by_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 2, 2013
1 parent 020b551 commit 30d0dfb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions astrodendro/dendrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from . import pruning
from . import six

def sorted_by_idx(d):

def _sorted_by_idx(d):
return sorted(d, key=lambda s: s.idx)


Expand Down Expand Up @@ -195,7 +196,7 @@ def next_idx():
adjacent = [structures[a].ancestor for a in adjacent]

# Remove duplicates
adjacent = sorted_by_idx(list(set(adjacent)))
adjacent = _sorted_by_idx(list(set(adjacent)))

# What happens next depends on how many unique adjacent structures there are

Expand Down Expand Up @@ -276,7 +277,7 @@ def next_idx():
print("") # newline

# Create trunk from objects with no ancestors
self.trunk = sorted_by_idx([structure for structure in six.itervalues(structures) if structure.parent is None])
self.trunk = _sorted_by_idx([structure for structure in six.itervalues(structures) if structure.parent is None])

# Remove orphan leaves that aren't large enough
leaves_in_trunk = [structure for structure in self.trunk if structure.is_leaf]
Expand Down

0 comments on commit 30d0dfb

Please sign in to comment.