@classmethod
def generate_cwl(cls):
    """
        Produces a CWL App object which can then be exported to yaml
        """
    import cwlgen
    module = cls.get_module()
    module = module.split('.')[0]
    cwl_tool = cwlgen.CommandLineTool(tool_id=cls.name, label=cls.name,
        base_command='python3', cwl_version='v1.0', doc=cls.__doc__)
    input_arg = cwlgen.CommandLineBinding(position=-1, value_from=f'-m{module}'
        )
    cwl_tool.arguments.append(input_arg)
    input_arg = cwlgen.CommandLineBinding(position=0, value_from=f'{cls.name}')
    cwl_tool.arguments.append(input_arg)
    type_dict = {int: 'int', float: 'float', str: 'string', bool: 'boolean'}
    for opt in cls.config_options:
        def_val = cls.config_options[opt]
        if type(def_val) is list:
            v = def_val[0]
            param_type = {'type': 'array', 'items': type_dict[v] if type(v) ==
                type else type_dict[type(v)]}
            default = def_val if type(v) != type else None
            input_binding = cwlgen.CommandLineBinding(prefix='--{}='.format
                (opt), item_separator=',', separate=False)
        else:
            param_type = type_dict[def_val] if type(def_val
                ) == type else type_dict[type(def_val)]
            default = def_val if type(def_val) != type else None
            if param_type is 'boolean':
                input_binding = cwlgen.CommandLineBinding(prefix='--{}'.
                    format(opt))
            else:
                input_binding = cwlgen.CommandLineBinding(prefix='--{}='.
                    format(opt), separate=False)
        input_param = cwlgen.CommandInputParameter(opt, label=opt,
            param_type=param_type, input_binding=input_binding, default=
            default, doc='Some documentation about this parameter')
        if type(def_val) is list:
            input_param.type = param_type
        cwl_tool.inputs.append(input_param)
    for i, inp in enumerate(cls.input_tags()):
        input_binding = cwlgen.CommandLineBinding(prefix='--{}'.format(inp))
        input_param = cwlgen.CommandInputParameter(inp, label=inp,
            param_type='File', param_format=cls.inputs[i][1].__name__,
            input_binding=input_binding, doc=
            'Some documentation about the input')
        cwl_tool.inputs.append(input_param)
    input_binding = cwlgen.CommandLineBinding(prefix='--config')
    input_param = cwlgen.CommandInputParameter('config', label='config',
        param_type='File', param_format='YamlFile', input_binding=
        input_binding, doc='Configuration file')
    cwl_tool.inputs.append(input_param)
    for i, out in enumerate(cls.output_tags()):
        output_name = f'{out}.{cls.outputs[i][1].suffix}'
        output_binding = cwlgen.CommandOutputBinding(glob=output_name)
        output = cwlgen.CommandOutputParameter(out, label=out, param_type=
            'File', output_binding=output_binding, param_format=cls.outputs
            [i][1].__name__, doc=
            'Some results produced by the pipeline element')
        cwl_tool.outputs.append(output)
    return cwl_tool
