def log_prob(tree):
    log_prior_value = check_no_empty_types(tree)
    theta = np.hstack([tree.get_radii(), tree.get_scale_factors()])
    log_prior_value += log_prior(theta)
    if (log_prior_value > (- np.inf)):
        try:
            log_likelihood_value = 0
            for mol in mols:
                radii = (tree.assign_radii(mol.mol) / RADIUS_UNIT)
                scale_factors = tree.assign_scale_factors(mol.mol)
                log_likelihood_value += mol.log_prob(radii, scale_factors)
        except:
            global error_y_trees
            error_y_trees.append(tree)
            print('Warning! Encountered un-anticipated exception!')
            return (- np.inf)
        return (log_prior_value + log_likelihood_value)
    else:
        return log_prior_value
def log_prob(tree):
    log_prior_value = check_no_empty_types(tree)
    theta = np.hstack([tree.get_radii(), tree.get_scale_factors()])
    log_prior_value += log_prior(theta)
    if (log_prior_value > (- np.inf)):
        try:
            log_likelihood_value = 0
            for mol in mols:
                radii = (tree.assign_radii(mol.mol) / RADIUS_UNIT)
                scale_factors = tree.assign_scale_factors(mol.mol)
                log_likelihood_value += mol.log_prob(radii, scale_factors)
        except:
            global error_y_trees
            error_y_trees.append(tree)
            print('Warning! Encountered un-anticipated exception!')
            return (- np.inf)
        return (log_prior_value + log_likelihood_value)
    else:
        return log_prior_value