nntool.utilsΒΆ

nntool.utils.get_current_time()[source]ΒΆ

get current time in this format: MMDDYYYY/HHMMSS

Returns:

time in the format MMDDYYYY/HHMMSS

Return type:

str

nntool.utils.get_output_path(output_path='./', append_date=True, cache_into_env=True)[source]ΒΆ

Get output path based on environment variable OUTPUT_PATH and NNTOOL_OUTPUT_PATH. The output path is appended with the current time if append_date is True (e.g. /OUTPUT_PATH/xxx/MMDDYYYY/HHMMSS).

Parameters:
  • append_date (bool) – append a children folder with the date time, defaults to True

  • cache_into_env (bool) – whether cache the newly created path into env, defaults to True

Returns:

(output path, current time)

Return type:

tuple[str, str]

nntool.utils.read_toml_file(file_path)[source]ΒΆ

Read a toml file and return the content as a dictionary

Parameters:

file_path (str) – path to the toml file

Returns:

content of the toml file as a dictionary

Return type:

dict