Utils¶
ecopann.utils¶
-
class
ecopann.utils.Logger(path='logs', fileName='log', stream=<open file '<stdout>', mode 'w'>)[source]¶ Bases:
objectRecord the output of the terminal and write it to disk.
-
ecopann.utils.makeList(roots)[source]¶ Checks if the given parameter is a list. If not, creates a list with the parameter as an item in it.
Parameters: roots (object) – The parameter to check. Returns: A list containing the parameter. Return type: list
-
ecopann.utils.mkdir(path)[source]¶ Make a directory in a particular location if it is not exists, otherwise, do nothing.
Parameters: path (str) – The path of a file. Examples
>>> mkdir('/home/UserName/test') >>> mkdir('test/one') >>> mkdir('../test/one')
-
ecopann.utils.saveTorchPt(path, FileName, File)[source]¶ Save the .pt files using
torch.save()funtion.Parameters: