Exemple #1
0
 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())
Exemple #2
0
 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())
Exemple #3
0
 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.",
     )
Exemple #4
0
 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.')
Exemple #5
0
 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.')
Exemple #6
0
 def test_lazy_bounds(self):
     coord = DimCoord(self.pts_real, bounds=self.bds_lazy)
     result = coord.core_bounds()
     self.assertEqualRealArraysAndDtypes(result, self.bds_real)
Exemple #7
0
 def test_no_bounds(self):
     coord = DimCoord(self.pts_real)
     result = coord.core_bounds()
     self.assertIsNone(result)
Exemple #8
0
 def test_lazy_bounds(self):
     coord = DimCoord(self.pts_real, bounds=self.bds_lazy)
     result = coord.core_bounds()
     self.assertEqualRealArraysAndDtypes(result, self.bds_real)
Exemple #9
0
 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.')
Exemple #10
0
 def test_no_bounds(self):
     coord = DimCoord(self.pts_real)
     result = coord.core_bounds()
     self.assertIsNone(result)