def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
Beispiel #2
0
    def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
    def test_copy(self):
        x = [0, 1]
        c = ConnectedRegion(shape=(1,1), value=1, rowptr=[0, 2], colptr=x)
        d = crh.copy(c)

        assert crh.todense(d) == crh.todense(c)
 def test_basic(self):
     assert_array_equal(crh.todense(self.c), self.dense)
     assert_array_equal(crh.todense(crh.copy(self.c)), self.dense)
Beispiel #5
0
    def test_copy(self):
        x = [0, 1]
        c = ConnectedRegion(shape=(1, 1), value=1, rowptr=[0, 2], colptr=x)
        d = crh.copy(c)

        assert crh.todense(d) == crh.todense(c)
Beispiel #6
0
 def test_basic(self):
     assert_array_equal(crh.todense(self.c), self.dense)
     assert_array_equal(crh.todense(crh.copy(self.c)), self.dense)