original_docstring: Creates initial population of specified size
          
          Args:
              pospool (Dict[str, pd.DataFrame]): pool segmented by position
              posmap (Dict[str, int]): positions & accompanying roster slots
              population_size (int): number of individuals to create
              probcol (str): the dataframe column with probabilities, default 'probs'
              agg (bool): default False. Aggregate multiple crossovers if True.
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the population
  
          
docstring: Creates initial population of specified size
docstring_tokens: Creates initial population of specified size
code: def populate(self,
                   *,
                   pospool: Dict[str, pd.DataFrame] = None,
                   posmap: Dict[str, int] = None,
                   population_size: int = None,
                   probcol: str = 'prob',
                   agg: bool = 'False',
                   **kwargs) -> np.ndarray:
          """Creates initial population of specified size
          
          Args:
              pospool (Dict[str, pd.DataFrame]): pool segmented by position
              posmap (Dict[str, int]): positions & accompanying roster slots
              population_size (int): number of individuals to create
              probcol (str): the dataframe column with probabilities, default 'probs'
              agg (bool): default False. Aggregate multiple crossovers if True.
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the population
  
          """
          logging.debug('{} {} {} {}'.format(pospool, posmap, population_size, probcol))
  
          # combine keyword arguments with **kwargs
          params = locals().copy()
          params.pop('self', None)
          agg = params.pop('agg')
          kwargs = params.pop('kwargs')
  
          # if there is a driver, then use it and run once
          if mgr := self.driver_managers.get('populate'):
              return mgr.driver.populate(**params, **kwargs)
  
          # if agg=True, then aggregate populations
          if agg:
              pops = []
              for ext in self.extension_managers['populate'].extensions:
                  try:
                      pops.append(ext.obj.populate(**params, **kwargs))  
                  except:
                      continue
              return np.concatenate(pops)
  
          # otherwise, run populate using first valid plugin
          for ext in self.extension_managers['crossover'].extensions:
              try:
                  return ext.obj.populate(**kwargs)
              except:
                  continue
code_tokens: def populate ( self , * , pospool : Dict [ str , pd . DataFrame ] = None , posmap : Dict [ str , int ] = None , population_size : int = None , probcol : str = 'prob' , agg : bool = 'False' , ** kwargs ) -> np . ndarray : logging . debug ( '{} {} {} {}' . format ( pospool , posmap , population_size , probcol ) ) params = locals ( ) . copy ( ) params . pop ( 'self' , None ) agg = params . pop ( 'agg' ) kwargs = params . pop ( 'kwargs' ) if mgr := self . driver_managers . get ( 'populate' ) : return mgr . driver . populate ( ** params , ** kwargs ) if agg : pops = [ ] for ext in self . extension_managers [ 'populate' ] . extensions : try : pops . append ( ext . obj . populate ( ** params , ** kwargs ) ) except : continue return np . concatenate ( pops ) for ext in self . extension_managers [ 'crossover' ] . extensions : try : return ext . obj . populate ( ** kwargs ) except : continue
short_docstring: Creates initial population of specified size
short_docstring_tokens: Creates initial population of specified size
comment: """Creates initial population of specified size
          
          Args:
              pospool (Dict[str, pd.DataFrame]): pool segmented by position
              posmap (Dict[str, int]): positions & accompanying roster slots
              population_size (int): number of individuals to create
              probcol (str): the dataframe column with probabilities, default 'probs'
              agg (bool): default False. Aggregate multiple crossovers if True.
              **kwargs: Keyword arguments for plugins (other than default)
  
          Returns:
              np.ndarray: the population
  
          """$SEP$# combine keyword arguments with **kwargs
  $SEP$# if there is a driver, then use it and run once
  $SEP$# if agg=True, then aggregate populations
  $SEP$# otherwise, run populate using first valid plugin
  