Пример #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)