olivepy.utils package

Submodules

olivepy.utils.utils module

olivepy.utils.utils.open_config(filename)
olivepy.utils.utils.parse_file_options(config)
olivepy.utils.utils.parse_json_options(option_str)

Parse options from a json string. Intended to be used for workflow options that may be grouped by one or more tasks. Options can be passed in a couple of different structures. In the more complicated case they can be a list of dictionaries, that specify the task/job name these options are used for, for example: ‘[{“task”:”SAD”, “options”:{“filter_length”:99, “interpolate”:1.0}}]’ They can also be passed in a simple dictionary, like: ‘{“filter_length”:99, “interpolate”:1.0, “name”:”midge”}’. In the former example, options are only passed to the job/task specified. In the latter case, these options are passed to all tasks. In both cases, OLIVE will only pass options to a task if the task supports that option name

Parameters

option_str – the options to parse

:return a list of OptionValue objects created from the JSON option input

olivepy.utils.utils.parse_json_options_as_dict(option_str)

Parse options from a json string. Intended to be used for workflow options that may be grouped by one or more tasks. Options can be passed in a couple of different structures. In the more complicated case they can be a list of dictionaries, that specify the task/job name these options are used for, for example: ‘[{“task”:”SAD”, “options”:{“filter_length”:99, “interpolate”:1.0}}]’ They can also be passed in a simple dictionary, like: ‘{“filter_length”:99, “interpolate”:1.0, “name”:”midge”}’. In the former example, options are only passed to the job/task specified. In the latter case, these options are passed to all tasks. In both cases, OLIVE will only pass options to a task if the task supports that option name

Parameters

option_str – the options to parse

Returns

a dictionary of options name/value pairs

olivepy.utils.utils.parse_pem_file(data_lines)

Parse a PEM file, grouping the results by audio file and channel.

Parameters

data_lines – the data line to parse

Returns

a dictionary of audio files to score and the channel region: {‘filename’: {channel: [(start_region, end_region)]} }

Module contents