Skip to content

utils

Utility functions.

md5_for_path

md5_for_path(path)

Calculate MD5 of file content.

timeit

timeit(function)

Time function via timing decorator.

paths_text

paths_text(paths)

Get the text of a path or of several paths, one path per line.

The data path of simulation experiments is a path or several paths; str of a list of paths shows the representation of every path, e.g. [PosixPath('/data')], instead of the path.

Parameters:

Name Type Description Default
paths str | Path | Iterable[str | Path] | None

a path, several paths or None.

required

Returns:

Type Description
str

The paths, one per line, "none" for None.