def test_02_04_EncapsulateStructInCell(self): struct = numpy.ndarray((1, 1), dtype=[('foo', object)]) cell = numpy.ndarray((1, 1), dtype=object) cell[0, 0] = struct struct['foo'][0, 0] = u'Hello, world' u.encapsulate_strings_in_arrays(cell) self.assertTrue(isinstance(struct['foo'][0, 0], numpy.ndarray)) self.assertTrue(struct['foo'][0, 0][0] == u'Hello, world')
def test_02_04_EncapsulateStructInCell(self): struct = numpy.ndarray((1,1),dtype=[('foo',object)]) cell = numpy.ndarray((1,1),dtype=object) cell[0,0] = struct struct['foo'][0,0] = u'Hello, world' u.encapsulate_strings_in_arrays(cell) self.assertTrue(isinstance(struct['foo'][0,0],numpy.ndarray)) self.assertTrue(struct['foo'][0,0][0] == u'Hello, world')
def test_02_03_EncapsulateCellInStruct(self): struct = numpy.ndarray((1, 1), dtype=[("foo", object)]) cell = numpy.ndarray((1, 1), dtype=object) cell[0, 0] = u"Hello, world" struct["foo"][0, 0] = cell u.encapsulate_strings_in_arrays(struct) self.assertTrue(isinstance(cell[0, 0], numpy.ndarray)) self.assertTrue(cell[0, 0][0] == u"Hello, world")
def test_02_01_EncapsulateCell(self): cell = numpy.ndarray((1, 1), dtype=object) cell[0, 0] = u'Hello, world' u.encapsulate_strings_in_arrays(cell) self.assertTrue(isinstance(cell[0, 0], numpy.ndarray)) self.assertTrue(cell[0, 0][0] == u'Hello, world')
def test_02_01_EncapsulateCell(self): cell = numpy.ndarray((1,1),dtype=object) cell[0,0] = u'Hello, world' u.encapsulate_strings_in_arrays(cell) self.assertTrue(isinstance(cell[0,0],numpy.ndarray)) self.assertTrue(cell[0,0][0] == u'Hello, world')