Skip to content

Commit bf1dd06

Browse files
authored
Merge pull request #98 from neuroscout/nv_group_default
Add force-neurovault option, and default to group uploads
2 parents 6696601 + ac70a83 commit bf1dd06

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

neuroscout_cli/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
neuroscout
33
44
Usage:
5-
neuroscout run [-ui <dir> -s <k> -w <dir> -c <n> -n <nv> -d] <outdir> <bundle_id>...
5+
neuroscout run [-dfu -i <dir> -s <k> -w <dir> -c <n> -n <nv>] <outdir> <bundle_id>...
66
neuroscout install [-ui <dir>] <bundle_id>...
77
neuroscout ls <bundle_id>
88
neuroscout -h | --help
@@ -16,8 +16,9 @@
1616
-s, --smoothing <k> Smoothing kernel FWHM at group level
1717
[default: 4]
1818
-u, --unlock Unlock datalad dataset
19-
-n, --neurovault <nv> Upload mode (disable, force, or enable)
20-
[default: enable]
19+
-n, --neurovault <nv> Upload mode (disable, all, or group)
20+
[default: group]
21+
-f, --force-neurovault Force upload, if a NV collection already exists
2122
-d, --drop-missing Drop missing contrast
2223
2324
Commands:

neuroscout_cli/commands/run.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ def run(self):
3434
f'--smoothing={smoothing}:Dataset'
3535
]
3636

37-
neurovault = self.options.pop('--neurovault', 'enable')
38-
assert neurovault in ['enable', 'disable', 'force']
37+
neurovault = self.options.pop('--neurovault', 'group')
38+
nv_force = self.options.pop('--force-neurovault', False)
39+
if neurovault not in ['disable', 'group', 'all']:
40+
raise ValueError("Invalid neurovault option.")
3941

4042
# Fitlins invalid keys
4143
for k in INVALID:
@@ -73,23 +75,26 @@ def run(self):
7375
group = [i for i in images.glob('task*statmap.nii.gz')
7476
if re.match('.*stat-[t|variance|effect]+.*', i.name)]
7577

76-
sub = [i for i in images.glob('sub*/*statmap.nii.gz')
77-
if re.match('.*stat-[variance|effect]+.*', i.name)]
78+
if neurovault == 'all':
79+
sub = [i for i in images.glob('sub*/*statmap.nii.gz')
80+
if re.match('.*stat-[variance|effect]+.*', i.name)]
81+
else:
82+
sub = None
7883

7984
# Upload results NeuroVault
8085
self.api.analyses.upload_neurovault(
8186
id=self.bundle_id,
8287
validation_hash=install.resources['validation_hash'],
8388
group_paths=group, subject_paths=sub,
84-
force=neurovault == 'force',
89+
force=nv_force,
8590
n_subjects=n_subjects)
8691
else:
8792
logging.error(
8893
"\n"
8994
"-----------------------------------------------------------\n"
9095
"Model execution failed! \n"
9196
f"neuroscout-cli version: {VERSION}\n"
92-
"Try updating or revising your model, and try again.\n"
97+
"Update this program or revise your model, and try again.\n"
9398
"If you believe there is a bug, please report it:\n"
9499
"https://github.com/neuroscout/neuroscout-cli/issues\n"
95100
"-----------------------------------------------------------\n"

0 commit comments

Comments
 (0)