mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
This is a slight tightening up of the ad-hoc, experimental workflow YAML definition used by the test framework (and by Kyle, but lets just admit Kyle is part of Galaxy's test framework). This format is still defined entirely client side by transcoding the YAML or python object description into real (or format 1) Galaxy workflows - so these cannot realisticaly be declared part of Galaxy's public interface and can remain experimental and subject to change. In addition to refactoring the code implementing these workflows for upstream modifications to explore new features, the format itself has been made slightly more stringent in two ways: - 'steps' must now be explicit (previously converted auto-convert list to dict). - Ensure the workflow declared a 'class' is defined and the class is 'GalaxyWorkflow'. This will help with discovery of workflow objects with downstream tooling (planemo for workflows?) and brings the Galaxy definition slightly more inline with the CWL definition for workflows (very slightly).
22 lines
603 B
Python
22 lines
603 B
Python
from .interface import BioBlendImporterGalaxyInterface
|
|
from .converter import yaml_to_workflow, python_to_workflow
|
|
|
|
|
|
def convert_and_import_workflow(has_workflow, **kwds):
|
|
"""
|
|
"""
|
|
galaxy_interface = kwds.get("galaxy_interface", None)
|
|
if galaxy_interface is None:
|
|
galaxy_interface = BioBlendImporterGalaxyInterface(**kwds)
|
|
|
|
if isinstance(has_workflow, dict):
|
|
workflow = python_to_workflow(has_workflow)
|
|
else:
|
|
workflow = yaml_to_workflow(has_workflow)
|
|
|
|
return galaxy_interface.import_workflow(workflow)
|
|
|
|
__all__ = [
|
|
'convert_and_import_workflow',
|
|
]
|