Config

class scooch.Config(config_file, custom_params={})

A simple class that encapsulates feature configuration files stored in yaml format. Each feature configuration file should contain all the details that make a feature unique for a certain type, e.g., a CQT.

Constructor.

Args:

config_file: str, dict, file or Config - A file like object or filename describing a yaml file to load this class’s configuration from. Alternatively, it can be a dictionary describing the

property hashid

Returns an identifier that will be the same for identical dictionary contents. Note there may be a hash collision here for two distinct contents, but it is very unlikely.

Return:

str - A string containing a hex representation of the hashed dictionary.

property json

Returns a string containing a json version of the dictionary that is unique for a unique configuration, and identical for identical configurations.

Return:

str - A json formatted string describing the dictionary contents

static override(config_dict, custom_params)

Add in any custom parameters that were supplied ad-hoc, i.e., not in the dictionary or yaml file that this object is primarily constructed with.

Args:

custom_params: <dict> - A dictionary mapping parameter paths to values, to override any parameters already in the configuration. Anything specified in the provided override dictionary will overwrite anything in this current config. Anything not specified in the override dictionary will remain as is.

save(config_file)

Saves a the configuration fields in yaml format to disk.

Args:

config_file: str or file - A file like object or filename describing a yaml file to save this class’s configuration to.