def make_unifrac_row_metric(weighted, metric, is_symmetric):
 def result(data, taxon_names, tree, sample_names, one_sample_name, **kwargs):
  ' wraps the fast_unifrac fn to return just a matrix, in correct order\n\n            sample_names: list of unique strings\n        '
  envs = make_envs_dict(data, sample_names, taxon_names)
  try:
   unifrac_res = fast_unifrac_one_sample(one_sample_name, tree, envs, weighted=weighted, metric=metric, **kwargs)
  except ValueError as e:
   if ('one_sample_name not found' in str(e)):
    warnings.warn((('unifrac had no information on sample ' + one_sample_name) + ". Distances involving that sample aren't meaningful"))
    unifrac_res = (np.array([0.0]), [one_sample_name])
   else:
    raise e
  dist_mtx = _reorder_unifrac_res_one_sample(unifrac_res, sample_names)
  return dist_mtx
 return result

def make_unifrac_row_metric ( weighted , metric , is_symmetric ) : def result ( data , taxon_names , tree , sample_names , one_sample_name , ** kwargs ) : envs = make_envs_dict ( data , sample_names , taxon_names ) try : unifrac_res = fast_unifrac_one_sample ( one_sample_name , tree , envs , weighted = weighted , metric = metric , ** kwargs ) except ValueError as e : if ( 'one_sample_name not found' in str ( e ) ) : warnings . warn ( ( ( 'unifrac had no information on sample ' + one_sample_name ) + ". Distances involving that sample aren't meaningful" ) ) unifrac_res = ( np . array ( [ 0.0 ] ) , [ one_sample_name ] ) else : raise e dist_mtx = _reorder_unifrac_res_one_sample ( unifrac_res , sample_names ) return dist_mtx return result
make a unifrac-like metric .