improver.utilities.round module

Rounding utility

round_close(data, dtype=<class 'numpy.int64'>)[source]

Casts input data to the nearest integer value, where the input data is expected to be very close to the nearest integer.

Parameters:
  • data (Union[float, ndarray]) – Data that is very close to the nearest integer value

  • dtype (Type) – Required integer datatype

Return type:

Union[int, ndarray]

Returns:

Rounded data value

Raises:

ValueError – If rounding would significantly change the input value