@classmethod
def generate_command(cls, external_inputs, config, outdir, nprocess=1,
    mpi_command='mpirun -n'):
    """
        Generate a command line that will run the stage
        """
    module = cls.get_module()
    module = module.split('.')[0]
    flags = [cls.name]
    for tag, ftype in (cls.inputs + cls.outputs):
        if tag in external_inputs:
            fpath = external_inputs[tag]
        else:
            fpath = f'{outdir}/{tag}.{ftype.suffix}'
        flag = f'--{tag}={fpath}'
        flags.append(flag)
    flags.append(f'--config={config}')
    flags = '   '.join(flags)
    if nprocess > 1:
        launcher = f'{mpi_command} {nprocess}'
        mpi_flag = '--mpi'
    else:
        launcher = ''
        mpi_flag = ''
    cmd = f'{launcher} python3 -m {module} {flags} {mpi_flag}'
    return cmd
