Open
Labels
Description
The most reasonable way to go around this would be to refactor generator.py following these guidelines:
- Each supported format (Galaxy, CWL) should have its own folder, and each folder should contain a converter script.
- The
generator.pyscript will be moved togalaxy/converter.py. A new script undercwl/converter.pywill also be added. - All common functionality, such as CTD parsing, validation against a schema, logging, etc., should be housed in a separate folder, e.g.,
common. - The documentation will clearly define which parameters are required across all supported formats and which ones are specific for one format. This should also be reflected on the code.
- A main script,
convert.py, should be created on the topmost level. This script will then decide which specific script (whethergalaxy/converter.pyorcwl/converter.py) should be invoked.
In the end, invoking the converter should look similar to:
$ python convert.py [FORMAT] [ADDITIONAL_ARGUMENTS ...]
That is, the first positional parameter will be the output format (either galaxy or cwl), while the rest of the arguments should not be modified in order to keep current functionality (i.e., generating Galaxy ToolConfig files). In other words, this is how a single CTD file is converted into a ToolConfig file:
$ python generator.py -i tool.ctd -o tool.xml
After the refactoring, this will change to:
$ python convert.py galaxy -i tool.ctd -o tool.xml
And in the case of CWL, it would look like:
$ python convert.py cwl -i tool.ctd -o tool.cwl
Reacted by Björn Grüning and Michael R. Crusoe
Activity
mr-c commentedon Feb 18, 2018
Hey @chahuistle et all., thank you for all your work on this!