utils
check_make_dirs(paths, verbose=True, isdir=False)
Create base directories for given paths if they do not exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Union[str, Path, List[Union[str, Path]]]
|
A path or list of paths for which to check the basedirectories |
required |
|
bool
|
Whether to log the output path |
True
|
|
bool
|
Treats given path(s) as diretory instead of only checking the basedir. |
False
|
Source code in src/encoders/utils.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
counter(iterable, countevery=100, total=None, logger=logging.getLogger('counter'))
Logs a status and timing update to [logger] every [countevery] draws from [iterable]. If [total] is given, log messages will include the estimated time remaining.
Source code in src/encoders/utils.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
create_run_folder_name(seed=None)
Returns the name of the run folder including a random id and the current date.
Source code in src/encoders/utils.py
81 82 83 84 85 86 87 88 89 90 |
|
get_logger(name=__name__, log_level=logging.INFO, log_file=None)
Initializes command line logger.
Source code in src/encoders/utils.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|