Skip to content

Commit

Permalink
Extend snakemake 8 compatibility to template docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Apr 18, 2024
1 parent 0ce66a6 commit d7e5748
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/bids_app/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The value of `filters` should be a dictionary where each key corresponds to a BI
```
The above example selects all paths in the `func/` datatype folder that have a `_desc-` entity but do not have the `_acq-` entity.

* [`list`](#list): Specify multiple string or boolean filters. Any path matching any one of the filters will be selected. Using `False` as one of the filters allows the entity to optionally be absent in addition to matching one of the string filters. Using `True` along with text is redundant, as `True` will cause any value to be selected. Using `True` with `False` is equivalent to not providing the filter at all.
* [`list`](inv:*:py#list): Specify multiple string or boolean filters. Any path matching any one of the filters will be selected. Using `False` as one of the filters allows the entity to optionally be absent in addition to matching one of the string filters. Using `True` along with text is redundant, as `True` will cause any value to be selected. Using `True` with `False` is equivalent to not providing the filter at all.

These filters:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Snakemake Command line interface

```{argparse}
:module: snakemake
:module: snakebids.snakemake_compat
:func: get_argument_parser
:prog: snakemake
```
5 changes: 3 additions & 2 deletions snakebids/snakemake_compat.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# type: ignore

try:
from snakemake.cli import main
from snakemake.cli import get_argument_parser, main
from snakemake.common import configfile
from snakemake.common.configfile import load_configfile
except ImportError:
import snakemake.io as configfile
from snakemake import main
from snakemake import get_argument_parser, main
from snakemake.io import load_configfile

from snakemake.exceptions import WildcardError
Expand All @@ -20,4 +20,5 @@
"Snakemake",
"WildcardError",
"configfile",
"get_argument_parser",
]
2 changes: 2 additions & 0 deletions snakebids/snakemake_compat.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from argparse import ArgumentParser
from pathlib import Path
from typing import Any, Callable, Iterable, Sequence

Expand Down Expand Up @@ -45,3 +46,4 @@ class Snakemake:
params: Params[str]

def main(argv: list[str] = ...) -> None: ...
def get_argument_parser(profiles: list[str] | None = ...) -> ArgumentParser: ...

0 comments on commit d7e5748

Please sign in to comment.