kwave.utils.data module

get_date_string()[source]
Return type:

str

get_smallest_possible_type(max_array_val, target_type_group, default=None)[source]

Returns the smallest possible type for the given array. :param max_array_val: The maximum value in the array. :param target_type_group: The type group to search for the smallest possible type. :param default: The default type to return if no type is found.

Returns:

The smallest possible type for the given array.

Parameters:
  • max_array_val (int | float | complex | number | Vector)

  • target_type_group (str)

  • default (str | None)

Return type:

str | None

intmax(dtype)[source]

Returns the maximum value for the given integer type.

Parameters:

dtype (str) – The integer type.

Return type:

int

Returns

The maximum value for the given integer type.

scale_SI(x)[source]

Scale a number to the nearest SI unit prefix.

Parameters:

x (float | ndarray) – The number to scale.

Returns:

A tuple containing a string of the scaled number, a numeric scaling factor, the prefix, and the unit.

Return type:

tuple[str, int | float, str, str]

scale_time(seconds)[source]

Converts an integer number of seconds into hours, minutes, and seconds, and returns a string with this information.

Parameters:

seconds (int | float) – number of seconds

Returns:

String of scaled time.

Return type:

str