original_docstring: Populate ancestors and children for the currently selected taxon
docstring: Populate ancestors and children for the currently selected taxon
docstring_tokens: Populate ancestors and children for the currently selected taxon
code: async def load_taxonomy(self):
          """Populate ancestors and children for the currently selected taxon"""
          total_taxa = len(self.selected_taxon.parent_taxa) + len(self.selected_taxon.child_taxa)
  
          # Set up batch loader + event bindings
          if self.loader:
              self.loader.cancel()
          self.loader = TaxonBatchLoader()
          self.start_progress(total_taxa, self.loader)
  
          # Start loading ancestors
          logger.info(f'Taxon: Loading {len(self.selected_taxon.parent_taxa)} ancestors')
          self.taxon_ancestors_label.text = _get_label('Ancestors', self.selected_taxon.parent_taxa)
          self.taxon_ancestors.clear_widgets()
          self.loader.add_batch(self.selected_taxon.ancestor_ids, parent=self.taxon_ancestors)
  
          logger.info(f'Taxon: Loading {len(self.selected_taxon.child_taxa)} children')
          self.taxon_children_label.text = _get_label('Children', self.selected_taxon.child_taxa)
          self.taxon_children.clear_widgets()
          self.loader.add_batch(self.selected_taxon.child_ids, parent=self.taxon_children)
  
          self.loader.start_thread()
code_tokens: async def load_taxonomy ( self ) : total_taxa = len ( self . selected_taxon . parent_taxa ) + len ( self . selected_taxon . child_taxa ) if self . loader : self . loader . cancel ( ) self . loader = TaxonBatchLoader ( ) self . start_progress ( total_taxa , self . loader ) logger . info ( f'Taxon: Loading {len(self.selected_taxon.parent_taxa)} ancestors' ) self . taxon_ancestors_label . text = _get_label ( 'Ancestors' , self . selected_taxon . parent_taxa ) self . taxon_ancestors . clear_widgets ( ) self . loader . add_batch ( self . selected_taxon . ancestor_ids , parent = self . taxon_ancestors ) logger . info ( f'Taxon: Loading {len(self.selected_taxon.child_taxa)} children' ) self . taxon_children_label . text = _get_label ( 'Children' , self . selected_taxon . child_taxa ) self . taxon_children . clear_widgets ( ) self . loader . add_batch ( self . selected_taxon . child_ids , parent = self . taxon_children ) self . loader . start_thread ( )
short_docstring: Populate ancestors and children for the currently selected taxon
short_docstring_tokens: Populate ancestors and children for the currently selected taxon
comment: """Populate ancestors and children for the currently selected taxon"""$SEP$# Set up batch loader + event bindings$SEP$# Start loading ancestors