Skip to content

Commit 8bd7cfb

Browse files
committed
Added a what's new to help reduce possible impact for users.
1 parent c14ec70 commit 8bd7cfb

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ netcdf4-python (http://netcdf4-python.googlecode.com/)
9090
thread-safe build of HDF5 to avoid segmentation faults when using
9191
lazy evaluation.)
9292

93-
cf_units v1.0 or later (https://github.com/SciTools/cf_units)
93+
cf_units v2.0 or later (https://github.com/SciTools/cf_units)
9494
CF data units handling, using udunits.
9595

9696
setuptools v36.0 or later (http://pypi.python.org/pypi/setuptools/)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Iris updated its cf_units dependency to cf_units v2. cf_units 2 is almost entirely backwards compatible,
2+
although the ability to preserve some alias calendars has been removed. For this reason, it is possible
3+
that NetCDF load of a variable with a "standard" calendar will result in a saved NetCDF of a "gregorian"
4+
calendar.

lib/iris/tests/results/nimrod/load_2flds.cml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</attributes>
1111
<coords>
1212
<coord>
13-
<dimCoord id="9c8bdf81" points="[355014.0]" shape="(1,)" standard_name="forecast_reference_time" units="Unit('hours since 1970-01-01 00:00:00', calendar='standard')" value_type="float64"/>
13+
<dimCoord id="9c8bdf81" points="[355014.0]" shape="(1,)" standard_name="forecast_reference_time" units="Unit('hours since 1970-01-01 00:00:00', calendar='gregorian')" value_type="float64"/>
1414
</coord>
1515
<coord>
1616
<dimCoord id="a2cbc1ea" points="[9999.0]" shape="(1,)" standard_name="height" units="Unit('m')" value_type="float32">
@@ -32,7 +32,7 @@
3232
</dimCoord>
3333
</coord>
3434
<coord datadims="[0]">
35-
<dimCoord id="cb784457" points="[355017.0, 363777.0]" shape="(2,)" standard_name="time" units="Unit('hours since 1970-01-01 00:00:00', calendar='standard')" value_type="float64"/>
35+
<dimCoord id="cb784457" points="[355017.0, 363777.0]" shape="(2,)" standard_name="time" units="Unit('hours since 1970-01-01 00:00:00', calendar='gregorian')" value_type="float64"/>
3636
</coord>
3737
</coords>
3838
<cellMethods/>

lib/iris/tests/test_coding_standards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) British Crown Copyright 2013 - 2017, Met Office
1+
# (C) British Crown Copyright 2013 - 2018, Met Office
22
#
33
# This file is part of Iris.
44
#

lib/iris/tests/test_pandas.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) British Crown Copyright 2013 - 2017, Met Office
1+
# (C) British Crown Copyright 2013 - 2018, Met Office
22
#
33
# This file is part of Iris.
44
#
@@ -101,18 +101,22 @@ def test_time_360(self):
101101
time_coord = DimCoord([0, 100.1, 200.2, 300.3, 400.4],
102102
long_name="time", units=time_unit)
103103
cube.add_dim_coord(time_coord, 0)
104-
if netCDF4.__version__ > '1.2.4':
104+
# TODO Remove this if statement as we move to cftime
105+
if cf_units.__version__ > '1':
106+
import cftime
107+
expected_index = [cftime.Datetime360Day(2000, 1, 1, 0, 0),
108+
cftime.Datetime360Day(2000, 4, 11, 2, 24),
109+
cftime.Datetime360Day(2000, 7, 21, 4, 48),
110+
cftime.Datetime360Day(2000, 11, 1, 7, 12),
111+
cftime.Datetime360Day(2001, 2, 11, 9, 36)]
112+
113+
else:
105114
expected_index = [netcdftime.Datetime360Day(2000, 1, 1, 0, 0),
106115
netcdftime.Datetime360Day(2000, 4, 11, 2, 24),
107116
netcdftime.Datetime360Day(2000, 7, 21, 4, 48),
108117
netcdftime.Datetime360Day(2000, 11, 1, 7, 12),
109118
netcdftime.Datetime360Day(2001, 2, 11, 9, 36)]
110-
else:
111-
expected_index = [netcdftime.datetime(2000, 1, 1, 0, 0),
112-
netcdftime.datetime(2000, 4, 11, 2, 24),
113-
netcdftime.datetime(2000, 7, 21, 4, 48),
114-
netcdftime.datetime(2000, 11, 1, 7, 12),
115-
netcdftime.datetime(2001, 2, 11, 9, 36)]
119+
116120
series = iris.pandas.as_series(cube)
117121
self.assertArrayEqual(series, cube.data)
118122
self.assertArrayEqual(series.index, expected_index)
@@ -244,12 +248,16 @@ def test_time_360(self):
244248
time_coord = DimCoord([100.1, 200.2], long_name="time",
245249
units=time_unit)
246250
cube.add_dim_coord(time_coord, 0)
247-
if netCDF4.__version__ > '1.2.4':
251+
# TODO: Remove this if statement once we move to exclusive cftime.
252+
if cf_units.__version__ > '1':
253+
# cf_units depends upon cftime, so we can safely assume we
254+
# have it.
255+
import cftime
256+
expected_index = [cftime.Datetime360Day(2000, 4, 11, 2, 24),
257+
cftime.Datetime360Day(2000, 7, 21, 4, 48)]
258+
else:
248259
expected_index = [netcdftime.Datetime360Day(2000, 4, 11, 2, 24),
249260
netcdftime.Datetime360Day(2000, 7, 21, 4, 48)]
250-
else:
251-
expected_index = [netcdftime.datetime(2000, 4, 11, 2, 24),
252-
netcdftime.datetime(2000, 7, 21, 4, 48)]
253261
expected_columns = [0, 1, 2, 3, 4]
254262
data_frame = iris.pandas.as_data_frame(cube)
255263
self.assertArrayEqual(data_frame, cube.data)

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ exclude = */iris/std_names.py,\
4242
*/iris/tests/test_pp_to_cube.py,\
4343
*/iris/tests/test_quickplot.py,\
4444
*/iris/tests/test_std_names.py,\
45-
*/iris/tests/test_unit.py,\
4645
*/iris/tests/test_uri_callback.py,\
4746
*/iris/tests/test_util.py
4847

0 commit comments

Comments
 (0)