예제 #1
0
    def construct_tool_object(toolpath_object, *args, **kwargs):
        """Fix missing locations."""
        protocol = "file://"

        def addLocation(d):
            if "location" not in d and "path" in d:
                d["location"] = protocol + d["path"]

        visit_class(toolpath_object, ("File", "Directory"), addLocation)
        return workflow.default_make_tool(toolpath_object, *args, **kwargs)
예제 #2
0
파일: _cwl.py 프로젝트: jsam/renku-python
    def construct_tool_object(toolpath_object, *args, **kwargs):
        """Fix missing locations."""
        protocol = 'file://'

        def addLocation(d):
            if 'location' not in d and 'path' in d:
                d['location'] = protocol + d['path']

        visit_class(toolpath_object, ('File', 'Directory'), addLocation)
        return workflow.default_make_tool(toolpath_object, *args, **kwargs)
예제 #3
0
파일: tool.py 프로젝트: x-native/calrissian
def calrissian_make_tool(spec, loadingContext):
    """
    Construct a Process object from a CWL document loaded into spec
    :param spec:
    :param loadingContext:
    :return: For CommandLineTools, return our specialized subclass that can run on k8s.
    For other types of documents, return the CWL default_make_tool
    """
    if "class" in spec and spec["class"] == "CommandLineTool":
        return CalrissianCommandLineTool(spec, loadingContext)
    else:
        return default_make_tool(spec, loadingContext)
예제 #4
0
def make_custom_tool(spec, loading_context, exec_profile_class, workflow_metadata):
    """
        custom tool maker: 
            only use ExecProfileCommandlineTool if spec if the spec is a "CommandLineTool",
            otherwise use the cwltool's standard tool maker
    """
    if "class" in spec and spec["class"] == "CommandLineTool":
        return ExecProfileCommandlineTool(
            spec, 
            loading_context, 
            exec_profile_class, 
            workflow_metadata
        )
    return default_make_tool(spec, loading_context)
예제 #5
0
def make_tes_tool(spec, loading_context, url):
    if "class" in spec and spec["class"] == "CommandLineTool":
        return TESCommandLineTool(spec, loading_context, url)
    else:
        return default_make_tool(spec, loading_context)
예제 #6
0
def make_tes_tool(spec, loading_context, url, remote_storage_url, token):
    """cwl-tes specific factory for CWL Process generation."""
    if "class" in spec and spec["class"] == "CommandLineTool":
        return TESCommandLineTool(spec, loading_context, url,
                                  remote_storage_url, token)
    return default_make_tool(spec, loading_context)
예제 #7
0
 def make_tool(self, spec, loadingContext):
     """Make tool."""
     if "class" in spec and spec["class"] == "CommandLineTool":
         return self.make_exec_tool(spec, loadingContext)
     else:
         return default_make_tool(spec, loadingContext)