-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add ability to add and select converters #89
base: main
Are you sure you want to change the base?
Conversation
…kflows to new CWL converter class
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 97.72% 97.80% +0.07%
==========================================
Files 13 16 +3
Lines 2066 2139 +73
==========================================
+ Hits 2019 2092 +73
Misses 47 47 ☔ View full report in Codecov by Sentry. |
I left a few comments on the code, more observations here:
Another use case is needed before attempting something like this, and even then we'd need more common code to justify a base class. Moreover, the base class should fully document all the abstract methods so that a potential implementer of a new converter would know what's expected of each method, and each method should make sense in general, not just in CWLProv. |
Thanks @simleo!
Yes, I am actively working on a converter for Galaxy output, collaborators are interested in Snakemake and Airflow
Makes sense to me! I'll get that done
True, I'll go hunting for relevant things
Absolutely, I'll do my best but I'll have to approach it iteratively |
You know that Galaxy has its own Workflow Run RO-Crate implementation? You can download the RO-Crate for a workflow execution from the workflow invocations menu. |
I am aware! And keeping an eye on development efforts too |
To elaborate on this, I notice that their implementation borrows heavily from this library! And it seems undesirable to me to have lots of informal spins of this where things cannot be contributed back As such I feel quite motivated to move the Galaxy implementation towards using a refactored version of this |
I think the last few changes address most of your points @simleo :) I'm going to keep going with a galaxy based example of extension and see how I go. But I'll be taking a break until the new year before that gets finished! Happy holidays and thanks again for the feedback |
It's looking better now. Some refs to CWL-specific stuff are still present in the now "general" part, e.g. the docstring of the One thing I don't understand is the docstring for Also, it's a bit odd that from the
I think this will help a lot in driving the generalization process forward. E.g. what does "provenance bundle" mean in the Galaxy case?
Happy holidays to you as well! |
My summary
The intention of this PR is to (start to) allow runcrate to support executions beyond CWL.
To do this I have added a converter object (base class
base.py
) from which specialised converters are derived (e.g.cwl.py
). I am hoping that by re-implementing the methods inbase.py
it will be relatively easy for people to add plugins for new languages.The
__init__.py
in the converters directory holds a dictionary of available plugins and allow the converter to be selected as a command line option.Otherwise the changes have been as minimal as possible, with all tests still passing. Only one new test is added as the CLI option defaults to using a CWL converter and as such the tested behaviour has not changed.
Copilot's summary (since it did such a nice job!)
This pull request introduces a new converter option for the CLI tool and refactors the code to support multiple converters. The most important changes include adding the converter option to the CLI, creating a base converter class, and updating tests to accommodate the new converter functionality.
CLI Enhancements:
src/runcrate/cli.py
: Added a new--converter
option to the CLI, allowing users to select from available converters. Updated theconvert
function to use the specified converter. [1] [2]Converter Implementation:
src/runcrate/converters/__init__.py
: Introduced aCONVERTERS
dictionary to manage available converters.src/runcrate/converters/base.py
: Created a baseconverter
class with placeholder methods for adding metadata, profiles, workflows, and other components to the crate.Constants Update:
src/runcrate/constants.py
: Added new constantsWROC_PROFILE_VERSION
andDOCKER_IMG_TYPE
.Testing Enhancements:
tests/test_cli.py
: Added a new testtest_cli_convert_with_cwl_converter_set_explictly
to verify the CLI functionality with thecwl
converter.tests/test_step_mapping.py
: Updated tests to use thecwlConverter
and added a pytest fixture for the converter. [1] [2]