def setUp(self):
     self.set_up()
     self.ordered_path = package_paths.data_path(
             os.path.join('posterior-sample.txt.gz'))
     post = parsing.parse_parameters(self.ordered_path)
     self.partition_collection = pymsbayes.utils.stats.PartitionCollection(
             post['taus'])
示例#2
0
def get_partitions_from_posterior_sample_file(file_obj,
                                              integer_partitions=False):
    post = parsing.parse_parameters(file_obj)
    if not 'taus' in post:
        name = getattr(file_obj, 'name', file_obj)
        raise Exception('posterior sample in {0} does not contain a '
                        'divergence time vector'.format(name))
    if integer_partitions:
        return stats.IntegerPartitionCollection(post['taus'])
    return stats.PartitionCollection(post['taus'])
示例#3
0
def get_partitions_from_posterior_sample_file(file_obj,
        integer_partitions = False):
    post = parsing.parse_parameters(file_obj)
    if not 'taus' in post:
        name = getattr(file_obj, 'name', file_obj)
        raise Exception('posterior sample in {0} does not contain a '
                'divergence time vector'.format(name))
    if integer_partitions:
        return stats.IntegerPartitionCollection(post['taus'])
    return stats.PartitionCollection(post['taus'])