diff --git a/docs/bids_app/config.md b/docs/bids_app/config.md index 8e2c45a5..fe96f460 100644 --- a/docs/bids_app/config.md +++ b/docs/bids_app/config.md @@ -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: diff --git a/snakebids/project_template/{% if create_doc_template %}docs{% endif %}/usage/snakemake_cli.md b/snakebids/project_template/{% if create_doc_template %}docs{% endif %}/usage/snakemake_cli.md index 4ebfb83a..617af257 100644 --- a/snakebids/project_template/{% if create_doc_template %}docs{% endif %}/usage/snakemake_cli.md +++ b/snakebids/project_template/{% if create_doc_template %}docs{% endif %}/usage/snakemake_cli.md @@ -1,7 +1,7 @@ # Snakemake Command line interface ```{argparse} -:module: snakemake +:module: snakebids.snakemake_compat :func: get_argument_parser :prog: snakemake ``` diff --git a/snakebids/snakemake_compat.py b/snakebids/snakemake_compat.py index 48abe810..db7cc5f6 100644 --- a/snakebids/snakemake_compat.py +++ b/snakebids/snakemake_compat.py @@ -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 @@ -20,4 +20,5 @@ "Snakemake", "WildcardError", "configfile", + "get_argument_parser", ] diff --git a/snakebids/snakemake_compat.pyi b/snakebids/snakemake_compat.pyi index 887438ef..4f15a0cf 100644 --- a/snakebids/snakemake_compat.pyi +++ b/snakebids/snakemake_compat.pyi @@ -1,3 +1,4 @@ +from argparse import ArgumentParser from pathlib import Path from typing import Any, Callable, Iterable, Sequence @@ -45,3 +46,4 @@ class Snakemake: params: Params[str] def main(argv: list[str] = ...) -> None: ... +def get_argument_parser(profiles: list[str] | None = ...) -> ArgumentParser: ...