Example #1
0
 def test_get_january_with_existing_coord(self):
     """Test january extraction"""
     iris.coord_categorisation.add_month_number(self.cube, 'time')
     sliced = extract_month(self.cube, 1)
     assert_array_equal(
         np.array([1, 1]),
         sliced.coord('month_number').points)
Example #2
0
 def test_bad_month_raises(self):
     """Test january extraction"""
     with self.assertRaises(ValueError):
         extract_month(self.cube, 13)
     with self.assertRaises(ValueError):
         extract_month(self.cube, -1)
Example #3
0
 def test_get_january(self):
     """Test january extraction"""
     sliced = extract_month(self.cube, 1)
     assert_array_equal(np.array([1, 1]),
                        sliced.coord('month_number').points)