Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snakemake style guide: Add another way of accessing config values #170

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/reference/snakemake-style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ global variable. 3 ways are supported, but only 2 should be used:
1. ``config[key]``: Use this when the key is required, or a default is
specified in a pre-loaded configuration file.

2. ``config.get(key, default)``: Use this when the key is optional.
2. ``key [not] in config``: Use this when the key is optional and you
want to check if a value is specified.

3. ``config.get(key)``: Never use this. All use cases should be covered
by (1) and (2). Using this will only mask errors that may be due to a
missing required key.
3. ``config.get(key, default)``: Use this when the key is optional and
you want to access its value.

4. ``config.get(key)``: **Never use this**. All use cases should be covered
by the options above. Using this will only mask errors that may be
due to a missing required key.

Use Snakemake ``params:`` block to map into ``config`` dictionary
=================================================================
Expand Down