tests/test_annotation.py
def verify_defaults(self, ts):
        '''
        Verify the default values have been entered into metadata.
        '''
        for m in ts.mutations():
            md = m.metadata
            assert isinstance(md['mutation_list'], list)
            for mdl in md['mutation_list']:
                assert mdl["mutation_type"] == 0
                assert mdl["selection_coeff"] == 0.0
                assert mdl["subpopulation"] == tskit.NULL
        for n in ts.nodes():
            md = n.metadata
            if not n.is_sample():
                assert md is None
            else:
                assert md["is_null"] is False
                assert md["genome_type"] == pyslim.GENOME_TYPE_AUTOSOME
        for ind in ts.individuals():
            md = ind.metadata
            assert np.array_equal(ind.location, [0, 0, 0])
            assert ind.flags == pyslim.INDIVIDUAL_ALIVE
            assert md["sex"] == pyslim.INDIVIDUAL_TYPE_HERMAPHRODITE
            assert md["flags"] == 0
            assert md["pedigree_p1"] == tskit.NULL
            assert md["pedigree_p2"] == tskit.NULL
        for pop in ts.populations():
            md = pop.metadata
            assert md["selfing_fraction"] == 0.0
            assert md["female_cloning_fraction"] == 0.0
            assert md["male_cloning_fraction"] == 0.0
            assert md["sex_ratio"] == 0.0
            assert md["bounds_x0"] == 0.0
            assert md["bounds_x1"] == 1.0
            assert md["bounds_y0"] == 0.0
            assert md["bounds_y1"] == 1.0
            assert md["bounds_z0"] == 0.0
            assert md["bounds_z1"] == 1.0
            assert len(md["migration_records"]) == 0

        Verify the default values have been entered into metadata.
        
Verify the default values have been entered into metadata.
Verify the default values have been entered into metadata .
def verify_defaults(self, ts):
        for m in ts.mutations():
            md = m.metadata
            assert isinstance(md['mutation_list'], list)
            for mdl in md['mutation_list']:
                assert mdl["mutation_type"] == 0
                assert mdl["selection_coeff"] == 0.0
                assert mdl["subpopulation"] == tskit.NULL
        for n in ts.nodes():
            md = n.metadata
            if not n.is_sample():
                assert md is None
            else:
                assert md["is_null"] is False
                assert md["genome_type"] == pyslim.GENOME_TYPE_AUTOSOME
        for ind in ts.individuals():
            md = ind.metadata
            assert np.array_equal(ind.location, [0, 0, 0])
            assert ind.flags == pyslim.INDIVIDUAL_ALIVE
            assert md["sex"] == pyslim.INDIVIDUAL_TYPE_HERMAPHRODITE
            assert md["flags"] == 0
            assert md["pedigree_p1"] == tskit.NULL
            assert md["pedigree_p2"] == tskit.NULL
        for pop in ts.populations():
            md = pop.metadata
            assert md["selfing_fraction"] == 0.0
            assert md["female_cloning_fraction"] == 0.0
            assert md["male_cloning_fraction"] == 0.0
            assert md["sex_ratio"] == 0.0
            assert md["bounds_x0"] == 0.0
            assert md["bounds_x1"] == 1.0
            assert md["bounds_y0"] == 0.0
            assert md["bounds_y1"] == 1.0
            assert md["bounds_z0"] == 0.0
            assert md["bounds_z1"] == 1.0
            assert len(md["migration_records"]) == 0
def verify_defaults ( self , ts ) : for m in ts . mutations ( ) : md = m . metadata assert isinstance ( md [ 'mutation_list' ] , list ) for mdl in md [ 'mutation_list' ] : assert mdl [ "mutation_type" ] == 0 assert mdl [ "selection_coeff" ] == 0.0 assert mdl [ "subpopulation" ] == tskit . NULL for n in ts . nodes ( ) : md = n . metadata if not n . is_sample ( ) : assert md is None else : assert md [ "is_null" ] is False assert md [ "genome_type" ] == pyslim . GENOME_TYPE_AUTOSOME for ind in ts . individuals ( ) : md = ind . metadata assert np . array_equal ( ind . location , [ 0 , 0 , 0 ] ) assert ind . flags == pyslim . INDIVIDUAL_ALIVE assert md [ "sex" ] == pyslim . INDIVIDUAL_TYPE_HERMAPHRODITE assert md [ "flags" ] == 0 assert md [ "pedigree_p1" ] == tskit . NULL assert md [ "pedigree_p2" ] == tskit . NULL for pop in ts . populations ( ) : md = pop . metadata assert md [ "selfing_fraction" ] == 0.0 assert md [ "female_cloning_fraction" ] == 0.0 assert md [ "male_cloning_fraction" ] == 0.0 assert md [ "sex_ratio" ] == 0.0 assert md [ "bounds_x0" ] == 0.0 assert md [ "bounds_x1" ] == 1.0 assert md [ "bounds_y0" ] == 0.0 assert md [ "bounds_y1" ] == 1.0 assert md [ "bounds_z0" ] == 0.0 assert md [ "bounds_z1" ] == 1.0 assert len ( md [ "migration_records" ] ) == 0
Verify the default values have been entered into metadata.
Verify the default values have been entered into metadata .
'''
        Verify the default values have been entered into metadata.
        '''
self
ts