ME-ICA / aroma

ICA-AROMA, as a Python package. A work in progress.
Apache License 2.0
7 stars 11 forks source link

CLI error: folder does not exist #21

Closed eurunuela closed 4 years ago

eurunuela commented 4 years ago

Summary

Running aroma from the command line raises a The folder does not exist error.

Additional Detail

Command I ran:

aroma -i sub-pixar123_task-pixar_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz -tr 2 -out out -mc mc.tsv

Error I got:

usage: aroma [-h] -o OUT_DIR (-i IN_FILE | -f IN_FEAT) [-mc MC] [-a AFFMAT] [-w WARP] [-m MASK]
             [-tr TR] [-den {nonaggr,aggr,both,no}] [-md MEL_DIR] [-dim DIM] [-ow] [-np]
aroma: error: The folder  does not exist!

Next Steps

The error is raised by the following line in àroma/cli/aroma.py`:

options = _get_parser().parse_args(argv)

eurunuela commented 4 years ago

I've tracked this down and the problem comes from the following line:

type=lambda x: is_valid_path(parser, x)

which only exists for the melodic folder and the feat folder options.

We will have to make the defaults None and only check if the file exists when the variable is not None.

tsalo commented 4 years ago

That should be pretty straightforward. I'm a little surprised that it raises an error when the parameters aren't actually set though..

EDIT: Never mind, I understand. It's just that the defaults are bad, not that the is_valid_path function is.

eurunuela commented 4 years ago

EDIT: Never mind, I understand. It's just that the defaults are bad, not that the is_valid_path function is.

That's what I meant, yes. I'm surprised though. And we did not catch this because the integration error does not call the command line.