def test_Region_Bbox(self): R = RegionIndex(555, 2, 5, 3, 7, label='test') x1, x2, y1, y2 = R.get_Bbox() self.assertEqual(x1, (2, 3)) self.assertEqual(x2, (2, 7)) self.assertEqual(y1, (5, 7)) self.assertEqual(y2, (5, 3))
def test_Region_Bbox(self): R = RegionIndex(555, 2, 5, 3, 7, label='test') x1,x2,y1,y2 = R.get_Bbox() self.assertEqual(x1, (2,3)) self.assertEqual(x2, (2,7)) self.assertEqual(y1, (5,7)) self.assertEqual(y2, (5,3))
def test_RegionalAnalysis_InvalidGeometry(self): region = RegionIndex(99, 1, 1, 1, 1, label='test') x = self.D.copy() y = self.D.copy() y.data = np.random.random((2, 3, 4, 5)) with self.assertRaises(ValueError): R = RegionalAnalysis(x, y, region)
def test_Region_Index(self): R = RegionIndex(77, 20., 30., 50., 60., label='TestIndex') self.assertTrue(R.lon is None) self.assertTrue(R.lat is None)
def test_RegionalAnalysis_yNone(self): region = RegionIndex(55, 1, 1, 1, 1, label='test') R = RegionalAnalysis(self.D, None, region) self.assertEqual(R.y, None)
def test_RegionalAnalysis_InvalidY(self): region = RegionIndex(88, 1, 1, 1, 1, label='test') with self.assertRaises(ValueError): R = RegionalAnalysis(self.D, [123.], region)