示例#1
0
 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())
示例#2
0
 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.')
示例#3
0
 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.')
示例#4
0
 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.')
示例#5
0
 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())
示例#6
0
 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.')
示例#7
0
 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.')
示例#8
0
 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.')
示例#9
0
 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.")
示例#10
0
 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.')
示例#11
0
 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.')
示例#12
0
 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.')
示例#13
0
 def test_lazy_points(self):
     lazy_data = self.pts_lazy
     coord = DimCoord(lazy_data)
     result = coord.core_points()
     self.assertEqualRealArraysAndDtypes(result, self.pts_real)
示例#14
0
 def test_lazy_points(self):
     lazy_data = self.pts_lazy
     coord = DimCoord(lazy_data)
     result = coord.core_points()
     self.assertEqualRealArraysAndDtypes(result, self.pts_real)