Common

This submodule stores some common utility functions used in the Qimchi Dash app.

qimchi.components.utils.common.read_data(sess_id: str, src: str) Dataset[source]

Utility function to read data into a xarray.Dataset

Parameters:
  • sess_id (str) – Session ID to load the state for

  • src (str) – Source of the read_data call. For debugging purposes.

Returns:

Loaded xarray dataset

Return type:

xr.Dataset

qimchi.components.utils.common.format_number(value: float, default_precision: float = 3) str[source]

Format a number with scientific notation if it is too small or too large. Otherwise, format it with a default precision.

Parameters:
  • value (float) – The number to format.

  • default_precision (int) – The default number of decimal places to use.

Returns:

The formatted number as a string.

Return type:

str