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.py script will be moved to galaxy/converter.py. A new script under cwl/converter.py will 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 (whether galaxy/converter.py or cwl/converter.py) should be invoked.
In the end, invoking the converter should look similar to:
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:
The most reasonable way to go around this would be to refactor
generator.py
following these guidelines:generator.py
script will be moved togalaxy/converter.py
. A new script undercwl/converter.py
will also be added.common
.convert.py
, should be created on the topmost level. This script will then decide which specific script (whethergalaxy/converter.py
orcwl/converter.py
) should be invoked.In the end, invoking the converter should look similar to:
That is, the first positional parameter will be the output format (either
galaxy
orcwl
), 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:After the refactoring, this will change to:
And in the case of CWL, it would look like: