Module eoap_cwlwrap.types
EOAP CWLWrap (c) 2025
EOAP CWLWrap is licensed under Creative Commons Attribution-ShareAlike 4.0 International.
You should have received a copy of the license along with this work. If not, see https://creativecommons.org/licenses/by-sa/4.0/.
Variables
Directory_or_File
A Directory Workflow or a File union type.
URL_SCHEMA
The URL of the string-format schema
URL_TYPE
The fully qualified name URI CWL type
Workflows
A single CWL Workflow or a list of Workflows union type.
Functions
get_assignable_type
def get_assignable_type(
actual: Any,
expected: Any
) -> Any
is_array_type
def is_array_type(
typ: Any
) -> bool
Detects if the actual type can be assignable to array
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be assignable to the array type, False otherwise. |
is_directory_compatible_type
def is_directory_compatible_type(
typ: Any
) -> bool
Detects if the actual type can be assignable to Directory
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be assignable to the Directory type, False otherwise. |
is_directory_or_file_compatible_type
def is_directory_or_file_compatible_type(
typ: Any
) -> bool
Detects if the actual type can be assignable to Directory
or File
types.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be assignable to the Directory or File types, False otherwise. |
is_file_compatible_type
def is_file_compatible_type(
typ: Any
) -> bool
Detects if the actual type can be assignable to File
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be assignable to the File type, False otherwise. |
is_nullable
def is_nullable(
typ: Any
) -> bool
Detects if the input type can be nullable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be nullable, False otherwise. |
is_type_assignable_to
def is_type_assignable_to(
actual: Any,
expected: Any
) -> bool
Detects if the actual type can be assignable to the expected type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actual |
Any |
Any CWL type | None |
actual |
expected |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the actual type can be assignable to the expected type, False otherwise. |
is_uri_compatible_type
def is_uri_compatible_type(
typ: Any
) -> bool
Detects if the actual type can be assignable to https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml#URI
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
bool |
True , if the input type can be assignable to https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml#URI type, False otherwise. |
replace_directory_with_url
def replace_directory_with_url(
typ: Any
) -> Any
Deep replaces the Directory
type in the source type with the https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml#URI
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
Any |
The new type. |
replace_type_with_url
def replace_type_with_url(
source: Any,
to_be_replaced: Any
) -> Any
Deep replaces any CWL type in the source type with the https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml#URI
type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source |
Any |
Any CWL type | None |
to_be_replaced |
Any |
The CWL type that has to be replaced | None |
Returns:
Type | Description |
---|---|
Any |
The new type. |
type_to_string
def type_to_string(
typ: Any
) -> str
Serializes a CWL type to a human-readable string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
typ |
Any |
Any CWL type | None |
Returns:
Type | Description |
---|---|
str |
The human-readable string representing the input CWL type. |
validate_directory_stage_in
def validate_directory_stage_in(
directory_stage_in: cwl_utils.parser.cwl_v1_2.Workflow
)
Checks if a CWL stage-in document is a URI
-compatible input and Directory
-compatible output Workflow
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory_stage_in |
Workflow |
Any CWL Workflow |
None |
Returns:
Type | Description |
---|---|
None |
none. |
validate_file_stage_in
def validate_file_stage_in(
file_stage_in: cwl_utils.parser.cwl_v1_2.Workflow
)
Checks if a CWL stage-in document is a URI
-compatible input and File
-compatible output Workflow
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_stage_in |
Workflow |
Any CWL Workflow |
None |
Returns:
Type | Description |
---|---|
None |
none. |
validate_stage_out
def validate_stage_out(
stage_out: cwl_utils.parser.cwl_v1_2.Workflow
)
Checks if a CWL stage-out document is a Directory
-compatible input and URI
-compatible output Workflow
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stage_out |
Workflow |
Any CWL Workflow |
None |
Returns:
Type | Description |
---|---|
None |
none. |