dcase_util.utils.ApplicationPaths

class dcase_util.utils.ApplicationPaths(parameter_container=None)[source]

Utility class for application paths, paths are automatically generated based on parameters through parameter hash.

Constructor

Parameters
parameter_containerParameterContainer

Application parameter container Default value None

__init__(parameter_container=None)[source]

Constructor

Parameters
parameter_containerParameterContainer

Application parameter container Default value None

Methods

__init__([parameter_container])

Constructor

construct_path(path_parts)

Generate all combinations of based on path parts

create([paths])

Create given paths.

directory_name(prefix, param_hash)

Generate directory name.

exists([path])

Checks that path exists

file_count([path])

File count under given path including sub directories.

file_list([path, recursive, extensions, ...])

Get file list

generate(path_base, structure)

Generate application paths and include parameter hashes to the paths

makedirs([path])

Create given path.

modify([path, path_base, ...])

Modify path Parameters ---------- path : str Path, if none given one given to class constructor is used. Default value None path_base : str Replacement path base, e.g. path base for "/test/audio/audio.wav" is "/test/audio". Default value None.

posix([path])

Converts path to POSIX format

posix_to_nt([path])

Converts posix formatted path to nt

save_parameters_to_path(path_base, structure)

Save parameters to each application sub-directory.

shorten([path, part_count])

Shorten path into given parts length

size_bytes([path])

Total byte count of all files under given path.

size_string([path, show_bytes])

Total data size of all files under given path returned in human readable form.

Attributes

logger

Logger instance