flame.utils

Functions

change_root(root, to_change)

get_windows_user_path()

is_iterable(obj)

min_max_norm(arr, mini, maxi[, sigma, dtype])

Min-Max normalized given array based on provided 'mini' and 'maxi' If mini and maxi are arrays

on_wsl([version])

set_up_tracking_server(ip, port, direc, log_path)

Set up tracking server by spawning up parallel process.

update_matlab_variables(matlab_eng, ...[, ...])

Sync all of the variables in the provided variable dictionaries

update_yaml_artifact_path(mlrun_direc)

Will search through the provided directory and update the 'artifact_uri' within the yaml files it contains.

flame.utils.min_max_norm(arr: numpy.typing.NDArray, mini: numpy.typing.NDArray | list | int | float, maxi: numpy.typing.NDArray | list | int | float, sigma: float = 1e-20, dtype: numpy.floating.typing.Any | numpy.integer.typing.Any = numpy.float32) numpy.typing.NDArray.typing.Union[numpy.floating, numpy.integer][source]

Min-Max normalized given array based on provided ‘mini’ and ‘maxi’ If mini and maxi are arrays

flame.utils.set_up_tracking_server(ip: str, port: str, direc: str, log_path: str) Popen[source]

Set up tracking server by spawning up parallel process.

Args:
  • ip (str): IP where to host the MLFlow server (reocmmend 127.0.0.1 a.k.a. localhost)

  • port (str): Port at IP where to host the MLFlow server

  • direc (str): The directory where mlflow run data & associated artifacts are stored. Typically ‘mlruns’

  • log_path (str): Path to directory where mlflow server logs will be stored.

Returns:
  • proc (subprocess.Popen): Process where the server is being hosted

flame.utils.update_matlab_variables(matlab_eng: str, variable_dict: dict, skip_missing: bool = False) None[source]

Sync all of the variables in the provided variable dictionaries

Args: - variable_dict (dict): Dictionary of variables to update - skip_missing (bool): Whether to skip variables that are not found in MATLAB engine. DEFAULT: False.

Returns: None. Updates the variables in-place

flame.utils.update_yaml_artifact_path(mlrun_direc: str) None[source]

Will search through the provided directory and update the ‘artifact_uri’ within the yaml files it contains.

This is to fix issues with MLFLOW where absolute paths are used for all artifact URIs.