tests/test_annotation.py
def verify_annotated_tables(self, ts1, ts2, check_alleles=True):
        '''
        Verify that the tables returned after annotation are equal, up to the
        expected forgetting of metadata, flags, and other things.
        '''
        tables1 = ts1.dump_tables()
        tables2 = ts2.dump_tables()
        # compare nodes
        assert np.array_equal(tables1.nodes.flags, tables2.nodes.flags)
        assert np.array_equal(tables1.nodes.time, tables2.nodes.time)
        assert np.array_equal(tables1.nodes.population, tables2.nodes.population)
        # compare edges
        assert tables1.edges == tables2.edges
        # compare sites
        assert np.array_equal(tables1.sites.position, tables2.sites.position)
        if check_alleles:
            assert np.array_equal(tables1.sites.ancestral_state, tables2.sites.ancestral_state)
            assert np.array_equal(tables1.sites.ancestral_state_offset,
                                  tables2.sites.ancestral_state_offset)
        # compare mutations
        assert np.array_equal(tables1.mutations.site, tables2.mutations.site)
        assert np.array_equal(tables1.mutations.node, tables2.mutations.node)
        assert np.array_equal(tables1.mutations.time, tables2.mutations.time)
        if check_alleles:
            assert np.array_equal(tables1.mutations.derived_state, tables2.mutations.derived_state)
            assert np.array_equal(tables1.mutations.derived_state_offset,
                                  tables2.mutations.derived_state_offset)

        Verify that the tables returned after annotation are equal, up to the
        expected forgetting of metadata, flags, and other things.
        
Verify that the tables returned after annotation are equal, up to the
expected forgetting of metadata, flags, and other things.
Verify that the tables returned after annotation are equal up to the expected forgetting of metadata flags and other things .
def verify_annotated_tables(self, ts1, ts2, check_alleles=True):
        tables1 = ts1.dump_tables()
        tables2 = ts2.dump_tables()
        assert np.array_equal(tables1.nodes.flags, tables2.nodes.flags)
        assert np.array_equal(tables1.nodes.time, tables2.nodes.time)
        assert np.array_equal(tables1.nodes.population, tables2.nodes.population)
        assert tables1.edges == tables2.edges
        assert np.array_equal(tables1.sites.position, tables2.sites.position)
        if check_alleles:
            assert np.array_equal(tables1.sites.ancestral_state, tables2.sites.ancestral_state)
            assert np.array_equal(tables1.sites.ancestral_state_offset,
                                  tables2.sites.ancestral_state_offset)
        assert np.array_equal(tables1.mutations.site, tables2.mutations.site)
        assert np.array_equal(tables1.mutations.node, tables2.mutations.node)
        assert np.array_equal(tables1.mutations.time, tables2.mutations.time)
        if check_alleles:
            assert np.array_equal(tables1.mutations.derived_state, tables2.mutations.derived_state)
            assert np.array_equal(tables1.mutations.derived_state_offset,
                                  tables2.mutations.derived_state_offset)
def verify_annotated_tables ( self , ts1 , ts2 , check_alleles = True ) : tables1 = ts1 . dump_tables ( ) tables2 = ts2 . dump_tables ( ) assert np . array_equal ( tables1 . nodes . flags , tables2 . nodes . flags ) assert np . array_equal ( tables1 . nodes . time , tables2 . nodes . time ) assert np . array_equal ( tables1 . nodes . population , tables2 . nodes . population ) assert tables1 . edges == tables2 . edges assert np . array_equal ( tables1 . sites . position , tables2 . sites . position ) if check_alleles : assert np . array_equal ( tables1 . sites . ancestral_state , tables2 . sites . ancestral_state ) assert np . array_equal ( tables1 . sites . ancestral_state_offset , tables2 . sites . ancestral_state_offset ) assert np . array_equal ( tables1 . mutations . site , tables2 . mutations . site ) assert np . array_equal ( tables1 . mutations . node , tables2 . mutations . node ) assert np . array_equal ( tables1 . mutations . time , tables2 . mutations . time ) if check_alleles : assert np . array_equal ( tables1 . mutations . derived_state , tables2 . mutations . derived_state ) assert np . array_equal ( tables1 . mutations . derived_state_offset , tables2 . mutations . derived_state_offset )
Verify that the tables returned after annotation are equal, up to the
expected forgetting of metadata, flags, and other things.
Verify that the tables returned after annotation are equal up to the expected forgetting of metadata flags and other things .
'''
        Verify that the tables returned after annotation are equal, up to the
        expected forgetting of metadata, flags, and other things.
        ''' # compare nodes # compare edges # compare sites # compare mutations
self
ts1
ts2
check_alleles