mloq._utils
Contents
mloq._utils
#
This module contains some utilities that are not currently used.
Module Contents#
Functions#
|
Compare two directories recursively. Files in each directory are assumed to be equal if their names and contents are equal. |
|
Compare the content of two files. |
|
List all the files generated in the last mloq run. |
List all the directories generated in the last mloq run. |
|
|
Check if the provided paths exist. |
|
Return the highest python version defined for the project. |
|
Write setup config in a yaml file. |
Return a dictionary containing all the MLOQ setup config values set to None. |
- mloq._utils.dir_trees_are_equal(dir1, dir2)[source]#
Compare two directories recursively. Files in each directory are assumed to be equal if their names and contents are equal.
@param dir1: First directory path @param dir2: Second directory path
- @return: True if the directory trees are the same and
there were no errors while accessing the directories or files, False otherwise.
- Parameters
dir1 (Union[str, pathlib.Path]) –
dir2 (Union[str, pathlib.Path]) –
- Return type
bool
- mloq._utils.files_are_equal(path1, path2)[source]#
Compare the content of two files.
Compare two incoming files. They are assumed equal if their contents are the same.
- Parameters
path1 (Union[str, pathlib.Path]) – Path containing the first file to be compared.
path2 (Union[str, pathlib.Path]) – Path containing the second file to be compared.
- Returns
- It returns True if the two given files are equal and no errors
have arisen during the process. False otherwise.
- Return type
bool
- mloq._utils.get_generated_files(path)[source]#
List all the files generated in the last mloq run.
- Parameters
path (Union[str, pathlib.Path]) – path to WHAT_MLOQ_GENERATED.md file.
- Returns
List of Path containing the names of the files generated by mloq.
- Return type
List[pathlib.Path]
- mloq._utils.get_generated_directories(path)[source]#
List all the directories generated in the last mloq run.
- Parameters
path (Union[str, pathlib.Path]) – path to WHAT_MLOQ_GENERATED.md file.
- Returns
List of Path containing the names of the directories generated by mloq.
- Return type
List[pathlib.Path]
- mloq._utils.check_directories_exist(paths)[source]#
Check if the provided paths exist.
- Parameters
paths (List[Union[str, pathlib.Path]]) – List of paths that will be checked
- Returns
True if all the provided paths exist. False otherwise.
- Return type
bool
- mloq._utils.get_docker_python_version(template)[source]#
Return the highest python version defined for the project.
- Parameters
template (omegaconf.DictConfig) –
- Return type
str