Skip to content

REF: Update nipype2boutiques script #2894

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

Merged
merged 32 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7c7d462
updated nipype2boutiques to conform to current schema, added default …
erinb90 Feb 6, 2019
fc27d01
added a step to make sure output IDs are unique in case output name i…
erinb90 Feb 6, 2019
e7739e7
descriptor gets saved to a file for easier exporting, added value-cho…
erinb90 Feb 7, 2019
181c481
added warning message when cannot determine path template for output,…
erinb90 Feb 7, 2019
ce06815
fixed json file formatting, added save parameter, fixed command-line-…
erinb90 Feb 8, 2019
c1cfc80
added logic to deal with range and list inputs, added try except bloc…
erinb90 Feb 8, 2019
ee4b935
added logic to deal with compound traits, added check to make sure in…
erinb90 Feb 11, 2019
ad36016
put compound inputs into mutex group
erinb90 Feb 12, 2019
bb260f8
added method to get all the mutex and all-or-none groups from the inp…
erinb90 Feb 12, 2019
1110b4f
removed input tempvalue stuff and added logic to rerun the interface …
erinb90 Feb 26, 2019
8e20d2d
added logic to handle multioutputs and inputs where value choices are…
erinb90 Feb 26, 2019
61c836f
fixed multioutput, added handling of multiinput, added option to supp…
erinb90 Feb 26, 2019
f4c8867
fixed number input min and max, removed numbers from custom inputs (c…
erinb90 Feb 26, 2019
6961f02
removed unused things, updated comments
erinb90 Feb 26, 2019
f67d04b
fixed small error
erinb90 Feb 28, 2019
2bf03cf
added author and ignored inputs parameters, removed nipype from comma…
erinb90 Mar 12, 2019
d009a88
fixed code quality issues
erinb90 Mar 12, 2019
63d96be
added option to supply descriptor tags, changed default tool version …
erinb90 Mar 18, 2019
1e15b99
added method to take into account the order of positional command lin…
erinb90 Mar 20, 2019
54259d8
Merge branch 'master' of https://github.com/nipy/nipype into update-n…
erinb90 Mar 21, 2019
f0a11b8
added methods to generate command line flag and generate a boutiques …
erinb90 Mar 27, 2019
b4b2de0
updated nipypecli, fixed code style
erinb90 Mar 28, 2019
ebe7da7
updated nipype2boutiques test
erinb90 Mar 29, 2019
892c03d
Merge branch 'master' of https://github.com/nipy/nipype into update-n…
erinb90 Mar 29, 2019
2ff50ed
fix test file path
erinb90 Mar 29, 2019
c828fec
fixed test
erinb90 Mar 29, 2019
7e96311
changed test to only check a subset of descriptor fields
erinb90 Apr 2, 2019
0eae216
changed test again
erinb90 Apr 4, 2019
9a17389
Merge branch 'master' of https://github.com/nipy/nipype into update-n…
erinb90 Apr 9, 2019
52d87a9
added handling for lists with value choices, fixed logic to handle ca…
erinb90 Apr 10, 2019
5c0684d
removed six, changed all-or-none groups to go under requires-inputs f…
erinb90 Apr 24, 2019
01879f2
Merge branch 'master' of https://github.com/nipy/nipype into update-n…
erinb90 May 21, 2019
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
61 changes: 34 additions & 27 deletions nipype/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,48 +211,55 @@ def convert():
help="JSON file name where the Boutiques descriptor will be "
"written.")
@click.option(
"-t",
"--ignored-template-inputs",
"-c",
"--container-image",
required=True,
type=str,
multiple=True,
help="Interface inputs ignored in path template creations.")
help="Name of the container image where the tool is installed.")
@click.option(
"-d",
"--docker-image",
"-p",
"--container-type",
required=True,
type=str,
help="Name of the Docker image where the Nipype interface is "
"available.")
help="Type of container image (Docker or Singularity).")
@click.option(
"-r",
"--docker-index",
"-x",
"--container-index",
type=str,
help="Docker index where the Docker image is stored (e.g. "
help="Optional index where the image is available (e.g. "
"http://index.docker.io).")
@click.option(
"-n",
"--ignore-template-numbers",
is_flag=True,
flag_value=True,
help="Ignore all numbers in path template creations.")
"-g",
"--ignore-inputs",
type=str,
multiple=True,
help="List of interface inputs to not include in the descriptor.")
@click.option(
"-v",
"--verbose",
is_flag=True,
flag_value=True,
help="Enable verbose output.")
def boutiques(interface, module, output, ignored_template_inputs, docker_image,
docker_index, ignore_template_numbers, verbose):
help="Print information messages.")
@click.option(
"-a",
"--author",
type=str,
help="Author of the tool (required for publishing).")
@click.option(
"-t",
"--tags",
type=str,
help="JSON string containing tags to include in the descriptor,"
"e.g. \"{\"key1\": \"value1\"}\"")
def boutiques(module, interface, container_image, container_type, output,
container_index, verbose, author, ignore_inputs, tags):
"""Nipype to Boutiques exporter.

See Boutiques specification at https://github.com/boutiques/schema.
"""
from nipype.utils.nipype2boutiques import generate_boutiques_descriptor

# Generates JSON string
json_string = generate_boutiques_descriptor(
module, interface, ignored_template_inputs, docker_image, docker_index,
verbose, ignore_template_numbers)

# Writes JSON string to file
with open(output, 'w') as f:
f.write(json_string)
# Generates JSON string and saves it to file
generate_boutiques_descriptor(
module, interface, container_image, container_type, container_index,
verbose, True, output, author, ignore_inputs, tags)
Loading