Inspect, convert, and validate CWL parameter types for staging.
Directory_or_File = Directory | File
module-attribute
A Directory Workflow or a File union type.
URL_SCHEMA = 'https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml'
module-attribute
The URL of the string-format schema
URL_TYPE = f'{URL_SCHEMA}#URI'
module-attribute
The fully qualified name URI CWL type
is_nullable(typ)
Detects if the input type can be nullable.
| Returns: |
-
bool
–
True if the input type can be nullable, False otherwise.
|
is_type_assignable_to(actual, expected)
Detects if the actual type can be assignable to the expected type.
| Parameters: |
-
actual
(Any)
–
-
expected
(Any)
–
|
| Returns: |
-
bool
–
True if the actual type can be assigned to the expected type, False otherwise.
|
get_assignable_type(actual, expected)
is_directory_compatible_type(typ)
Detects if the actual type can be assignable to Directory type.
| Returns: |
-
bool
–
True if the input type can be assigned to Directory, False otherwise.
|
is_file_compatible_type(typ)
Detects if the actual type can be assignable to File type.
| Returns: |
-
bool
–
True if the input type can be assigned to File, False otherwise.
|
is_directory_or_file_compatible_type(typ)
Detects if the actual type can be assignable to Directory or File types.
| Returns: |
-
bool
–
True if the input type can be assigned to Directory or File, False otherwise.
|
is_uri_compatible_type(typ)
Detects if the actual type can be assignable to https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml#URI type.
| Returns: |
-
bool
–
True if the input type can be assigned to the EOAP URI type, False otherwise.
|
is_array_type(typ)
Detects if the actual type can be assignable to array type.
| Returns: |
-
bool
–
True if the input type can be assigned to an array type, False otherwise.
|
replace_type_with_url(source, to_be_replaced)
Replace matching CWL types recursively with the EOAP URI type.
| Parameters: |
-
source
(Any)
–
-
to_be_replaced
(Any)
–
The CWL type that has to be replaced.
|
replace_directory_with_url(typ)
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.
type_to_string(typ)
Serializes a CWL type to a human-readable string.
| Returns: |
-
str
–
The human-readable string representing the input CWL type.
|
validate_directory_stage_in(directory_stage_in)
Checks if a CWL stage-in document is a URI-compatible input and Directory-compatible output Process.
| Parameters: |
-
directory_stage_in
(Process)
–
|
validate_file_stage_in(file_stage_in)
Checks if a CWL stage-in document is a URI-compatible input and File-compatible output Process.
| Parameters: |
-
file_stage_in
(Process)
–
|
validate_directory_stage_out(directory_stage_out)
Checks if a CWL stage-out document is a Directory-compatible input and URI-compatible output Process.
| Parameters: |
-
directory_stage_out
(Process)
–
|
validate_file_stage_out(file_stage_out)
Checks if a CWL stage-out document is a File-compatible input and URI-compatible output Process.
| Parameters: |
-
file_stage_out
(Process)
–
|