namegen
darts_utils.namegen
¶
Random name generator.
generate_counted_name
¶
Generate a random name with a count attached.
The count is calculated by the number of existing directories in the specified artifact directory. The final name is in the format '{somename}-{somesecondname}-{count+1}'.
Parameters:
Returns:
-
str
(str
) –The final name.
Source code in darts-utils/src/darts_utils/namegen.py
generate_id
¶
Generate a random base-36 string of length
digits.
This method is taken from the wandb SDK.
There are ~2.8T base-36 8-digit strings. Generating 210k ids will have a ~1% chance of collision.
Parameters:
-
length
(int
, default:8
) –The length of the string. Defaults to 8.
Returns:
-
str
(str
) –A random base-36 string of
length
digits.