Ejemplo n.º 1
0
        def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
            xindex = BlockIndex(TEST_LENGTH, xloc, xlen)
            yindex = BlockIndex(TEST_LENGTH, yloc, ylen)
            bresult = xindex.make_union(yindex)
            assert (isinstance(bresult, BlockIndex))
            assert_equal(bresult.blocs, eloc)
            assert_equal(bresult.blengths, elen)

            ixindex = xindex.to_int_index()
            iyindex = yindex.to_int_index()
            iresult = ixindex.make_union(iyindex)
            assert (isinstance(iresult, IntIndex))
            assert_equal(iresult.indices, bresult.to_int_index().indices)
Ejemplo n.º 2
0
    def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
        xindex = BlockIndex(TEST_LENGTH, xloc, xlen)
        yindex = BlockIndex(TEST_LENGTH, yloc, ylen)
        bresult = xindex.make_union(yindex)
        assert (isinstance(bresult, BlockIndex))
        assert_equal(bresult.blocs, eloc)
        assert_equal(bresult.blengths, elen)

        ixindex = xindex.to_int_index()
        iyindex = yindex.to_int_index()
        iresult = ixindex.make_union(iyindex)
        assert (isinstance(iresult, IntIndex))
        assert_equal(iresult.indices, bresult.to_int_index().indices)
Ejemplo n.º 3
0
        def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
            xindex = BlockIndex(TEST_LENGTH, xloc, xlen)
            yindex = BlockIndex(TEST_LENGTH, yloc, ylen)
            bresult = xindex.make_union(yindex)
            assert (isinstance(bresult, BlockIndex))
            tm.assert_numpy_array_equal(bresult.blocs,
                                        np.array(eloc, dtype=np.int32))
            tm.assert_numpy_array_equal(bresult.blengths,
                                        np.array(elen, dtype=np.int32))

            ixindex = xindex.to_int_index()
            iyindex = yindex.to_int_index()
            iresult = ixindex.make_union(iyindex)
            assert (isinstance(iresult, IntIndex))
            tm.assert_numpy_array_equal(iresult.indices,
                                        bresult.to_int_index().indices)
Ejemplo n.º 4
0
        def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
            xindex = BlockIndex(TEST_LENGTH, xloc, xlen)
            yindex = BlockIndex(TEST_LENGTH, yloc, ylen)
            bresult = xindex.make_union(yindex)
            assert (isinstance(bresult, BlockIndex))
            tm.assert_numpy_array_equal(bresult.blocs,
                                        np.array(eloc, dtype=np.int32))
            tm.assert_numpy_array_equal(bresult.blengths,
                                        np.array(elen, dtype=np.int32))

            ixindex = xindex.to_int_index()
            iyindex = yindex.to_int_index()
            iresult = ixindex.make_union(iyindex)
            assert (isinstance(iresult, IntIndex))
            tm.assert_numpy_array_equal(iresult.indices,
                                        bresult.to_int_index().indices)