Array Inputs¶
Array Inputs refers to the 2.4.2. Array Inputs paragraph of the 2.4. Inputs chapter of the Common Workflow Language User Guide
1. Parsing¶
In this sample we'll show the access from a remote public URL.
In [1]:
Copied!
from cwl_loader import load_cwl_from_location
from cwl2ogc import BaseCWLtypes2OGCConverter
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/array-inputs.cwl"
)
cwl_converter = BaseCWLtypes2OGCConverter(cwl_document)
from cwl_loader import load_cwl_from_location
from cwl2ogc import BaseCWLtypes2OGCConverter
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/array-inputs.cwl"
)
cwl_converter = BaseCWLtypes2OGCConverter(cwl_document)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 2 1 from cwl_loader import load_cwl_from_location ----> 2 from cwl2ogc import BaseCWLtypes2OGCConverter 3 4 cwl_document = load_cwl_from_location( 5 "https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/array-inputs.cwl" ModuleNotFoundError: No module named 'cwl2ogc'
2. Inputs conversion¶
Once the document is parsed, invoke the cwl2ogc APIs to convert the CWL inputs to the OGC JSON format:
In [2]:
Copied!
import sys
cwl_converter.dump_inputs(stream=sys.stdout, pretty_print=True)
import sys
cwl_converter.dump_inputs(stream=sys.stdout, pretty_print=True)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[2], line 3 1 import sys 2 ----> 3 cwl_converter.dump_inputs(stream=sys.stdout, pretty_print=True) NameError: name 'cwl_converter' is not defined
3. Outputs conversion¶
Users can reuse the BaseCWLtypes2OGCConverter instance to convert the CWL outputs to the OGC JSON format:
In [3]:
Copied!
cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True)
cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[3], line 1 ----> 1 cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True) NameError: name 'cwl_converter' is not defined