Skip to content

Commit

Permalink
Add nc_promote warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Dreyer committed Sep 17, 2015
1 parent 7422702 commit 68b2a60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/iris/fileformats/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,9 @@ def _build(cf_variable):
# yet to be promoted.
promoted.add(cf_name)
not_promoted = ignored.difference(promoted)
else:
_netcdf_promote_warning()


def _reset(self):
"""Reset the attribute touch history of each variable."""
Expand All @@ -1113,3 +1116,12 @@ def _getncattr(dataset, attr, default=None):
except AttributeError:
value = default
return value


def _netcdf_promote_warning():
msg = ('NetCDF default loading behaviour currently does not expose '
'variables which define reference surfaces for dimensionless '
'vertical coordinates as independent Cubes. This behaviour is '
'deprecated in favour of automatic promotion to Cubes. To switch '
'to the new behaviour, set iris.FUTURE.netcdf_promote to True.')
warnings.warn(msg)

0 comments on commit 68b2a60

Please sign in to comment.