def test_set_lazy(self): # Setting new lazy points realises them. coord = DimCoord(self.pts_real) new_pts = self.pts_lazy + 102.3 coord.points = new_pts result = coord.core_points() self.assertEqualRealArraysAndDtypes(result, new_pts.compute())
def test_real_points(self): data = self.pts_real coord = DimCoord(data) result = coord.core_points() self.assertArraysDoNotShareData( result, self.pts_real, 'core_points() are the same data as the internal array.')
def test_real_points(self): # Getting real points returns a copy coord = DimCoord(self.pts_real) result = coord.core_points() self.assertArraysDoNotShareData( result, self.pts_real, 'Points are the same array as the provided data.')
def test_real_points(self): data = self.pts_real coord = DimCoord(data) result = coord.core_points() self.assertArraysShareData( result, self.pts_real, 'core_points() are not the same data as the internal array.')
def test_real_points(self): # Getting real points does not change or copy them. coord = DimCoord(self.pts_real) result = coord.core_points() self.assertArraysShareData( result, self.pts_real, 'Points are not the same array as the provided data.')
def test_set_real(self): # Setting points copies the data coord = DimCoord(self.pts_real) new_pts = self.pts_real + 102.3 coord.points = new_pts result = coord.core_points() self.assertArraysDoNotShareData( result, new_pts, "Points are the same data as the assigned array.")
def test_set_real(self): # Setting points does not copy, but makes a readonly view. coord = DimCoord(self.pts_real) new_pts = self.pts_real + 102.3 coord.points = new_pts result = coord.core_points() self.assertArraysShareData( result, new_pts, 'Points are not the same data as the assigned array.')
def test_set_real(self): # Setting points copies the data coord = DimCoord(self.pts_real) new_pts = self.pts_real + 102.3 coord.points = new_pts result = coord.core_points() self.assertArraysDoNotShareData( result, new_pts, 'Points are the same data as the assigned array.')
def test_lazy_points(self): lazy_data = self.pts_lazy coord = DimCoord(lazy_data) result = coord.core_points() self.assertEqualRealArraysAndDtypes(result, self.pts_real)