run_remodel

Main command-line program for running the remodeling tools.

Functions

get_parser()

Create a parser for the run_remodel command-line arguments.

handle_backup(args)

Restores the backup if applicable.

main([arg_list])

The command-line program.

parse_arguments([arg_list])

Parse the command line arguments or arg_list if given.

parse_tasks(files, task_args)

run_bids_ops(dispatch, args, tabular_files)

Run the remodeler on a BIDS dataset.

run_direct_ops(dispatch, args, tabular_files)

Run the remodeler on files of a specified form in a directory tree.

get_parser()[source]

Create a parser for the run_remodel command-line arguments.

Returns:

A parser for parsing the command line arguments.

Return type:

argparse.ArgumentParser

handle_backup(args)[source]

Restores the backup if applicable.

Parameters:

args (obj) – parsed arguments as an object.

Returns:

backup name if there was a backup done.

Return type:

str or None

main(arg_list=None)[source]

The command-line program.

Parameters:

arg_list (list or None) – Called with value None when called from the command line. Otherwise, called with the command-line parameters as an argument list.

Raises:

HedFileError

  • if the data root directory does not exist.

  • if the specified backup does not exist.

parse_arguments(arg_list=None)[source]

Parse the command line arguments or arg_list if given.

Parameters:

arg_list (list) – List of command line arguments as a list.

Returns:

Argument object List: A list of parsed operations (each operation is a dictionary).

Return type:

Object

Raises:

ValueError

  • If the operations were unable to be correctly parsed.

parse_tasks(files, task_args)[source]
run_bids_ops(dispatch, args, tabular_files)[source]

Run the remodeler on a BIDS dataset.

Parameters:
  • dispatch (Dispatcher) – Manages the execution of the operations.

  • args (Object) – The command-line arguments as an object.

  • tabular_files (list) – List of tabular files to run the ops on.

run_direct_ops(dispatch, args, tabular_files)[source]

Run the remodeler on files of a specified form in a directory tree.

Parameters:
  • dispatch (Dispatcher) – Controls the application of the operations and backup.

  • args (argparse.Namespace) – Dictionary of arguments and their values.

  • tabular_files (list) – List of files to include in this run.