eogrow.utils.general

A module containing general utilities that haven’t been sorted in any other module

eogrow.utils.general.jsonify(param)[source]

Transforms an object into a normal string.

Parameters:

param (object) –

Return type:

str | list

eogrow.utils.general.convert_to_int(values, raise_diff, error=1e-08)[source]

Converts an array of floats into array of integers.

Parameters:
  • values (ndarray) – An array of float values to be converted.

  • raise_diff (bool) – Raise an error if float values differ from integer values for more than the expected error.

  • error (float) – A joined maximal expected numerical error.

Return type:

ndarray

eogrow.utils.general.convert_bbox_coords_to_int(bbox, error=1e-08)[source]

Converts bounding box coordinates to integers by removing numerical errors. If the difference is larger than a numerical error it raises an error.

Parameters:
  • bbox (BBox) –

  • error (float) –

Return type:

BBox

eogrow.utils.general.large_list_repr(large_list)[source]

Creates a representation of a large list of elements that consists only of a representation of first 3 and the last element.

Parameters:

large_list (list) –

Return type:

str

eogrow.utils.general.current_timestamp(fmt='%Y-%m-%dT%H-%M-%SZ')[source]

Creates a timestamp string of the current time

Parameters:

fmt (str) –

Return type:

str