Skip to content

Commit 16be67b

Browse files
committed
Review changes: clarify comments.
1 parent 97b20aa commit 16be67b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__grid_mappings.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ def test_mapping_undefined(self):
607607
# TODO: it's not clear why this needs to behave differently from case
608608
# (3.) : possibly, these two should be made consistent.
609609
#
610+
# TODO: *all* these 'mismatch' cases should probably generate warnings,
611+
# except for plain-latlon coords with no grid-mapping.
612+
# At present, we _only_ warn when an expected grid-mapping is absent.
613+
#
610614

611615
def test_mapping__mismatch__latlon_coords_rotated_system(self):
612616
# Rules Triggered:
@@ -694,7 +698,6 @@ def test_mapping__mismatch__rotated_coords_nonll_system(self):
694698
# 006 : fc_build_coordinate_(rotated_longitude)(rotated no-cs : discarded projected cs)
695699
# Notes:
696700
# * coords built : rotated-lat + lon, with no coord-system (see above)
697-
# TODO: should this change ??
698701
result = self.run_testcase(
699702
mapping_type_name=hh.CF_GRID_MAPPING_ALBERS,
700703
xco_name="grid_longitude",

lib/iris/tests/unit/fileformats/nc_load_rules/actions/test__time_coords.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,17 @@ def test_dim_nonmonotonic(self):
317317
self.check_result(result, "aux")
318318

319319
def test_dim_fails_typeident(self):
320-
# The coord variable is identified as a CFDimensionCoordinate by cf.py,
321-
# but having the wrong units causes it to fail the 'is_time' or
322-
# 'is_period' test, so the 'provides_coord' rule fails to trigger.
323-
# So it is built as a 'miscellaneous' dim-coord.
320+
# Provide a coord variable, identified as a CFDimensionCoordinate by
321+
# cf.py, but with the "wrong" units for a time or period coord.
322+
# This causes it to fail both 'is_time' and 'is_period' tests and so,
323+
# within the 'action_provides_coordinate' routine, does not trigger as
324+
# a 'provides_coord_(time[[_period]])' rule, but instead as a
325+
# 'default_coordinate_(provide-phase)'.
326+
# As a result, it is built as a 'miscellaneous' dim-coord.
324327
# N.B. this makes *no* practical difference, because a 'misc' dim
325-
# coord is still a dim coord (albeit one with bad units).
326-
# ( N.B.#2 Not quite the same for lat/lon coords, where coord-specific
327-
# 'build' rules always use a fixed standard-name ).
328+
# coord is still a dim coord (albeit one with incorrect units).
329+
# N.B.#2 that is different from lat/lon coords, where the coord-specific
330+
# 'build' rules have the extra effect of setting a fixed standard-name.
328331
#
329332
# Rules Triggered:
330333
# 001 : fc_default

0 commit comments

Comments
 (0)