Exemple #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())
Exemple #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.')
Exemple #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.')
Exemple #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.')
Exemple #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())
Exemple #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.')
Exemple #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.')
Exemple #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.')
Exemple #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.")
Exemple #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.')
Exemple #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.')
Exemple #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.')
Exemple #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)
Exemple #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)