improver.metadata.check_datatypes module
Utilities for mandatory datatype and units checking
- _is_time_coord(obj)[source]
Checks whether the supplied object is an iris.coords.Coord and has a name that matches a known time coord.
- check_dtype(obj)[source]
Finds the mandatory dtype for obj and checks that it is correctly applied. If obj is a coord, any bounds are checked too.
- check_mandatory_standards(cube)[source]
Checks for mandatory dtype and unit standards on a cube and raises a useful exception if any non-compliance is found.
- Parameters:
cube (
Cube
) – The cube to be checked for conformance with standards.- Raises:
ValueError – If the cube fails to meet any mandatory dtype and units standards
- Return type:
- enforce_dtype(operation, inputs, result)[source]
Ensures that result has not been automatically promoted to float64.
- Parameters:
- Raises:
TypeError – If result.dtype does not match the meta-data standard.
- Return type:
- get_required_dtype(obj)[source]
Returns the appropriate dtype for the supplied object. This includes special dtypes for time coordinates.