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

Added parsers for CWL input files #199

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Added parsers for CWL input files #199

merged 5 commits into from
Dec 1, 2023

Conversation

GlassOfWhiskey
Copy link
Collaborator

@GlassOfWhiskey GlassOfWhiskey commented Feb 12, 2023

This commit adds support for parsing CWL input files with autogenerated Schema SALAD parsers, in order to obtain a coherent representation of CWL object between processfile and jobfile.

This PR depends on common-workflow-language/common-workflow-language#953, common-workflow-language/cwl-v1.1#83, and common-workflow-language/cwl-v1.2#220.

@GlassOfWhiskey GlassOfWhiskey force-pushed the cwl-inputfile-parsers branch 6 times, most recently from 028c895 to 47ae327 Compare February 12, 2023 11:05
@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Attention: 202 lines in your changes are missing coverage. Please review.

Comparison is base (f2ac3ea) 40.99% compared to head (76016cd) 33.26%.

Files Patch % Lines
cwl_utils/parser/cwl_v1_1_utils.py 44.87% 39 Missing and 4 partials ⚠️
cwl_utils/parser/cwl_v1_2_utils.py 44.87% 39 Missing and 4 partials ⚠️
cwl_utils/parser/cwl_v1_0_utils.py 47.36% 36 Missing and 4 partials ⚠️
cwl_utils/cwl_v1_0_expression_refactor.py 12.00% 20 Missing and 2 partials ⚠️
cwl_utils/cwl_v1_1_expression_refactor.py 13.63% 19 Missing ⚠️
cwl_utils/cwl_v1_2_expression_refactor.py 28.00% 18 Missing ⚠️
cwl_utils/parser/utils.py 63.04% 12 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
- Coverage   40.99%   33.26%   -7.73%     
==========================================
  Files          30       30              
  Lines       23563    31014    +7451     
  Branches     6406     8997    +2591     
==========================================
+ Hits         9659    10316     +657     
- Misses      11827    18284    +6457     
- Partials     2077     2414     +337     

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

@GlassOfWhiskey GlassOfWhiskey marked this pull request as ready for review February 12, 2023 11:15
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.

Huzzah! Can we get some test cases?

@GlassOfWhiskey
Copy link
Collaborator Author

GlassOfWhiskey commented Feb 12, 2023

Added tests for the most critical parts:

  • cwl:requirements
  • secondary files
  • nested arrays

As usual, complete coverage would require to run conformance tests suite using this parser.

Comment on lines +106 to +123
if isinstance(doc, str):
url = loadingOptions.fetcher.urljoin(baseuri, doc)
if url in loadingOptions.idx:
return loadingOptions.idx[url]
doc_url, frg = urldefrag(url)
text = loadingOptions.fetcher.fetch_text(doc_url)
textIO = StringIO(text)
textIO.name = str(doc_url)
yaml = yaml_no_ts()
result = yaml.load(textIO)
add_lc_filename(result, doc_url)
loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, fileuri=doc_url)
_inputfile_load(
result,
doc_url,
loadingOptions,
)
return loadingOptions.idx[url]
Copy link
Member

Choose a reason for hiding this comment

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

Can we get a test for this code branch?

@GlassOfWhiskey GlassOfWhiskey force-pushed the cwl-inputfile-parsers branch 4 times, most recently from 1b9dc32 to 84d2023 Compare June 18, 2023 18:57
@GlassOfWhiskey GlassOfWhiskey force-pushed the cwl-inputfile-parsers branch 4 times, most recently from 578dfc7 to 8ffe613 Compare October 8, 2023 21:12
@GlassOfWhiskey GlassOfWhiskey force-pushed the cwl-inputfile-parsers branch 5 times, most recently from 117fa25 to 5f06479 Compare November 3, 2023 00:18
This commit adds support for parsing CWL input files with autogenerated
Schema SALAD parsers, in order to obtain a coherent representation of
CWL object between processfile and jobfile.
@mr-c mr-c merged commit 8e4ed82 into main Dec 1, 2023
28 of 29 checks passed
@mr-c mr-c deleted the cwl-inputfile-parsers branch December 1, 2023 16:26
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.

2 participants