Skip to content

conformance test gives "TypeError: __init__() got an unexpected keyword argument 'type'" #73

Closed

Description

@samuell

I tend to get these errors with cwltool --conformance-test, white a bit.

One example is for the samtools-view tool, but I suddenly got a similar error for my work on bwa-aln.cwl, after adding a trailing slash to a namespace (s: http://schema.org/ instead of s: http://schema.org).

Any hints?

[samuel tools]$ cwltool --conformance-test samtools-view.cwl 
/home/samuel/.pyenv/versions/2.7.11/bin/cwltool 1.0.20160427142240
Traceback (most recent call last):
  File "/home/samuel/.pyenv/versions/2.7.11/bin/cwltool", line 9, in <module>
    load_entry_point('cwltool==1.0.20160427142240', 'console_scripts', 'cwltool')()
  File "/home/samuel/.pyenv/versions/2.7.11/lib/python2.7/site-packages/cwltool/main.py", line 590, in main
    stdout=stdout)
  File "/home/samuel/.pyenv/versions/2.7.11/lib/python2.7/site-packages/cwltool/main.py", line 429, in load_job_order
    toolparser = generate_parser(argparse.ArgumentParser(prog=args.workflow), t, namemap)
  File "/home/samuel/.pyenv/versions/2.7.11/lib/python2.7/site-packages/cwltool/main.py", line 283, in generate_parser
    help=ahelp, action=action, type=atype, default=default)
  File "/home/samuel/.pyenv/versions/2.7.11/lib/python2.7/argparse.py", line 1294, in add_argument
    action = action_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'type'

Activity

  1. samuell commented on May 4, 2016

    @samuell
    ContributorAuthor

    Yeah, well, removing the trailing slash from http://schema.org/ on line 238 in samtools-view.cwl actually avoids the error message for samtools view as well.

  2. samuell commented on May 4, 2016

    @samuell
    ContributorAuthor

    ... and so does escaping / putting a backslash, before the last slash, also:

    $namespaces:
      s: http://schema.org\/  # <-- like so

    ... so I guess it might be a yaml parsing issue?

  3. samuell commented on May 4, 2016

    @samuell
    ContributorAuthor

    The only way to get past this error, without messing up the schema url, seems to be to use the > char and a newline:

    $namespaces:
      s: >
        http://schema.org/

    So, then this seems like an issue with the samtools tool config rather than with cwltool ...

  4. mr-c commented on May 5, 2016

    @mr-c
    Member

    Hello @samuell, thank you for reporting this.

    cwltool --conformance-test is meant to be used with a tool definition and a job file, as part of the testing infrastructure. See https://github.com/common-workflow-language/cwltool/blob/master/cwltool/cwltest.py#L81 https://github.com/common-workflow-language/workflows/blob/master/test/test.sh and https://github.com/common-workflow-language/workflows/blob/master/test/samtools-view-test.yaml

    (env) mcrusoe@mrcdev:~/workflows$ cwltool --conformance-test tools/samtools-view.cwl  test/samtools-view-job.json 
    /home/mcrusoe/workflows/env/bin/cwltool 1.0.20160504183010
    ('file:///home/mcrusoe/workflows/tools/samtools-view.cwl', 'https://sparql-test.commonwl.org/schema.rdf')
    {
        "args": [
            "samtools", 
            "view", 
            "-@", 
            "4", 
            "-b", 
            "-o", 
            "./test-files/SRR1031972.sorted.bam", 
            "/var/lib/cwl/job468835025_test-files/SRR1031972.Aligned.sortedByCoord.out.bam"
        ]
    }
  5. samuell commented on May 5, 2016

    @samuell
    ContributorAuthor

    @mr-c Ah, IC!

  6. samuell commented on May 10, 2016

    @samuell
    ContributorAuthor

    So, maybe just a more sensible error message would help?

  7. manu-chroma commented on Jul 19, 2017

    @manu-chroma
    Member

    Looks like --conformance-test option is removed now. Found this related commit: e84b359

  8. mr-c commented on Jul 19, 2017

    @mr-c
    Member

    Thank you for finding this :-)

  9. added a commit that references this issue on Jul 23, 2017
  10. added a commit that references this issue on Mar 20, 2018
  11. added a commit that references this issue on Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions