Skip to content

Commit

Permalink
reorganizing named/classified fetching code so it is more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed May 31, 2024
1 parent acd8746 commit 8752eed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taxtastic/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,11 @@ def species_below(self, tax_id):
return newc

def named(self, no_rank=True):
nodes = self.nodes
names = self.names
s = select(nodes.c.tax_id)
s = s.join(nodes, nodes.c.tax_id == names.c.tax_id)
s = select(names.c.tax_id)
s = s.where(names.c.is_classified)
if not no_rank:
nodes = self.nodes
s = s.join(nodes, nodes.c.tax_id == names.c.tax_id)
s = s.where(nodes.c.rank != 'no_rank')
return [f[0] for f in self.fetchall(s)]

0 comments on commit 8752eed

Please sign in to comment.