livvkit.util package

Submodules

livvkit.util.LIVVDict module

class livvkit.util.LIVVDict.LIVVDict[source]

Bases: dict

Extension of the dictionary data structure to allow for auto nesting.

nested_assign(key_list, value)[source]

Set the value of nested LIVVDicts given a list

nested_insert(item_list)[source]

Create a series of nested LIVVDicts given a list

livvkit.util.bib module

class livvkit.util.bib.HTMLBackend(*args, **kwargs)[source]

Bases: pybtex.backends.html.Backend

format_protected(text)[source]

Format a “protected” piece of text.

In LaTeX backend, it is formatted as a {braced group}. Most other backends would just output the text as-is.

output(html)[source]
write_epilogue()[source]
write_prologue()[source]
class livvkit.util.bib.LatexBackend(*args, **kwargs)[source]

Bases: pybtex.backends.latex.Backend

livvkit.util.bib.bib2html(bib, style=None, backend=None)[source]

livvkit.util.colormaps module

Provides some colormaps not included in matplotlib version < 2.0

livvkit.util.functions module

Module to hold LIVVkit specific functions

class livvkit.util.functions.TempSysPath(path)[source]

Bases: object

Add a path to the PYTHONPATH temporarily

livvkit.util.functions.collect_cases(data_dir)[source]

Find all cases and subcases of a particular run type

livvkit.util.functions.create_page_from_template(template_file, output_path)[source]

Copy the correct html template file to the output directory

livvkit.util.functions.find_file(search_dir, file_pattern)[source]

Search for a file in a directory, and return the first match. If the file is not found return an empty string

Parameters
  • search_dir – The root directory to search in

  • file_pattern – A unix-style wildcard pattern representing the file to find

Returns

The path to the file if it was found, otherwise an empty string

livvkit.util.functions.merge_dicts(dict1, dict2)[source]

Merge two dictionaries and return the result

livvkit.util.functions.mkdir_p(path)[source]

Make parent directories as needed and no error if existing. Works like mkdir -p.

livvkit.util.functions.parse_gptl(file_path, var_list)[source]

Read a GPTL timing file and extract some data.

Parameters
  • file_path – the path to the GPTL timing file

  • var_list – a list of strings to look for in the file

Returns

A dict containing key-value pairs of the livvkit and the times associated with them

livvkit.util.functions.read_json(file_path)[source]

Read in a json file and return a dictionary representation

livvkit.util.functions.setup_output(cssd=None, jsd=None, imgd=None)[source]

Set up the directory structure for the output. Copies old run data into a timestamped directory and sets up the new directory

livvkit.util.functions.sort_processor_counts(p_string)[source]

Simple wrapper to help sort processor counts

livvkit.util.functions.sort_scale(s_string)[source]

Simple wrapper to help sort scale sizes

livvkit.util.functions.write_json(data, path, file_name)[source]

Write out data to a json file.

Parameters
  • data – A dictionary representation of the data to write out

  • path – The directory to output the file in

  • file_name – The name of the file to write out

livvkit.util.options module

livvkit.util.options.init(options)[source]

Initialize some defaults

livvkit.util.options.parse_args(args=None)[source]

Handles the parsing of options for LIVVkit’s command line interface

Parameters

args – The list of arguments, typically sys.argv[1:]

livvkit.util.options.positive_int(integer)[source]

Argparse helper function to specify a zero or positive integer as an argument type :param integer: A zero or positive integer :return: integer

Module contents