Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix factory.py #1099

Closed
wants to merge 3 commits into from
Closed

Fix factory.py #1099

wants to merge 3 commits into from

Conversation

suecharo
Copy link
Contributor

I have modified factory.py to be the same as when executed from the command line.
It has been fixed to be the same runtimeContext and loadingContext as when executed from the command line.
As it uses argparse, we can pass command line runtime options to factory.py.
It has passed the conformance test.
Adapt this pull request, we can use factory.py as follows:

import cwltool.factory
from pprint import pprint

def main():
    argsl = [
        "--outdir",
        "/home/suecharo/tmp/test/test_output",
    ]
    fac = cwltool.factory.Factory(argsl)
    workflow = fac.make(
        "https://github.com/suecharo/test-workflow/raw/master/workflow/bwa_mapping_pe.cwl")
    result = workflow(
        nthreads=2,
        fastq1_url="https://github.com/suecharo/test-workflow/raw/master/data/small.ERR034597_1.fastq",
        fastq2_url="https://github.com/suecharo/test-workflow/raw/master/data/small.ERR034597_2.fastq",
        fasta_url="https://github.com/suecharo/test-workflow/raw/master/data/small.chr22.fa",
    )
    pprint(result)


if __name__ == "__main__":
    main()

@cwl-bot
Copy link

cwl-bot commented Apr 13, 2019

Can one of the admins verify this patch?

@mr-c
Copy link
Member

mr-c commented Apr 13, 2019

Jenkins, okay to test

@codecov
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Merging #1099 into master will decrease coverage by 23.65%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1099       +/-   ##
===========================================
- Coverage   79.92%   56.26%   -23.66%     
===========================================
  Files          30       30               
  Lines        6152     6176       +24     
  Branches     1537     1543        +6     
===========================================
- Hits         4917     3475     -1442     
- Misses        854     2349     +1495     
+ Partials      381      352       -29
Impacted Files Coverage Δ
cwltool/factory.py 0% <0%> (-92.69%) ⬇️
cwltool/pack.py 10.55% <0%> (-73.3%) ⬇️
cwltool/subgraph.py 16.19% <0%> (-67.62%) ⬇️
cwltool/provenance.py 14.6% <0%> (-65.85%) ⬇️
cwltool/singularity.py 23.52% <0%> (-51.64%) ⬇️
cwltool/secrets.py 40.47% <0%> (-42.86%) ⬇️
cwltool/resolver.py 34.42% <0%> (-42.63%) ⬇️
cwltool/cwlrdf.py 15.73% <0%> (-32.59%) ⬇️
cwltool/load_tool.py 57.94% <0%> (-25.71%) ⬇️
cwltool/sandboxjs.py 46.55% <0%> (-22.85%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 875b928...a50a0ce. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Attention: Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.

Project coverage is 54.46%. Comparing base (4a31f2a) to head (cc95907).
Report is 953 commits behind head on main.

Files with missing lines Patch % Lines
cwltool/factory.py 0.00% 41 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4a31f2a) and HEAD (cc95907). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (4a31f2a) HEAD (cc95907)
8 4
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1099       +/-   ##
===========================================
- Coverage   73.22%   54.46%   -18.77%     
===========================================
  Files          34       34               
  Lines        6858     6885       +27     
  Branches     1743     1749        +6     
===========================================
- Hits         5022     3750     -1272     
- Misses       1301     2705     +1404     
+ Partials      535      430      -105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/util.py:35 may also need updating

cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
cwltool/factory.py Show resolved Hide resolved
@mr-c
Copy link
Member

mr-c commented Apr 25, 2019

Hello @suecharo , this looks really useful! I made some review comments based upon the unit tests and the type checking.

@mr-c mr-c changed the base branch from master to main July 2, 2020 11:20
@mr-c mr-c marked this pull request as draft December 3, 2020 17:51
@mr-c mr-c marked this pull request as ready for review October 24, 2024 10:54
@mr-c
Copy link
Member

mr-c commented Oct 24, 2024

Resurrected as #2060

@mr-c mr-c closed this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants