idmtools_platform_local.cli.utils module

idmtools local platform cli utils.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

idmtools_platform_local.cli.utils.get_service_info(service_manger: DockerServiceManager, diff: bool, logs: bool) str

Get info about services for statusing.

Parameters:
  • service_manger – Service manager to use

  • diff – Should we run a diff on the container.

  • logs – Should logs be used

Returns:

Local platform container info.

idmtools_platform_local.cli.utils.colorize_status(status: Status) str

Colorizes a status for the console.

Parameters:

status (Status) – Status to colorize

Returns:

Unicode colorized string of the status

Return type:

str

idmtools_platform_local.cli.utils.parent_status_to_progress(status: Dict[Status, int], width: int = 12) str

Convert a status object into a colorized progress bar for the console.

Parameters:
  • status (Dict[Status, int]) – Status dictionary. The dictionary should Status values for keys and the values should be the total number of simulations in the specific status. An example would be {Status.done: 30, Status.created: 1}

  • width (int) – The desired width of the progress bar

Returns:

Progress bar of the status

Return type:

str

idmtools_platform_local.cli.utils.urlize_data_path(path: str) str

URL-ize a data-path so it can be made click-able in the console(if the console supports it).

Parameters:

path (str) – path to urilze

Returns:

Path as URL.

Return type:

str