Skip to content

Commit

Permalink
Fix error caused by argument name 'type' confusion
Browse files Browse the repository at this point in the history
This changes the argument name from 'type' to 'mode' in order
to prevent any confusion (on the part of the python interpreter)
between the argparse argument 'type' and some possibly protected
variable 'type'.
  • Loading branch information
jsheunis committed Jun 12, 2024
1 parent b5985d9 commit be138c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions datalad_catalog/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Workflow(ValidatedInterface):
),
mode=Parameter(
# cmdline argument definitions, incl aliases
args=("-t", "--type"),
args=("-m", "--mode"),
# documentation
doc="""Which type of workflow to run: one of ['new', 'update']""",
),
Expand Down Expand Up @@ -193,7 +193,7 @@ class Workflow(ValidatedInterface):
"dataset='path/to/superdataset', extractor='metalad_core')"
),
code_cmd=(
"datalad catalog-workflow -t new -c /tmp/my-cat "
"datalad catalog-workflow -m new -c /tmp/my-cat "
"-d path/to/superdataset -e metalad_core"
),
),
Expand All @@ -208,7 +208,7 @@ class Workflow(ValidatedInterface):
"extractor='metalad_core')"
),
code_cmd=(
"datalad catalog-workflow -t new -c /tmp/my-cat "
"datalad catalog-workflow -m update -c /tmp/my-cat "
"-d path/to/superdataset -s path/to/subdataset -e metalad_core"
),
),
Expand Down Expand Up @@ -244,7 +244,7 @@ def __call__(
)
if mode == "new":
yield from super_workflow(
ds=dataset,
ds=dataset.ds,
cat=catalog,
extractors=extractor,
config_file=config_file,
Expand All @@ -253,8 +253,8 @@ def __call__(
)
if mode == "update":
yield from update_workflow(
superds=dataset,
subds=subdataset,
superds=dataset.ds,
subds=subdataset.ds,
catalog=catalog,
extractors=extractor,
**res_kwargs,
Expand Down

0 comments on commit be138c5

Please sign in to comment.