honeybee_radiance_postprocess.data_type module

Functions for NumPy data type (dtype).

honeybee_radiance_postprocess.data_type.set_smallest_dtype(array: ndarray, rtol: float = 1e-05, atol: float = 1e-05) ndarray[source]

Return a NumPy array with the smallest possible dtype.

Parameters:
  • array – NumPy array.

  • rtol – The relative tolerance parameter for np.allclose. The default is 1e-5. This is also used if the dtype of the array is np.floating.

  • atol – The absolute tolerance parameter for np.allclose. The default is 1e-5. This is also used if the dtype of the array is np.floating.

Returns:

A new NumPy array with a smaller dtype.

honeybee_radiance_postprocess.data_type.smallest_dtype(array: ndarray, rtol: float = 1e-05, atol: float = 1e-05) Tuple[signedinteger, floating][source]

Return the smallest possible dtype.

Parameters:
  • array – NumPy array.

  • rtol – The relative tolerance parameter for np.allclose. The default is 1e-5. This is also used if the dtype of the array is np.floating.

  • atol – The absolute tolerance parameter for np.allclose. The default is 1e-5. This is also used if the dtype of the array is np.floating.

Returns:

A NumPy dtype.

honeybee_radiance_postprocess.data_type.smallest_float_dtype(array: ndarray, rtol: float = 1e-05, atol: float = 1e-05) floating[source]

Return the smallest possible float dtype.

The allclose function is used to check if a certain floating-point precision can be used without losing accuracy.

Parameters:
  • array – NumPy array.

  • rtol – The relative tolerance parameter for np.allclose. The default is 1e-5.

  • atol – The absolute tolerance parameter for np.allclose. The default is 1e-5.

Returns:

A NumPy floating dtype.

honeybee_radiance_postprocess.data_type.smallest_integer_dtype(array: ndarray) signedinteger[source]

Return the smallest possible integer dtype.

Parameters:

array – NumPy array.

Returns:

A NumPy integer dtype.