config#

showyourwork.config.as_dict(x, depth=0, maxdepth=30)#

Replaces nested instances of OrderedDicts with regular dicts in a dictionary.

This is useful when parsing a config generated from a YAML file with inconsistent use of hyphens.

Parameters
  • x – A dictionary or dictionary-like mapping generated from reading a YAML file.

  • depth (int, optional) – Default is 0.

  • maxdepth (int, optional) – Default is 30.

showyourwork.config.edit_yaml(file)#

A context used to edit a YAML file in place.

Parameters

file (str) – The full path to the YAML file.

showyourwork.config.get_run_type()#

Return the type of the current Snakemake run.

Options are:

  • clean

  • build

  • tarball

  • preprocess

  • other

Returns

The type of the current run (one of the options listed above).

Return type

str

showyourwork.config.get_upstream_dependencies(file, dependencies, depth=0)#

Collect user-defined dependencies of a file recursively. Returns a list of strings.

showyourwork.config.parse_config()#

Parse the current config and fill in defaults.

showyourwork.config.parse_overleaf()#

Parse Overleaf configuration options and fill in defaults.

showyourwork.config.parse_syw_spec(syw_spec)#

Resolve the version of showyourwork from the value provided in the config.

showyourwork.config.render_config(cwd='.')#

Render any jinja templates in showyourwork.yml, combine with zenodo.yml, and save the processed config to a temporary YAML file.

This temporary YAML file is then used as the configfile for the Snakemake workflow.

Parameters

cwd (str, optional) – The path to the working directory.

Returns

The user config.

Return type

dict