def test_set_lazy(self): # Setting new lazy bounds realises them. coord = DimCoord(self.pts_real, bounds=self.bds_lazy) new_bounds = self.bds_lazy + 102.3 coord.bounds = new_bounds result = coord.core_bounds() self.assertEqualRealArraysAndDtypes(result, new_bounds.compute())
def test_real_bounds(self): coord = DimCoord(self.pts_real, bounds=self.bds_real) result = coord.core_bounds() self.assertArraysDoNotShareData( result, self.bds_real, "core_bounds() are the same data as the internal array.", )
def test_set_real(self): # Setting bounds does not copy, but makes a readonly view. coord = DimCoord(self.pts_real, bounds=self.bds_real) new_bounds = self.bds_real + 102.3 coord.bounds = new_bounds result = coord.core_bounds() self.assertArraysDoNotShareData( result, new_bounds, 'Bounds are the same data as the assigned array.')
def test_set_real(self): # Setting bounds does not copy, but makes a readonly view. coord = DimCoord(self.pts_real, bounds=self.bds_real) new_bounds = self.bds_real + 102.3 coord.bounds = new_bounds result = coord.core_bounds() self.assertArraysShareData( result, new_bounds, 'Bounds are not the same data as the assigned array.')
def test_lazy_bounds(self): coord = DimCoord(self.pts_real, bounds=self.bds_lazy) result = coord.core_bounds() self.assertEqualRealArraysAndDtypes(result, self.bds_real)
def test_no_bounds(self): coord = DimCoord(self.pts_real) result = coord.core_bounds() self.assertIsNone(result)
def test_real_bounds(self): coord = DimCoord(self.pts_real, bounds=self.bds_real) result = coord.core_bounds() self.assertArraysShareData( result, self.bds_real, 'core_bounds() are not the same data as the internal array.')