Skip to content

Commit cbc31c7

Browse files
authored
fix test (#4585)
1 parent 15bd351 commit cbc31c7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# importing anything else.
1414
import iris.tests as tests # isort:skip
1515

16-
import unittest
17-
1816
from cf_units import CALENDAR_360_DAY, CALENDAR_GREGORIAN, Unit
1917
from cftime import datetime as nc_datetime
2018
import numpy as np
@@ -733,7 +731,6 @@ def test_t1_list_t2_scalar(self):
733731

734732

735733
class TestArrayInputWithLBTIM_0_3_1(TestField):
736-
@unittest.skip("#3508 investigate unit test failure")
737734
def test_t1_scalar_t2_list(self):
738735
lbtim = _lbtim(ib=3, ic=1)
739736
lbcode = _lbcode(1)
@@ -756,17 +753,21 @@ def test_t1_scalar_t2_list(self):
756753
)
757754

758755
# Expected coords.
756+
leap_year_adjust = np.array([0, 24, 24])
759757
points = np.ones_like(years) * lbft
760758
bounds = np.array(
761-
[lbft - ((years - 1970) * 365 * 24 + 2 * 24), points]
759+
[
760+
lbft - ((years - 1970) * 365 * 24 + 2 * 24 + leap_year_adjust),
761+
points,
762+
]
762763
).transpose()
763764
fp_coord = AuxCoord(
764765
points,
765766
standard_name="forecast_period",
766767
units="hours",
767768
bounds=bounds,
768769
)
769-
points = (years - 1970) * 365 * 24 + 10 * 24 + 9
770+
points = (years - 1970) * 365 * 24 + 10 * 24 + 9 + leap_year_adjust
770771
bounds = np.array(
771772
[np.ones_like(points) * (8 * 24 + 9), points]
772773
).transpose()

0 commit comments

Comments
 (0)