arctrl 3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arctrl/__init__.py +23 -0
- arctrl/cwl.py +12 -0
- arctrl/py/CWL/__init__.py +0 -0
- arctrl/py/CWL/cwlprocessing_unit.py +221 -0
- arctrl/py/CWL/cwltypes.py +364 -0
- arctrl/py/CWL/decode.py +3532 -0
- arctrl/py/CWL/encode.py +1905 -0
- arctrl/py/CWL/expression_tool_description.py +192 -0
- arctrl/py/CWL/hash_helpers.py +60 -0
- arctrl/py/CWL/inputs.py +122 -0
- arctrl/py/CWL/operation_description.py +169 -0
- arctrl/py/CWL/outputs.py +171 -0
- arctrl/py/CWL/parameter_reference.py +74 -0
- arctrl/py/CWL/requirements.py +350 -0
- arctrl/py/CWL/tool_description.py +192 -0
- arctrl/py/CWL/workflow_description.py +181 -0
- arctrl/py/CWL/workflow_steps.py +354 -0
- arctrl/py/Contract/__init__.py +0 -0
- arctrl/py/Contract/arc.py +89 -0
- arctrl/py/Contract/arc_assay.py +125 -0
- arctrl/py/Contract/arc_investigation.py +88 -0
- arctrl/py/Contract/arc_run.py +291 -0
- arctrl/py/Contract/arc_study.py +126 -0
- arctrl/py/Contract/arc_workflow.py +213 -0
- arctrl/py/Contract/contract.py +153 -0
- arctrl/py/Contract/datamap.py +396 -0
- arctrl/py/Contract/git.py +116 -0
- arctrl/py/Contract/license.py +58 -0
- arctrl/py/Contract/validation_packages_config.py +107 -0
- arctrl/py/ContractIO/__init__.py +0 -0
- arctrl/py/ContractIO/contract_io.py +350 -0
- arctrl/py/ContractIO/file_system_helper.py +264 -0
- arctrl/py/Conversion/__init__.py +0 -0
- arctrl/py/Conversion/assay.py +151 -0
- arctrl/py/Conversion/basic.py +559 -0
- arctrl/py/Conversion/column_index.py +91 -0
- arctrl/py/Conversion/datamap.py +36 -0
- arctrl/py/Conversion/date_time.py +32 -0
- arctrl/py/Conversion/investigation.py +171 -0
- arctrl/py/Conversion/person.py +148 -0
- arctrl/py/Conversion/process.py +828 -0
- arctrl/py/Conversion/run.py +367 -0
- arctrl/py/Conversion/scholarly_article.py +163 -0
- arctrl/py/Conversion/study.py +99 -0
- arctrl/py/Conversion/table.py +229 -0
- arctrl/py/Conversion/workflow.py +680 -0
- arctrl/py/Core/Helper/__init__.py +0 -0
- arctrl/py/Core/Helper/collections_.py +512 -0
- arctrl/py/Core/Helper/date_time.py +26 -0
- arctrl/py/Core/Helper/hash_codes.py +60 -0
- arctrl/py/Core/Helper/identifier.py +290 -0
- arctrl/py/Core/Helper/orcid.py +42 -0
- arctrl/py/Core/Helper/printer.py +13 -0
- arctrl/py/Core/Helper/regex.py +554 -0
- arctrl/py/Core/Helper/sem_ver.py +71 -0
- arctrl/py/Core/Helper/url.py +148 -0
- arctrl/py/Core/Process/__init__.py +0 -0
- arctrl/py/Core/Process/column_index.py +280 -0
- arctrl/py/Core/Process/component.py +200 -0
- arctrl/py/Core/Process/factor.py +151 -0
- arctrl/py/Core/Process/factor_value.py +182 -0
- arctrl/py/Core/Process/material.py +74 -0
- arctrl/py/Core/Process/material_attribute.py +95 -0
- arctrl/py/Core/Process/material_attribute_value.py +184 -0
- arctrl/py/Core/Process/material_type.py +45 -0
- arctrl/py/Core/Process/process.py +477 -0
- arctrl/py/Core/Process/process_input.py +265 -0
- arctrl/py/Core/Process/process_output.py +235 -0
- arctrl/py/Core/Process/process_parameter_value.py +200 -0
- arctrl/py/Core/Process/process_sequence.py +435 -0
- arctrl/py/Core/Process/protocol.py +175 -0
- arctrl/py/Core/Process/protocol_parameter.py +98 -0
- arctrl/py/Core/Process/sample.py +82 -0
- arctrl/py/Core/Process/source.py +62 -0
- arctrl/py/Core/Table/__init__.py +0 -0
- arctrl/py/Core/Table/arc_table.py +1206 -0
- arctrl/py/Core/Table/arc_table_aux.py +1308 -0
- arctrl/py/Core/Table/arc_tables.py +574 -0
- arctrl/py/Core/Table/composite_cell.py +319 -0
- arctrl/py/Core/Table/composite_column.py +73 -0
- arctrl/py/Core/Table/composite_header.py +739 -0
- arctrl/py/Core/__init__.py +0 -0
- arctrl/py/Core/arc_types.py +5312 -0
- arctrl/py/Core/comment.py +128 -0
- arctrl/py/Core/comment_list.py +127 -0
- arctrl/py/Core/conversion.py +1375 -0
- arctrl/py/Core/data.py +247 -0
- arctrl/py/Core/data_context.py +157 -0
- arctrl/py/Core/data_file.py +112 -0
- arctrl/py/Core/datamap.py +217 -0
- arctrl/py/Core/identifier_setters.py +43 -0
- arctrl/py/Core/iproperty_value.py +36 -0
- arctrl/py/Core/ontology_annotation.py +298 -0
- arctrl/py/Core/ontology_source_reference.py +114 -0
- arctrl/py/Core/person.py +259 -0
- arctrl/py/Core/publication.py +161 -0
- arctrl/py/Core/template.py +231 -0
- arctrl/py/Core/templates.py +148 -0
- arctrl/py/Core/uri.py +11 -0
- arctrl/py/Core/value.py +188 -0
- arctrl/py/FileSystem/__init__.py +0 -0
- arctrl/py/FileSystem/commit.py +21 -0
- arctrl/py/FileSystem/default_gitattributes.py +1 -0
- arctrl/py/FileSystem/default_gitignore.py +1 -0
- arctrl/py/FileSystem/default_license.py +1 -0
- arctrl/py/FileSystem/file_system.py +58 -0
- arctrl/py/FileSystem/file_system_tree.py +483 -0
- arctrl/py/FileSystem/path.py +266 -0
- arctrl/py/Json/Datamap/__init__.py +0 -0
- arctrl/py/Json/Datamap/data_context.py +101 -0
- arctrl/py/Json/Datamap/datamap.py +53 -0
- arctrl/py/Json/Process/__init__.py +0 -0
- arctrl/py/Json/Process/assay_materials.py +46 -0
- arctrl/py/Json/Process/component.py +125 -0
- arctrl/py/Json/Process/factor.py +107 -0
- arctrl/py/Json/Process/factor_value.py +101 -0
- arctrl/py/Json/Process/material.py +226 -0
- arctrl/py/Json/Process/material_attribute.py +79 -0
- arctrl/py/Json/Process/material_attribute_value.py +101 -0
- arctrl/py/Json/Process/material_type.py +53 -0
- arctrl/py/Json/Process/process.py +296 -0
- arctrl/py/Json/Process/process_input.py +83 -0
- arctrl/py/Json/Process/process_output.py +67 -0
- arctrl/py/Json/Process/process_parameter_value.py +81 -0
- arctrl/py/Json/Process/protocol.py +354 -0
- arctrl/py/Json/Process/protocol_parameter.py +91 -0
- arctrl/py/Json/Process/sample.py +277 -0
- arctrl/py/Json/Process/source.py +214 -0
- arctrl/py/Json/Process/study_materials.py +52 -0
- arctrl/py/Json/Process/value.py +56 -0
- arctrl/py/Json/ROCrate/__init__.py +0 -0
- arctrl/py/Json/ROCrate/ldcontext.py +143 -0
- arctrl/py/Json/ROCrate/ldgraph.py +117 -0
- arctrl/py/Json/ROCrate/ldnode.py +304 -0
- arctrl/py/Json/ROCrate/ldref.py +44 -0
- arctrl/py/Json/ROCrate/ldvalue.py +102 -0
- arctrl/py/Json/Table/__init__.py +0 -0
- arctrl/py/Json/Table/arc_table.py +375 -0
- arctrl/py/Json/Table/cell_table.py +83 -0
- arctrl/py/Json/Table/composite_cell.py +136 -0
- arctrl/py/Json/Table/composite_header.py +67 -0
- arctrl/py/Json/Table/iotype.py +24 -0
- arctrl/py/Json/Table/oatable.py +82 -0
- arctrl/py/Json/Table/templates.py +281 -0
- arctrl/py/Json/__init__.py +0 -0
- arctrl/py/Json/assay.py +600 -0
- arctrl/py/Json/comment.py +206 -0
- arctrl/py/Json/context/rocrate/__init__.py +0 -0
- arctrl/py/Json/context/rocrate/isa_assay_context.py +101 -0
- arctrl/py/Json/context/rocrate/isa_comment_context.py +60 -0
- arctrl/py/Json/context/rocrate/isa_component_context.py +77 -0
- arctrl/py/Json/context/rocrate/isa_data_context.py +74 -0
- arctrl/py/Json/context/rocrate/isa_factor_context.py +74 -0
- arctrl/py/Json/context/rocrate/isa_factor_value_context.py +84 -0
- arctrl/py/Json/context/rocrate/isa_investigation_context.py +110 -0
- arctrl/py/Json/context/rocrate/isa_material_attribute_context.py +64 -0
- arctrl/py/Json/context/rocrate/isa_material_attribute_value_context.py +80 -0
- arctrl/py/Json/context/rocrate/isa_material_context.py +71 -0
- arctrl/py/Json/context/rocrate/isa_ontology_annotation_context.py +68 -0
- arctrl/py/Json/context/rocrate/isa_ontology_source_reference_context.py +75 -0
- arctrl/py/Json/context/rocrate/isa_organization_context.py +55 -0
- arctrl/py/Json/context/rocrate/isa_person_context.py +131 -0
- arctrl/py/Json/context/rocrate/isa_process_context.py +94 -0
- arctrl/py/Json/context/rocrate/isa_process_parameter_value_context.py +80 -0
- arctrl/py/Json/context/rocrate/isa_protocol_context.py +97 -0
- arctrl/py/Json/context/rocrate/isa_protocol_parameter_context.py +64 -0
- arctrl/py/Json/context/rocrate/isa_publication_context.py +78 -0
- arctrl/py/Json/context/rocrate/isa_sample_context.py +65 -0
- arctrl/py/Json/context/rocrate/isa_source_context.py +66 -0
- arctrl/py/Json/context/rocrate/isa_study_context.py +125 -0
- arctrl/py/Json/context/rocrate/property_value_context.py +73 -0
- arctrl/py/Json/context/rocrate/rocrate_context.py +81 -0
- arctrl/py/Json/converter_options.py +23 -0
- arctrl/py/Json/data.py +356 -0
- arctrl/py/Json/data_file.py +63 -0
- arctrl/py/Json/decode.py +271 -0
- arctrl/py/Json/encode.py +140 -0
- arctrl/py/Json/idtable.py +44 -0
- arctrl/py/Json/investigation.py +695 -0
- arctrl/py/Json/ontology_annotation.py +404 -0
- arctrl/py/Json/ontology_source_reference.py +255 -0
- arctrl/py/Json/person.py +658 -0
- arctrl/py/Json/property_value.py +359 -0
- arctrl/py/Json/publication.py +279 -0
- arctrl/py/Json/run.py +275 -0
- arctrl/py/Json/string_table.py +87 -0
- arctrl/py/Json/study.py +793 -0
- arctrl/py/Json/workflow.py +307 -0
- arctrl/py/JsonIO/Process/__init__.py +0 -0
- arctrl/py/JsonIO/Process/component.py +60 -0
- arctrl/py/JsonIO/Process/factor.py +36 -0
- arctrl/py/JsonIO/Process/factor_value.py +38 -0
- arctrl/py/JsonIO/Process/material.py +60 -0
- arctrl/py/JsonIO/Process/material_attribute.py +38 -0
- arctrl/py/JsonIO/Process/material_attribute_value.py +60 -0
- arctrl/py/JsonIO/Process/material_type.py +36 -0
- arctrl/py/JsonIO/Process/process.py +60 -0
- arctrl/py/JsonIO/Process/process_input.py +38 -0
- arctrl/py/JsonIO/Process/process_output.py +60 -0
- arctrl/py/JsonIO/Process/process_parameter_value.py +60 -0
- arctrl/py/JsonIO/Process/process_sequence.py +71 -0
- arctrl/py/JsonIO/Process/protocol.py +60 -0
- arctrl/py/JsonIO/Process/protocol_parameter.py +36 -0
- arctrl/py/JsonIO/Process/sample.py +60 -0
- arctrl/py/JsonIO/Process/source.py +60 -0
- arctrl/py/JsonIO/Process/study_materials.py +52 -0
- arctrl/py/JsonIO/Process/value.py +32 -0
- arctrl/py/JsonIO/Table/__init__.py +0 -0
- arctrl/py/JsonIO/Table/arc_table.py +103 -0
- arctrl/py/JsonIO/Table/composite_cell.py +36 -0
- arctrl/py/JsonIO/Table/composite_header.py +36 -0
- arctrl/py/JsonIO/Table/compression.py +67 -0
- arctrl/py/JsonIO/Table/iotype.py +36 -0
- arctrl/py/JsonIO/Table/templates.py +113 -0
- arctrl/py/JsonIO/__init__.py +0 -0
- arctrl/py/JsonIO/assay.py +113 -0
- arctrl/py/JsonIO/comment.py +80 -0
- arctrl/py/JsonIO/data.py +60 -0
- arctrl/py/JsonIO/data_file.py +58 -0
- arctrl/py/JsonIO/datamap.py +36 -0
- arctrl/py/JsonIO/decode.py +9 -0
- arctrl/py/JsonIO/encode.py +1 -0
- arctrl/py/JsonIO/investigation.py +91 -0
- arctrl/py/JsonIO/ldobject.py +106 -0
- arctrl/py/JsonIO/ontology_annotation.py +80 -0
- arctrl/py/JsonIO/ontology_source_reference.py +80 -0
- arctrl/py/JsonIO/person.py +82 -0
- arctrl/py/JsonIO/publication.py +82 -0
- arctrl/py/JsonIO/run.py +68 -0
- arctrl/py/JsonIO/study.py +114 -0
- arctrl/py/JsonIO/workflow.py +68 -0
- arctrl/py/ROCrate/ISAProfile/__init__.py +0 -0
- arctrl/py/ROCrate/ISAProfile/assay.py +70 -0
- arctrl/py/ROCrate/ISAProfile/data.py +65 -0
- arctrl/py/ROCrate/ISAProfile/dataset.py +24 -0
- arctrl/py/ROCrate/ISAProfile/investigation.py +73 -0
- arctrl/py/ROCrate/ISAProfile/lab_process.py +162 -0
- arctrl/py/ROCrate/ISAProfile/lab_protocol.py +37 -0
- arctrl/py/ROCrate/ISAProfile/person.py +72 -0
- arctrl/py/ROCrate/ISAProfile/property_value.py +98 -0
- arctrl/py/ROCrate/ISAProfile/sample.py +64 -0
- arctrl/py/ROCrate/ISAProfile/scholarly_article.py +98 -0
- arctrl/py/ROCrate/ISAProfile/study.py +74 -0
- arctrl/py/ROCrate/LDTypes/__init__.py +0 -0
- arctrl/py/ROCrate/LDTypes/comment.py +131 -0
- arctrl/py/ROCrate/LDTypes/computational_workflow.py +455 -0
- arctrl/py/ROCrate/LDTypes/computer_language.py +269 -0
- arctrl/py/ROCrate/LDTypes/create_action.py +303 -0
- arctrl/py/ROCrate/LDTypes/creative_work.py +566 -0
- arctrl/py/ROCrate/LDTypes/dataset.py +943 -0
- arctrl/py/ROCrate/LDTypes/defined_term.py +131 -0
- arctrl/py/ROCrate/LDTypes/file.py +281 -0
- arctrl/py/ROCrate/LDTypes/formal_parameter.py +431 -0
- arctrl/py/ROCrate/LDTypes/lab_process.py +352 -0
- arctrl/py/ROCrate/LDTypes/lab_protocol.py +395 -0
- arctrl/py/ROCrate/LDTypes/organization.py +83 -0
- arctrl/py/ROCrate/LDTypes/person.py +484 -0
- arctrl/py/ROCrate/LDTypes/postal_address.py +195 -0
- arctrl/py/ROCrate/LDTypes/property_value.py +952 -0
- arctrl/py/ROCrate/LDTypes/sample.py +202 -0
- arctrl/py/ROCrate/LDTypes/scholarly_article.py +229 -0
- arctrl/py/ROCrate/LDTypes/software_source_code.py +310 -0
- arctrl/py/ROCrate/LDTypes/workflow_invocation.py +48 -0
- arctrl/py/ROCrate/LDTypes/workflow_protocol.py +52 -0
- arctrl/py/ROCrate/__init__.py +0 -0
- arctrl/py/ROCrate/arc_rocrate_metadata.py +39 -0
- arctrl/py/ROCrate/dyn_obj_extensions.py +1 -0
- arctrl/py/ROCrate/helper.py +8 -0
- arctrl/py/ROCrate/ldcontext.py +406 -0
- arctrl/py/ROCrate/ldobject.py +1247 -0
- arctrl/py/ROCrate/rocrate_context.py +51 -0
- arctrl/py/Spreadsheet/AnnotationTable/__init__.py +0 -0
- arctrl/py/Spreadsheet/AnnotationTable/arc_table.py +203 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +305 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
- arctrl/py/Spreadsheet/DatamapTable/__init__.py +0 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_column.py +114 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_header.py +621 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_table.py +118 -0
- arctrl/py/Spreadsheet/Metadata/__init__.py +0 -0
- arctrl/py/Spreadsheet/Metadata/assays.py +125 -0
- arctrl/py/Spreadsheet/Metadata/comment.py +77 -0
- arctrl/py/Spreadsheet/Metadata/contacts.py +134 -0
- arctrl/py/Spreadsheet/Metadata/conversions.py +190 -0
- arctrl/py/Spreadsheet/Metadata/design_descriptors.py +34 -0
- arctrl/py/Spreadsheet/Metadata/factors.py +107 -0
- arctrl/py/Spreadsheet/Metadata/ontology_annotation.py +88 -0
- arctrl/py/Spreadsheet/Metadata/ontology_source_reference.py +96 -0
- arctrl/py/Spreadsheet/Metadata/protocols.py +146 -0
- arctrl/py/Spreadsheet/Metadata/publication.py +122 -0
- arctrl/py/Spreadsheet/Metadata/run.py +122 -0
- arctrl/py/Spreadsheet/Metadata/sparse_table.py +499 -0
- arctrl/py/Spreadsheet/Metadata/study.py +312 -0
- arctrl/py/Spreadsheet/Metadata/workflow.py +159 -0
- arctrl/py/Spreadsheet/__init__.py +0 -0
- arctrl/py/Spreadsheet/arc_assay.py +233 -0
- arctrl/py/Spreadsheet/arc_investigation.py +435 -0
- arctrl/py/Spreadsheet/arc_run.py +190 -0
- arctrl/py/Spreadsheet/arc_study.py +144 -0
- arctrl/py/Spreadsheet/arc_workflow.py +177 -0
- arctrl/py/Spreadsheet/assembly_info.py +1 -0
- arctrl/py/Spreadsheet/collection_aux.py +167 -0
- arctrl/py/Spreadsheet/datamap.py +43 -0
- arctrl/py/Spreadsheet/template.py +460 -0
- arctrl/py/ValidationPackages/__init__.py +0 -0
- arctrl/py/ValidationPackages/validation_package.py +82 -0
- arctrl/py/ValidationPackages/validation_packages_config.py +132 -0
- arctrl/py/WebRequest/__init__.py +0 -0
- arctrl/py/WebRequest/web_request.py +9 -0
- arctrl/py/WebRequest/web_request_py.py +135 -0
- arctrl/py/WorkflowGraph/__init__.py +0 -0
- arctrl/py/WorkflowGraph/adapters.py +141 -0
- arctrl/py/WorkflowGraph/build_options.py +45 -0
- arctrl/py/WorkflowGraph/builder.py +720 -0
- arctrl/py/WorkflowGraph/graph_types.py +260 -0
- arctrl/py/WorkflowGraph/query_helpers.py +76 -0
- arctrl/py/WorkflowGraph/reference_parsing.py +59 -0
- arctrl/py/WorkflowGraph/visualization_siren.py +574 -0
- arctrl/py/WorkflowGraph/workflow_graph.py +119 -0
- arctrl/py/Yaml/__init__.py +0 -0
- arctrl/py/Yaml/decode.py +1 -0
- arctrl/py/Yaml/encode.py +10 -0
- arctrl/py/Yaml/validation_package.py +77 -0
- arctrl/py/Yaml/validation_packages_config.py +86 -0
- arctrl/py/__init__.py +0 -0
- arctrl/py/arc.py +1891 -0
- arctrl/py/column_index.py +280 -0
- arctrl/py/conversion.py +142 -0
- arctrl/py/cross_async.py +76 -0
- arctrl/py/cwlrun_resolver.py +228 -0
- arctrl/py/fable_modules/dynamic_obj/__init__.py +0 -0
- arctrl/py/fable_modules/dynamic_obj/dyn_obj.py +136 -0
- arctrl/py/fable_modules/dynamic_obj/dynamic_obj.py +415 -0
- arctrl/py/fable_modules/dynamic_obj/fable_js.py +1 -0
- arctrl/py/fable_modules/dynamic_obj/fable_py.py +288 -0
- arctrl/py/fable_modules/dynamic_obj/hash_codes.py +82 -0
- arctrl/py/fable_modules/dynamic_obj/property_helper.py +25 -0
- arctrl/py/fable_modules/dynamic_obj/reflection_utils.py +87 -0
- arctrl/py/fable_modules/fable_library/__init__.py +0 -0
- arctrl/py/fable_modules/fable_library/array_.py +1528 -0
- arctrl/py/fable_modules/fable_library/async_.py +377 -0
- arctrl/py/fable_modules/fable_library/async_builder.py +379 -0
- arctrl/py/fable_modules/fable_library/big_int.py +330 -0
- arctrl/py/fable_modules/fable_library/bit_converter.py +131 -0
- arctrl/py/fable_modules/fable_library/boolean.py +26 -0
- arctrl/py/fable_modules/fable_library/char.py +237 -0
- arctrl/py/fable_modules/fable_library/choice.py +212 -0
- arctrl/py/fable_modules/fable_library/date.py +779 -0
- arctrl/py/fable_modules/fable_library/date_offset.py +79 -0
- arctrl/py/fable_modules/fable_library/decimal_.py +190 -0
- arctrl/py/fable_modules/fable_library/diagnostics.py +54 -0
- arctrl/py/fable_modules/fable_library/double.py +87 -0
- arctrl/py/fable_modules/fable_library/encoding.py +41 -0
- arctrl/py/fable_modules/fable_library/event.py +206 -0
- arctrl/py/fable_modules/fable_library/file.py +107 -0
- arctrl/py/fable_modules/fable_library/fsharp_collections.py +52 -0
- arctrl/py/fable_modules/fable_library/fsharp_core.py +123 -0
- arctrl/py/fable_modules/fable_library/global_.py +63 -0
- arctrl/py/fable_modules/fable_library/guid.py +41 -0
- arctrl/py/fable_modules/fable_library/int32.py +73 -0
- arctrl/py/fable_modules/fable_library/list.py +1788 -0
- arctrl/py/fable_modules/fable_library/long.py +240 -0
- arctrl/py/fable_modules/fable_library/mailbox_processor.py +179 -0
- arctrl/py/fable_modules/fable_library/map.py +1854 -0
- arctrl/py/fable_modules/fable_library/map_util.py +148 -0
- arctrl/py/fable_modules/fable_library/mutable_map.py +397 -0
- arctrl/py/fable_modules/fable_library/mutable_set.py +279 -0
- arctrl/py/fable_modules/fable_library/native.py +45 -0
- arctrl/py/fable_modules/fable_library/numeric.py +46 -0
- arctrl/py/fable_modules/fable_library/observable.py +222 -0
- arctrl/py/fable_modules/fable_library/option.py +128 -0
- arctrl/py/fable_modules/fable_library/path.py +62 -0
- arctrl/py/fable_modules/fable_library/range.py +117 -0
- arctrl/py/fable_modules/fable_library/reflection.py +463 -0
- arctrl/py/fable_modules/fable_library/reg_exp.py +137 -0
- arctrl/py/fable_modules/fable_library/resize_array.py +31 -0
- arctrl/py/fable_modules/fable_library/result.py +212 -0
- arctrl/py/fable_modules/fable_library/seq.py +1979 -0
- arctrl/py/fable_modules/fable_library/seq2.py +221 -0
- arctrl/py/fable_modules/fable_library/set.py +2414 -0
- arctrl/py/fable_modules/fable_library/singleton_local_time_zone.py +36 -0
- arctrl/py/fable_modules/fable_library/string_.py +573 -0
- arctrl/py/fable_modules/fable_library/system_collections_generic.py +462 -0
- arctrl/py/fable_modules/fable_library/system_text.py +237 -0
- arctrl/py/fable_modules/fable_library/task.py +116 -0
- arctrl/py/fable_modules/fable_library/task_builder.py +122 -0
- arctrl/py/fable_modules/fable_library/thread.py +5 -0
- arctrl/py/fable_modules/fable_library/time_span.py +283 -0
- arctrl/py/fable_modules/fable_library/timer.py +24 -0
- arctrl/py/fable_modules/fable_library/types.py +401 -0
- arctrl/py/fable_modules/fable_library/uri.py +109 -0
- arctrl/py/fable_modules/fable_library/util.py +2735 -0
- arctrl/py/fable_modules/fable_openpyxl/__init__.py +0 -0
- arctrl/py/fable_modules/fable_openpyxl/openpyxl.py +362 -0
- arctrl/py/fable_modules/fable_python/cognite-sdk/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/cognite-sdk/cognite_sdk.py +22 -0
- arctrl/py/fable_modules/fable_python/flask/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/flask/flask.py +34 -0
- arctrl/py/fable_modules/fable_python/jupyter/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/jupyter/ipy_widgets.py +47 -0
- arctrl/py/fable_modules/fable_python/jupyter/ipython.py +13 -0
- arctrl/py/fable_modules/fable_python/stdlib/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/stdlib/ast.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/events.py +17 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/futures.py +52 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/tasks.py +38 -0
- arctrl/py/fable_modules/fable_python/stdlib/base64_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/builtins_.py +38 -0
- arctrl/py/fable_modules/fable_python/stdlib/html.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/json.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/math_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/os_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/queue_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/string_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/sys_.py +30 -0
- arctrl/py/fable_modules/fable_python/stdlib/time_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/tk_inter.py +1 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cell.py +340 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +466 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/cell_builder.py +214 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/column_builder.py +139 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/dsl.py +50 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/expression.py +65 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/operators.py +9 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/row_builder.py +139 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/sheet_builder.py +118 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/table_builder.py +122 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/transform.py +463 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/types.py +314 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/workbook_builder.py +106 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/cell.py +103 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/column.py +70 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/row.py +70 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/table.py +54 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/value.py +93 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/workbook.py +71 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/worksheet.py +216 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +43 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +190 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +92 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +77 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_row.py +48 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table.py +461 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +117 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_row.py +23 -0
- arctrl/py/fable_modules/fs_spreadsheet/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_address.py +236 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_column.py +172 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_row.py +183 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_workbook.py +192 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +610 -0
- arctrl/py/fable_modules/fs_spreadsheet/hash_codes.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +329 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/cell_type.py +50 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/fs_extension.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/json.py +47 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/table.py +54 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +41 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +52 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
- arctrl/py/fable_modules/siren/__init__.py +0 -0
- arctrl/py/fable_modules/siren/config.py +1038 -0
- arctrl/py/fable_modules/siren/formatting.py +1121 -0
- arctrl/py/fable_modules/siren/siren.py +1941 -0
- arctrl/py/fable_modules/siren/siren_types.py +1229 -0
- arctrl/py/fable_modules/siren/theme_variables.py +517 -0
- arctrl/py/fable_modules/siren/util.py +37 -0
- arctrl/py/fable_modules/siren/yaml.py +101 -0
- arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
- arctrl/py/fable_modules/thoth_json_core/decode.py +1614 -0
- arctrl/py/fable_modules/thoth_json_core/encode.py +305 -0
- arctrl/py/fable_modules/thoth_json_core/types.py +181 -0
- arctrl/py/fable_modules/thoth_json_python/__init__.py +0 -0
- arctrl/py/fable_modules/thoth_json_python/decode.py +112 -0
- arctrl/py/fable_modules/thoth_json_python/encode.py +72 -0
- arctrl/py/fable_modules/thoth_json_python/python.py +1 -0
- arctrl/py/fable_modules/yamlicious/Interop/__init__.py +0 -0
- arctrl/py/fable_modules/yamlicious/Interop/js_interop.py +1 -0
- arctrl/py/fable_modules/yamlicious/Interop/py_interop.py +7 -0
- arctrl/py/fable_modules/yamlicious/__init__.py +0 -0
- arctrl/py/fable_modules/yamlicious/decode.py +1784 -0
- arctrl/py/fable_modules/yamlicious/encode.py +84 -0
- arctrl/py/fable_modules/yamlicious/flow_to_block.py +994 -0
- arctrl/py/fable_modules/yamlicious/library.py +10 -0
- arctrl/py/fable_modules/yamlicious/persil.py +57 -0
- arctrl/py/fable_modules/yamlicious/preprocessing.py +99 -0
- arctrl/py/fable_modules/yamlicious/reader.py +739 -0
- arctrl/py/fable_modules/yamlicious/regex.py +29 -0
- arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +265 -0
- arctrl/py/fable_modules/yamlicious/writer.py +175 -0
- arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
- arctrl/py/json.py +389 -0
- arctrl/py/license.py +169 -0
- arctrl/py/rocrate_io.py +242 -0
- arctrl/py/template_web.py +23 -0
- arctrl/py/xlsx.py +212 -0
- arctrl/py/yaml.py +79 -0
- arctrl/rocrate.py +21 -0
- arctrl-3.0.0.dist-info/METADATA +157 -0
- arctrl-3.0.0.dist-info/RECORD +511 -0
- arctrl-3.0.0.dist-info/WHEEL +4 -0
- arctrl-3.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,720 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
from ..fable_modules.dynamic_obj.dynamic_obj import DynamicObj
|
|
6
|
+
from ..fable_modules.dynamic_obj.dyn_obj import set_property
|
|
7
|
+
from ..fable_modules.fable_library.array_ import (filter, map as map_1, try_pick as try_pick_1)
|
|
8
|
+
from ..fable_modules.fable_library.list import (FSharpList, of_array, try_pick, singleton)
|
|
9
|
+
from ..fable_modules.fable_library.map import (empty as empty_1, FSharpMap__ContainsKey, FSharpMap__get_Item, FSharpMap__Add, try_find)
|
|
10
|
+
from ..fable_modules.fable_library.option import (value as value_9, map, default_arg, bind, some)
|
|
11
|
+
from ..fable_modules.fable_library.reflection import (TypeInfo, string_type, class_type, record_type, option_type, bool_type, array_type)
|
|
12
|
+
from ..fable_modules.fable_library.seq import (to_array, iterate, try_head, to_list, delay, singleton as singleton_1)
|
|
13
|
+
from ..fable_modules.fable_library.seq2 import Array_distinct
|
|
14
|
+
from ..fable_modules.fable_library.set import (empty, FSharpSet__Contains, FSharpSet__Add)
|
|
15
|
+
from ..fable_modules.fable_library.string_ import (is_null_or_white_space, starts_with_exact, substring, ends_with)
|
|
16
|
+
from ..fable_modules.fable_library.types import (Record, Array)
|
|
17
|
+
from ..fable_modules.fable_library.util import (compare_primitives, get_enumerator, ignore, string_hash, IEnumerable_1, dispose)
|
|
18
|
+
from ..CWL.cwlprocessing_unit import (CWLProcessingUnit, WorkflowStepRunOps_fromWorkflow, WorkflowStepRunOps_fromExpressionTool, WorkflowStepRunOps_fromOperation, WorkflowStepRunOps_fromTool, WorkflowStepRunOps_tryGetTool, WorkflowStepRunOps_tryGetWorkflow, WorkflowStepRunOps_tryGetExpressionTool, WorkflowStepRunOps_tryGetOperation)
|
|
19
|
+
from ..CWL.expression_tool_description import CWLExpressionToolDescription
|
|
20
|
+
from ..CWL.inputs import CWLInput
|
|
21
|
+
from ..CWL.operation_description import CWLOperationDescription
|
|
22
|
+
from ..CWL.outputs import CWLOutput
|
|
23
|
+
from ..CWL.tool_description import CWLToolDescription
|
|
24
|
+
from ..CWL.workflow_description import CWLWorkflowDescription
|
|
25
|
+
from ..CWL.workflow_steps import (WorkflowStepRun_reflection, WorkflowStepRun, ScatterMethod, WorkflowStep, StepInput, StepOutput)
|
|
26
|
+
from ..FileSystem.path import (get_file_name, normalize, resolve_path_from_file, normalize_path_key)
|
|
27
|
+
from .build_options import (WorkflowGraphBuildOptions, WorkflowGraphBuildOptions_reflection, WorkflowGraphBuildOptionsModule_defaultOptions)
|
|
28
|
+
from .graph_types import (WorkflowGraph, WorkflowGraph_reflection, WorkflowGraph_create_4D231A1, GraphBuildIssue_create_Z2F3B511A, GraphIssueKind, WorkflowGraphNode, WorkflowGraphEdge, WorkflowGraphEdge_create_5E4B5E48, GraphId_edgeId, EdgeKind, GraphId_unitNodeId, WorkflowGraphNode_create_62C775C0, NodeKind, ProcessingUnitKind, GraphId_portNodeId, PortDirection, GraphId_stepNodeId, GraphId_childScope, GraphId_normalizeSegment)
|
|
29
|
+
from .reference_parsing import (ReferenceParsing_extractStepOutputId, ReferenceParsing_parseSourceReference, ParsedSourceReference)
|
|
30
|
+
|
|
31
|
+
def _expr1405() -> TypeInfo:
|
|
32
|
+
return record_type("ARCtrl.WorkflowGraph.Builder.BuildState", [], BuildState, lambda: [("Graph", WorkflowGraph_reflection()), ("NodeIds", class_type("Microsoft.FSharp.Collections.FSharpSet`1", [string_type])), ("EdgeIds", class_type("Microsoft.FSharp.Collections.FSharpSet`1", [string_type])), ("RunResolutionStack", class_type("Microsoft.FSharp.Collections.FSharpSet`1", [string_type])), ("RunResolutionCache", class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, WorkflowStepRun_reflection()])), ("RunNodeCache", class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, string_type])), ("Options", WorkflowGraphBuildOptions_reflection())])
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass(eq = False, repr = False, slots = True)
|
|
36
|
+
class BuildState(Record):
|
|
37
|
+
Graph: WorkflowGraph
|
|
38
|
+
NodeIds: Any
|
|
39
|
+
EdgeIds: Any
|
|
40
|
+
RunResolutionStack: Any
|
|
41
|
+
RunResolutionCache: Any
|
|
42
|
+
RunNodeCache: Any
|
|
43
|
+
Options: WorkflowGraphBuildOptions
|
|
44
|
+
|
|
45
|
+
BuildState_reflection = _expr1405
|
|
46
|
+
|
|
47
|
+
def _expr1406() -> TypeInfo:
|
|
48
|
+
return record_type("ARCtrl.WorkflowGraph.Builder.RunResolutionResult", [], RunResolutionResult, lambda: [("ResolvedRun", WorkflowStepRun_reflection()), ("ResolvedFromPath", option_type(string_type)), ("AttemptedLookup", bool_type), ("ResolutionPathKeys", array_type(string_type))])
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass(eq = False, repr = False, slots = True)
|
|
52
|
+
class RunResolutionResult(Record):
|
|
53
|
+
ResolvedRun: WorkflowStepRun
|
|
54
|
+
ResolvedFromPath: str | None
|
|
55
|
+
AttemptedLookup: bool
|
|
56
|
+
ResolutionPathKeys: Array[str]
|
|
57
|
+
|
|
58
|
+
RunResolutionResult_reflection = _expr1406
|
|
59
|
+
|
|
60
|
+
def create_graph(root_node_id: str) -> WorkflowGraph:
|
|
61
|
+
return WorkflowGraph_create_4D231A1(root_node_id)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def create_state(options: WorkflowGraphBuildOptions, root_node_id: str) -> BuildState:
|
|
65
|
+
class ObjectExpr1409:
|
|
66
|
+
@property
|
|
67
|
+
def Compare(self) -> Callable[[str, str], int]:
|
|
68
|
+
return compare_primitives
|
|
69
|
+
|
|
70
|
+
class ObjectExpr1410:
|
|
71
|
+
@property
|
|
72
|
+
def Compare(self) -> Callable[[str, str], int]:
|
|
73
|
+
return compare_primitives
|
|
74
|
+
|
|
75
|
+
class ObjectExpr1411:
|
|
76
|
+
@property
|
|
77
|
+
def Compare(self) -> Callable[[str, str], int]:
|
|
78
|
+
return compare_primitives
|
|
79
|
+
|
|
80
|
+
class ObjectExpr1412:
|
|
81
|
+
@property
|
|
82
|
+
def Compare(self) -> Callable[[str, str], int]:
|
|
83
|
+
return compare_primitives
|
|
84
|
+
|
|
85
|
+
class ObjectExpr1413:
|
|
86
|
+
@property
|
|
87
|
+
def Compare(self) -> Callable[[str, str], int]:
|
|
88
|
+
return compare_primitives
|
|
89
|
+
|
|
90
|
+
return BuildState(create_graph(root_node_id), empty(ObjectExpr1409()), empty(ObjectExpr1410()), empty(ObjectExpr1411()), empty_1(ObjectExpr1412()), empty_1(ObjectExpr1413()), options)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def add_diagnostic(state: BuildState, kind: GraphIssueKind, message: str, scope: str | None=None, reference: str | None=None) -> None:
|
|
94
|
+
(state.Graph.Diagnostics.append(GraphBuildIssue_create_Z2F3B511A(kind, message, scope, reference)))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def has_node(state: BuildState, node_id: str) -> bool:
|
|
98
|
+
return FSharpSet__Contains(state.NodeIds, node_id)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def add_node(state: BuildState, node: WorkflowGraphNode) -> None:
|
|
102
|
+
if not FSharpSet__Contains(state.NodeIds, node.Id):
|
|
103
|
+
state.NodeIds = FSharpSet__Add(state.NodeIds, node.Id)
|
|
104
|
+
(state.Graph.Nodes.append(node))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def add_edge(state: BuildState, edge: WorkflowGraphEdge) -> None:
|
|
109
|
+
if not FSharpSet__Contains(state.EdgeIds, edge.Id):
|
|
110
|
+
state.EdgeIds = FSharpSet__Add(state.EdgeIds, edge.Id)
|
|
111
|
+
(state.Graph.Edges.append(edge))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def add_edge_by_type(state: BuildState, kind: EdgeKind, source_node_id: str, target_node_id: str, label: str | None=None) -> None:
|
|
116
|
+
add_edge(state, WorkflowGraphEdge_create_5E4B5E48(GraphId_edgeId(kind, source_node_id, target_node_id), source_node_id, target_node_id, kind, label))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def create_metadata(pairs: FSharpList[tuple[str, Any | None]]) -> DynamicObj | None:
|
|
120
|
+
metadata: DynamicObj = DynamicObj()
|
|
121
|
+
has_metadata: bool = False
|
|
122
|
+
with get_enumerator(pairs) as enumerator:
|
|
123
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
124
|
+
for_loop_var: tuple[str, Any | None] = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
125
|
+
value_opt: Any | None = for_loop_var[1]
|
|
126
|
+
if value_opt is None:
|
|
127
|
+
pass
|
|
128
|
+
|
|
129
|
+
else:
|
|
130
|
+
value: Any = value_9(value_opt)
|
|
131
|
+
has_metadata = True
|
|
132
|
+
set_property(for_loop_var[0], value, metadata)
|
|
133
|
+
|
|
134
|
+
if has_metadata:
|
|
135
|
+
return metadata
|
|
136
|
+
|
|
137
|
+
else:
|
|
138
|
+
return None
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def add_processing_unit_node(state: BuildState, scope: str, kind: ProcessingUnitKind, label: str, owner_node_id: str | None=None, reference: str | None=None, metadata: DynamicObj | None=None) -> str:
|
|
143
|
+
node_id: str = GraphId_unitNodeId(scope)
|
|
144
|
+
add_node(state, WorkflowGraphNode_create_62C775C0(node_id, NodeKind(0, kind), label, owner_node_id, reference, metadata))
|
|
145
|
+
return node_id
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def add_port_node(state: BuildState, owner_node_id: str, direction: PortDirection, port_id: str, label: str) -> str:
|
|
149
|
+
node_id: str = GraphId_portNodeId(owner_node_id, direction, port_id)
|
|
150
|
+
add_node(state, WorkflowGraphNode_create_62C775C0(node_id, NodeKind(2, direction), label, owner_node_id))
|
|
151
|
+
return node_id
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def add_step_node(state: BuildState, scope: str, workflow_node_id: str, step: WorkflowStep) -> str:
|
|
155
|
+
step_node_id: str = GraphId_stepNodeId(scope, step.Id)
|
|
156
|
+
def mapping(value: str, state: Any=state, scope: Any=scope, workflow_node_id: Any=workflow_node_id, step: Any=step) -> Any:
|
|
157
|
+
return value
|
|
158
|
+
|
|
159
|
+
def mapping_1(sm: ScatterMethod, state: Any=state, scope: Any=scope, workflow_node_id: Any=workflow_node_id, step: Any=step) -> Any:
|
|
160
|
+
return sm.AsCwlString
|
|
161
|
+
|
|
162
|
+
def mapping_2(values: Array[str], state: Any=state, scope: Any=scope, workflow_node_id: Any=workflow_node_id, step: Any=step) -> Any:
|
|
163
|
+
return to_array(values)
|
|
164
|
+
|
|
165
|
+
metadata: DynamicObj | None = create_metadata(of_array([("when", map(mapping, step.When_)), ("scatterMethod", map(mapping_1, step.ScatterMethod)), ("scatter", map(mapping_2, step.Scatter))]))
|
|
166
|
+
add_node(state, WorkflowGraphNode_create_62C775C0(step_node_id, NodeKind(1), default_arg(step.Label, step.Id), workflow_node_id, None, metadata))
|
|
167
|
+
add_edge_by_type(state, EdgeKind(0), workflow_node_id, step_node_id, None)
|
|
168
|
+
return step_node_id
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def add_workflow_ports(state: BuildState, workflow_node_id: str, workflow: CWLWorkflowDescription) -> None:
|
|
172
|
+
def action(input: CWLInput, state: Any=state, workflow_node_id: Any=workflow_node_id, workflow: Any=workflow) -> None:
|
|
173
|
+
ignore(add_port_node(state, workflow_node_id, PortDirection(0), input.Name, input.Name))
|
|
174
|
+
|
|
175
|
+
iterate(action, workflow.Inputs)
|
|
176
|
+
def action_1(output: CWLOutput, state: Any=state, workflow_node_id: Any=workflow_node_id, workflow: Any=workflow) -> None:
|
|
177
|
+
ignore(add_port_node(state, workflow_node_id, PortDirection(1), output.Name, output.Name))
|
|
178
|
+
|
|
179
|
+
iterate(action_1, workflow.Outputs)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def add_tool_ports(state: BuildState, tool_node_id: str, tool: CWLToolDescription) -> None:
|
|
183
|
+
def action(input: CWLInput, state: Any=state, tool_node_id: Any=tool_node_id, tool: Any=tool) -> None:
|
|
184
|
+
ignore(add_port_node(state, tool_node_id, PortDirection(0), input.Name, input.Name))
|
|
185
|
+
|
|
186
|
+
iterate(action, default_arg(tool.Inputs, []))
|
|
187
|
+
def action_1(output: CWLOutput, state: Any=state, tool_node_id: Any=tool_node_id, tool: Any=tool) -> None:
|
|
188
|
+
ignore(add_port_node(state, tool_node_id, PortDirection(1), output.Name, output.Name))
|
|
189
|
+
|
|
190
|
+
iterate(action_1, tool.Outputs)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def add_expression_tool_ports(state: BuildState, tool_node_id: str, tool: CWLExpressionToolDescription) -> None:
|
|
194
|
+
def action(input: CWLInput, state: Any=state, tool_node_id: Any=tool_node_id, tool: Any=tool) -> None:
|
|
195
|
+
ignore(add_port_node(state, tool_node_id, PortDirection(0), input.Name, input.Name))
|
|
196
|
+
|
|
197
|
+
iterate(action, default_arg(tool.Inputs, []))
|
|
198
|
+
def action_1(output: CWLOutput, state: Any=state, tool_node_id: Any=tool_node_id, tool: Any=tool) -> None:
|
|
199
|
+
ignore(add_port_node(state, tool_node_id, PortDirection(1), output.Name, output.Name))
|
|
200
|
+
|
|
201
|
+
iterate(action_1, tool.Outputs)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def add_operation_ports(state: BuildState, operation_node_id: str, operation: CWLOperationDescription) -> None:
|
|
205
|
+
def action(input: CWLInput, state: Any=state, operation_node_id: Any=operation_node_id, operation: Any=operation) -> None:
|
|
206
|
+
ignore(add_port_node(state, operation_node_id, PortDirection(0), input.Name, input.Name))
|
|
207
|
+
|
|
208
|
+
iterate(action, operation.Inputs)
|
|
209
|
+
def action_1(output: CWLOutput, state: Any=state, operation_node_id: Any=operation_node_id, operation: Any=operation) -> None:
|
|
210
|
+
ignore(add_port_node(state, operation_node_id, PortDirection(1), output.Name, output.Name))
|
|
211
|
+
|
|
212
|
+
iterate(action_1, operation.Outputs)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def add_step_ports(state: BuildState, step_node_id: str, step: WorkflowStep) -> None:
|
|
216
|
+
def action(input: StepInput, state: Any=state, step_node_id: Any=step_node_id, step: Any=step) -> None:
|
|
217
|
+
ignore(add_port_node(state, step_node_id, PortDirection(0), input.Id, input.Id))
|
|
218
|
+
|
|
219
|
+
iterate(action, step.In)
|
|
220
|
+
def action_1(output: StepOutput, state: Any=state, step_node_id: Any=step_node_id, step: Any=step) -> None:
|
|
221
|
+
output_id: str = ReferenceParsing_extractStepOutputId(output)
|
|
222
|
+
ignore(add_port_node(state, step_node_id, PortDirection(1), output_id, output_id))
|
|
223
|
+
|
|
224
|
+
iterate(action_1, step.Out)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def trim_to_name_candidate(value: str) -> str:
|
|
228
|
+
if is_null_or_white_space(value):
|
|
229
|
+
return ""
|
|
230
|
+
|
|
231
|
+
else:
|
|
232
|
+
trimmed: str = value.strip()
|
|
233
|
+
if starts_with_exact(trimmed, "#"):
|
|
234
|
+
return substring(trimmed, 1)
|
|
235
|
+
|
|
236
|
+
else:
|
|
237
|
+
hash_index: int = trimmed.find("#") or 0
|
|
238
|
+
without_hash: str = substring(trimmed, 0, hash_index) if (hash_index >= 0) else trimmed
|
|
239
|
+
query_index: int = without_hash.find("?") or 0
|
|
240
|
+
if query_index >= 0:
|
|
241
|
+
return substring(without_hash, 0, query_index)
|
|
242
|
+
|
|
243
|
+
else:
|
|
244
|
+
return without_hash
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def is_cwl_reference(run_path: str) -> bool:
|
|
251
|
+
candidate: str = trim_to_name_candidate(run_path)
|
|
252
|
+
if not is_null_or_white_space(candidate):
|
|
253
|
+
return ends_with(candidate, ".cwl", 5)
|
|
254
|
+
|
|
255
|
+
else:
|
|
256
|
+
return False
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def try_basename_no_cwl_extension(value: str) -> str | None:
|
|
261
|
+
candidate: str = trim_to_name_candidate(value)
|
|
262
|
+
if is_null_or_white_space(candidate):
|
|
263
|
+
return None
|
|
264
|
+
|
|
265
|
+
else:
|
|
266
|
+
file_name: str = get_file_name(candidate) if (True if (candidate.find("/") >= 0) else (candidate.find("\\") >= 0)) else candidate
|
|
267
|
+
without_cwl_extension: str = substring(file_name, 0, len(file_name) - len(".cwl")) if ends_with(file_name, ".cwl", 5) else file_name
|
|
268
|
+
if is_null_or_white_space(without_cwl_extension):
|
|
269
|
+
return None
|
|
270
|
+
|
|
271
|
+
else:
|
|
272
|
+
return without_cwl_extension
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def try_get_processing_unit_name(processing_unit: Any | None=None) -> str | None:
|
|
278
|
+
def chooser(key: str, processing_unit: Any=processing_unit) -> str | None:
|
|
279
|
+
def _arrow1414(value: str, key: Any=key) -> str | None:
|
|
280
|
+
return try_basename_no_cwl_extension(value)
|
|
281
|
+
|
|
282
|
+
def _arrow1415(__unit: None=None, key: Any=key) -> str | None:
|
|
283
|
+
match_value: Any | None = processing_unit.TryGetPropertyValue(key)
|
|
284
|
+
if match_value is not None:
|
|
285
|
+
o: Any = value_9(match_value)
|
|
286
|
+
return o if (str(type(o)) == "<class \'str\'>") else None
|
|
287
|
+
|
|
288
|
+
else:
|
|
289
|
+
return None
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
return bind(_arrow1414, _arrow1415())
|
|
293
|
+
|
|
294
|
+
return try_pick(chooser, of_array(["name", "id"]))
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def choose_label(fallback: str, candidates: FSharpList[str | None]) -> str:
|
|
298
|
+
def chooser(x: str | None=None, fallback: Any=fallback, candidates: Any=candidates) -> str | None:
|
|
299
|
+
return x
|
|
300
|
+
|
|
301
|
+
return default_arg(try_pick(chooser, candidates), fallback)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def get_run_path_candidates(workflow_file_path: str | None, run_path: str) -> Array[str]:
|
|
305
|
+
if is_null_or_white_space(run_path):
|
|
306
|
+
return []
|
|
307
|
+
|
|
308
|
+
else:
|
|
309
|
+
trimmed_run_path: str = run_path.strip()
|
|
310
|
+
normalized_run_path: str = normalize(trimmed_run_path)
|
|
311
|
+
(pattern_matching_result, workflow_path_1) = (None, None)
|
|
312
|
+
if workflow_file_path is not None:
|
|
313
|
+
if not is_null_or_white_space(workflow_file_path):
|
|
314
|
+
pattern_matching_result = 0
|
|
315
|
+
workflow_path_1 = workflow_file_path
|
|
316
|
+
|
|
317
|
+
else:
|
|
318
|
+
pattern_matching_result = 1
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
else:
|
|
322
|
+
pattern_matching_result = 1
|
|
323
|
+
|
|
324
|
+
if pattern_matching_result == 0:
|
|
325
|
+
path_from_workflow_file: str = resolve_path_from_file(workflow_path_1, trimmed_run_path)
|
|
326
|
+
def predicate(arg: str, workflow_file_path: Any=workflow_file_path, run_path: Any=run_path) -> bool:
|
|
327
|
+
return not is_null_or_white_space(arg)
|
|
328
|
+
|
|
329
|
+
class ObjectExpr1417:
|
|
330
|
+
@property
|
|
331
|
+
def Equals(self) -> Callable[[str, str], bool]:
|
|
332
|
+
def _arrow1416(x: str, y: str) -> bool:
|
|
333
|
+
return x == y
|
|
334
|
+
|
|
335
|
+
return _arrow1416
|
|
336
|
+
|
|
337
|
+
@property
|
|
338
|
+
def GetHashCode(self) -> Callable[[str], int]:
|
|
339
|
+
return string_hash
|
|
340
|
+
|
|
341
|
+
return Array_distinct(filter(predicate, [trimmed_run_path, normalized_run_path, path_from_workflow_file, normalize(path_from_workflow_file)]), ObjectExpr1417())
|
|
342
|
+
|
|
343
|
+
elif pattern_matching_result == 1:
|
|
344
|
+
def predicate_1(arg_1: str, workflow_file_path: Any=workflow_file_path, run_path: Any=run_path) -> bool:
|
|
345
|
+
return not is_null_or_white_space(arg_1)
|
|
346
|
+
|
|
347
|
+
class ObjectExpr1419:
|
|
348
|
+
@property
|
|
349
|
+
def Equals(self) -> Callable[[str, str], bool]:
|
|
350
|
+
def _arrow1418(x_1: str, y_1: str) -> bool:
|
|
351
|
+
return x_1 == y_1
|
|
352
|
+
|
|
353
|
+
return _arrow1418
|
|
354
|
+
|
|
355
|
+
@property
|
|
356
|
+
def GetHashCode(self) -> Callable[[str], int]:
|
|
357
|
+
return string_hash
|
|
358
|
+
|
|
359
|
+
return Array_distinct(filter(predicate_1, [trimmed_run_path, normalized_run_path]), ObjectExpr1419())
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def resolve_run_string(state: BuildState, workflow_file_path: str | None, run_path: str) -> RunResolutionResult:
|
|
365
|
+
if True if is_null_or_white_space(run_path) else (not is_cwl_reference(run_path)):
|
|
366
|
+
return RunResolutionResult(WorkflowStepRun(0, run_path), None, False, [])
|
|
367
|
+
|
|
368
|
+
else:
|
|
369
|
+
match_value: Callable[[str], CWLProcessingUnit | None] | None = state.Options.TryResolveRunPath
|
|
370
|
+
if match_value is not None:
|
|
371
|
+
try_resolve_run_path: Callable[[str], CWLProcessingUnit | None] = match_value
|
|
372
|
+
candidates: Array[str] = get_run_path_candidates(workflow_file_path, run_path)
|
|
373
|
+
def _arrow1420(path: str, state: Any=state, workflow_file_path: Any=workflow_file_path, run_path: Any=run_path) -> str:
|
|
374
|
+
return normalize_path_key(path)
|
|
375
|
+
|
|
376
|
+
class ObjectExpr1422:
|
|
377
|
+
@property
|
|
378
|
+
def Equals(self) -> Callable[[str, str], bool]:
|
|
379
|
+
def _arrow1421(x: str, y: str) -> bool:
|
|
380
|
+
return x == y
|
|
381
|
+
|
|
382
|
+
return _arrow1421
|
|
383
|
+
|
|
384
|
+
@property
|
|
385
|
+
def GetHashCode(self) -> Callable[[str], int]:
|
|
386
|
+
return string_hash
|
|
387
|
+
|
|
388
|
+
candidate_keys: Array[str] = Array_distinct(map_1(_arrow1420, candidates, None), ObjectExpr1422())
|
|
389
|
+
resolved_run: tuple[WorkflowStepRun, str] | None = None
|
|
390
|
+
for idx in range(0, (len(candidates) - 1) + 1, 1):
|
|
391
|
+
candidate: str = candidates[idx]
|
|
392
|
+
if resolved_run is None:
|
|
393
|
+
path_key: str = normalize_path_key(candidate)
|
|
394
|
+
if FSharpSet__Contains(state.RunResolutionStack, path_key):
|
|
395
|
+
add_diagnostic(state, GraphIssueKind(3), ("Cycle detected while resolving run reference \'" + candidate) + "\'.", workflow_file_path, candidate)
|
|
396
|
+
|
|
397
|
+
elif FSharpMap__ContainsKey(state.RunResolutionCache, path_key):
|
|
398
|
+
resolved_run = (FSharpMap__get_Item(state.RunResolutionCache, path_key), candidate)
|
|
399
|
+
|
|
400
|
+
else:
|
|
401
|
+
match_value_1: CWLProcessingUnit | None = try_resolve_run_path(candidate)
|
|
402
|
+
if match_value_1 is None:
|
|
403
|
+
pass
|
|
404
|
+
|
|
405
|
+
elif match_value_1.tag == 1:
|
|
406
|
+
workflow: CWLWorkflowDescription = match_value_1.fields[0]
|
|
407
|
+
run_1: WorkflowStepRun = WorkflowStepRunOps_fromWorkflow(workflow)
|
|
408
|
+
for idx_2 in range(0, (len(candidate_keys) - 1) + 1, 1):
|
|
409
|
+
key_1: str = candidate_keys[idx_2]
|
|
410
|
+
state.RunResolutionCache = FSharpMap__Add(state.RunResolutionCache, key_1, run_1)
|
|
411
|
+
resolved_run = (run_1, candidate)
|
|
412
|
+
|
|
413
|
+
elif match_value_1.tag == 2:
|
|
414
|
+
expression_tool: CWLExpressionToolDescription = match_value_1.fields[0]
|
|
415
|
+
run_2: WorkflowStepRun = WorkflowStepRunOps_fromExpressionTool(expression_tool)
|
|
416
|
+
for idx_3 in range(0, (len(candidate_keys) - 1) + 1, 1):
|
|
417
|
+
key_2: str = candidate_keys[idx_3]
|
|
418
|
+
state.RunResolutionCache = FSharpMap__Add(state.RunResolutionCache, key_2, run_2)
|
|
419
|
+
resolved_run = (run_2, candidate)
|
|
420
|
+
|
|
421
|
+
elif match_value_1.tag == 3:
|
|
422
|
+
operation: CWLOperationDescription = match_value_1.fields[0]
|
|
423
|
+
run_3: WorkflowStepRun = WorkflowStepRunOps_fromOperation(operation)
|
|
424
|
+
for idx_4 in range(0, (len(candidate_keys) - 1) + 1, 1):
|
|
425
|
+
key_3: str = candidate_keys[idx_4]
|
|
426
|
+
state.RunResolutionCache = FSharpMap__Add(state.RunResolutionCache, key_3, run_3)
|
|
427
|
+
resolved_run = (run_3, candidate)
|
|
428
|
+
|
|
429
|
+
else:
|
|
430
|
+
tool: CWLToolDescription = match_value_1.fields[0]
|
|
431
|
+
run: WorkflowStepRun = WorkflowStepRunOps_fromTool(tool)
|
|
432
|
+
for idx_1 in range(0, (len(candidate_keys) - 1) + 1, 1):
|
|
433
|
+
key: str = candidate_keys[idx_1]
|
|
434
|
+
state.RunResolutionCache = FSharpMap__Add(state.RunResolutionCache, key, run)
|
|
435
|
+
resolved_run = (run, candidate)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
if resolved_run is None:
|
|
440
|
+
add_diagnostic(state, GraphIssueKind(2), ("Unable to resolve CWL run reference \'" + run_path) + "\'.", workflow_file_path, run_path)
|
|
441
|
+
return RunResolutionResult(WorkflowStepRun(0, run_path), None, True, candidate_keys)
|
|
442
|
+
|
|
443
|
+
else:
|
|
444
|
+
return RunResolutionResult(resolved_run[0], resolved_run[1], True, candidate_keys)
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
else:
|
|
448
|
+
if state.Options.StrictUnresolvedRunReferences:
|
|
449
|
+
add_diagnostic(state, GraphIssueKind(2), ("Unable to resolve CWL run reference \'" + run_path) + "\' because no run resolver is configured.", workflow_file_path, run_path)
|
|
450
|
+
|
|
451
|
+
return RunResolutionResult(WorkflowStepRun(0, run_path), None, state.Options.StrictUnresolvedRunReferences, [])
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
def build_processing_unit(state: BuildState, scope: str, workflow_file_path: str | None, owner_node_id: str | None, is_root: bool, processing_unit: CWLProcessingUnit) -> str:
|
|
457
|
+
if processing_unit.tag == 2:
|
|
458
|
+
expression_tool: CWLExpressionToolDescription = processing_unit.fields[0]
|
|
459
|
+
def _arrow1423(value_3: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
460
|
+
return try_basename_no_cwl_extension(value_3)
|
|
461
|
+
|
|
462
|
+
def _arrow1424(value_4: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
463
|
+
return try_basename_no_cwl_extension(value_4)
|
|
464
|
+
|
|
465
|
+
node_id_1: str = add_processing_unit_node(state, scope, ProcessingUnitKind(2), choose_label("ExpressionTool", of_array([try_get_processing_unit_name(expression_tool), bind(_arrow1423, expression_tool.Label), bind(_arrow1424, workflow_file_path)])), owner_node_id, None, create_metadata(of_array([("cwlVersion", some(expression_tool.CWLVersion)), ("expression", some(expression_tool.Expression))])))
|
|
466
|
+
add_expression_tool_ports(state, node_id_1, expression_tool)
|
|
467
|
+
return node_id_1
|
|
468
|
+
|
|
469
|
+
elif processing_unit.tag == 3:
|
|
470
|
+
operation: CWLOperationDescription = processing_unit.fields[0]
|
|
471
|
+
def _arrow1425(value_5: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
472
|
+
return try_basename_no_cwl_extension(value_5)
|
|
473
|
+
|
|
474
|
+
def _arrow1426(value_6: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
475
|
+
return try_basename_no_cwl_extension(value_6)
|
|
476
|
+
|
|
477
|
+
node_id_2: str = add_processing_unit_node(state, scope, ProcessingUnitKind(3), choose_label("Operation", of_array([try_get_processing_unit_name(operation), bind(_arrow1425, operation.Label), bind(_arrow1426, workflow_file_path)])), owner_node_id, None, create_metadata(singleton(("cwlVersion", some(operation.CWLVersion)))))
|
|
478
|
+
add_operation_ports(state, node_id_2, operation)
|
|
479
|
+
return node_id_2
|
|
480
|
+
|
|
481
|
+
elif processing_unit.tag == 1:
|
|
482
|
+
workflow: CWLWorkflowDescription = processing_unit.fields[0]
|
|
483
|
+
def _arrow1427(value_7: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
484
|
+
return try_basename_no_cwl_extension(value_7)
|
|
485
|
+
|
|
486
|
+
def _arrow1428(value_8: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
487
|
+
return try_basename_no_cwl_extension(value_8)
|
|
488
|
+
|
|
489
|
+
node_id_3: str = add_processing_unit_node(state, scope, ProcessingUnitKind(0), choose_label("Workflow", of_array([try_get_processing_unit_name(workflow), bind(_arrow1427, workflow.Label), bind(_arrow1428, workflow_file_path)])), owner_node_id, None, create_metadata(singleton(("cwlVersion", some(workflow.CWLVersion)))))
|
|
490
|
+
add_workflow_ports(state, node_id_3, workflow)
|
|
491
|
+
if True if is_root else state.Options.ExpandNestedWorkflows:
|
|
492
|
+
build_workflow_steps(state, scope, workflow_file_path, node_id_3, workflow)
|
|
493
|
+
|
|
494
|
+
return node_id_3
|
|
495
|
+
|
|
496
|
+
else:
|
|
497
|
+
tool: CWLToolDescription = processing_unit.fields[0]
|
|
498
|
+
def _arrow1429(value: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
499
|
+
return try_basename_no_cwl_extension(value)
|
|
500
|
+
|
|
501
|
+
def _arrow1430(value_1: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
502
|
+
return try_basename_no_cwl_extension(value_1)
|
|
503
|
+
|
|
504
|
+
def binder(source: Array[str], state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
505
|
+
return try_head(source)
|
|
506
|
+
|
|
507
|
+
def _arrow1431(value_2: str, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, owner_node_id: Any=owner_node_id, is_root: Any=is_root, processing_unit: Any=processing_unit) -> str | None:
|
|
508
|
+
return try_basename_no_cwl_extension(value_2)
|
|
509
|
+
|
|
510
|
+
node_id: str = add_processing_unit_node(state, scope, ProcessingUnitKind(1), choose_label("CommandLineTool", of_array([try_get_processing_unit_name(tool), bind(_arrow1429, tool.Label), bind(_arrow1430, bind(binder, tool.BaseCommand)), bind(_arrow1431, workflow_file_path)])), owner_node_id, None, create_metadata(singleton(("cwlVersion", some(tool.CWLVersion)))))
|
|
511
|
+
add_tool_ports(state, node_id, tool)
|
|
512
|
+
return node_id
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
def build_run_node(state: BuildState, run_scope: str, step_node_id: str, workflow_file_path: str | None, run: WorkflowStepRun) -> tuple[WorkflowStepRun, str]:
|
|
517
|
+
if run.tag == 1:
|
|
518
|
+
match_value_2: CWLToolDescription | None = WorkflowStepRunOps_tryGetTool(run)
|
|
519
|
+
if match_value_2 is None:
|
|
520
|
+
bad_node_id: str = add_processing_unit_node(state, run_scope, ProcessingUnitKind(5), "Invalid CommandLineTool payload", step_node_id, None, None)
|
|
521
|
+
add_diagnostic(state, GraphIssueKind(5), "WorkflowStepRun.RunCommandLineTool had an unexpected payload type.", workflow_file_path, None)
|
|
522
|
+
return (run, bad_node_id)
|
|
523
|
+
|
|
524
|
+
else:
|
|
525
|
+
return (run, build_processing_unit(state, run_scope, workflow_file_path, step_node_id, False, CWLProcessingUnit(0, match_value_2)))
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
elif run.tag == 2:
|
|
529
|
+
match_value_3: CWLWorkflowDescription | None = WorkflowStepRunOps_tryGetWorkflow(run)
|
|
530
|
+
if match_value_3 is None:
|
|
531
|
+
bad_node_id_1: str = add_processing_unit_node(state, run_scope, ProcessingUnitKind(5), "Invalid Workflow payload", step_node_id, None, None)
|
|
532
|
+
add_diagnostic(state, GraphIssueKind(5), "WorkflowStepRun.RunWorkflow had an unexpected payload type.", workflow_file_path, None)
|
|
533
|
+
return (run, bad_node_id_1)
|
|
534
|
+
|
|
535
|
+
else:
|
|
536
|
+
workflow: CWLWorkflowDescription = match_value_3
|
|
537
|
+
def _arrow1432(__unit: None=None, state: Any=state, run_scope: Any=run_scope, step_node_id: Any=step_node_id, workflow_file_path: Any=workflow_file_path, run: Any=run) -> str | None:
|
|
538
|
+
current_path: str = default_arg(workflow_file_path, "")
|
|
539
|
+
return None if is_null_or_white_space(current_path) else current_path
|
|
540
|
+
|
|
541
|
+
return (run, build_processing_unit(state, run_scope, _arrow1432(), step_node_id, False, CWLProcessingUnit(1, workflow)))
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
elif run.tag == 3:
|
|
545
|
+
match_value_4: CWLExpressionToolDescription | None = WorkflowStepRunOps_tryGetExpressionTool(run)
|
|
546
|
+
if match_value_4 is None:
|
|
547
|
+
bad_node_id_2: str = add_processing_unit_node(state, run_scope, ProcessingUnitKind(5), "Invalid ExpressionTool payload", step_node_id, None, None)
|
|
548
|
+
add_diagnostic(state, GraphIssueKind(5), "WorkflowStepRun.RunExpressionTool had an unexpected payload type.", workflow_file_path, None)
|
|
549
|
+
return (run, bad_node_id_2)
|
|
550
|
+
|
|
551
|
+
else:
|
|
552
|
+
return (run, build_processing_unit(state, run_scope, workflow_file_path, step_node_id, False, CWLProcessingUnit(2, match_value_4)))
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
elif run.tag == 4:
|
|
556
|
+
match_value_5: CWLOperationDescription | None = WorkflowStepRunOps_tryGetOperation(run)
|
|
557
|
+
if match_value_5 is None:
|
|
558
|
+
bad_node_id_3: str = add_processing_unit_node(state, run_scope, ProcessingUnitKind(5), "Invalid Operation payload", step_node_id, None, None)
|
|
559
|
+
add_diagnostic(state, GraphIssueKind(5), "WorkflowStepRun.RunOperation had an unexpected payload type.", workflow_file_path, None)
|
|
560
|
+
return (run, bad_node_id_3)
|
|
561
|
+
|
|
562
|
+
else:
|
|
563
|
+
return (run, build_processing_unit(state, run_scope, workflow_file_path, step_node_id, False, CWLProcessingUnit(3, match_value_5)))
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
else:
|
|
567
|
+
resolution: RunResolutionResult = resolve_run_string(state, workflow_file_path, run.fields[0])
|
|
568
|
+
match_value: WorkflowStepRun = resolution.ResolvedRun
|
|
569
|
+
if match_value.tag == 0:
|
|
570
|
+
unresolved_path: str = match_value.fields[0]
|
|
571
|
+
def _arrow1433(__unit: None=None, state: Any=state, run_scope: Any=run_scope, step_node_id: Any=step_node_id, workflow_file_path: Any=workflow_file_path, run: Any=run) -> IEnumerable_1[str | None]:
|
|
572
|
+
return singleton_1(try_basename_no_cwl_extension(unresolved_path)) if is_cwl_reference(unresolved_path) else singleton_1(None)
|
|
573
|
+
|
|
574
|
+
unresolved_label: str = choose_label(unresolved_path, to_list(delay(_arrow1433)))
|
|
575
|
+
return (resolution.ResolvedRun, add_processing_unit_node(state, run_scope, ProcessingUnitKind(5) if (is_cwl_reference(unresolved_path) if resolution.AttemptedLookup else False) else ProcessingUnitKind(4), unresolved_label, step_node_id, unresolved_path, None))
|
|
576
|
+
|
|
577
|
+
else:
|
|
578
|
+
resolved_run: WorkflowStepRun = match_value
|
|
579
|
+
def chooser(key: str, state: Any=state, run_scope: Any=run_scope, step_node_id: Any=step_node_id, workflow_file_path: Any=workflow_file_path, run: Any=run) -> str | None:
|
|
580
|
+
return try_find(key, state.RunNodeCache)
|
|
581
|
+
|
|
582
|
+
cached_run_node_id: str | None = try_pick_1(chooser, resolution.ResolutionPathKeys)
|
|
583
|
+
if cached_run_node_id is None:
|
|
584
|
+
pattern_input: tuple[WorkflowStepRun, str]
|
|
585
|
+
match_value_1: str | None = resolution.ResolvedFromPath
|
|
586
|
+
if match_value_1 is None:
|
|
587
|
+
pattern_input = build_run_node(state, run_scope, step_node_id, resolution.ResolvedFromPath, resolved_run)
|
|
588
|
+
|
|
589
|
+
else:
|
|
590
|
+
resolved_path_key: str = normalize_path_key(match_value_1)
|
|
591
|
+
previous_stack: Any = state.RunResolutionStack
|
|
592
|
+
state.RunResolutionStack = FSharpSet__Add(previous_stack, resolved_path_key)
|
|
593
|
+
try:
|
|
594
|
+
pattern_input = build_run_node(state, run_scope, step_node_id, resolution.ResolvedFromPath, resolved_run)
|
|
595
|
+
|
|
596
|
+
finally:
|
|
597
|
+
state.RunResolutionStack = previous_stack
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
built_node_id: str = pattern_input[1]
|
|
601
|
+
arr: Array[str] = resolution.ResolutionPathKeys
|
|
602
|
+
for idx in range(0, (len(arr) - 1) + 1, 1):
|
|
603
|
+
key_1: str = arr[idx]
|
|
604
|
+
state.RunNodeCache = FSharpMap__Add(state.RunNodeCache, key_1, built_node_id)
|
|
605
|
+
return (pattern_input[0], built_node_id)
|
|
606
|
+
|
|
607
|
+
else:
|
|
608
|
+
return (resolved_run, cached_run_node_id)
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
def wire_step_inputs(state: BuildState, scope: str, workflow_node_id: str, step: WorkflowStep) -> None:
|
|
615
|
+
step_node_id: str = GraphId_stepNodeId(scope, step.Id)
|
|
616
|
+
enumerator: Any = get_enumerator(step.In)
|
|
617
|
+
try:
|
|
618
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
619
|
+
step_input: StepInput = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
620
|
+
target_input_port_id: str = GraphId_portNodeId(step_node_id, PortDirection(0), step_input.Id)
|
|
621
|
+
match_value: Array[str] | None = step_input.Source
|
|
622
|
+
if match_value is not None:
|
|
623
|
+
enumerator_1: Any = get_enumerator(match_value)
|
|
624
|
+
try:
|
|
625
|
+
while enumerator_1.System_Collections_IEnumerator_MoveNext():
|
|
626
|
+
source: str = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
627
|
+
source_ref: ParsedSourceReference = ReferenceParsing_parseSourceReference(source)
|
|
628
|
+
if is_null_or_white_space(source_ref.PortId):
|
|
629
|
+
add_diagnostic(state, GraphIssueKind(1), ((((("Step \'" + step.Id) + "\' input \'") + step_input.Id) + "\' has invalid source \'") + source) + "\'.", scope, source)
|
|
630
|
+
|
|
631
|
+
else:
|
|
632
|
+
source_port_id: str
|
|
633
|
+
match_value_1: str | None = source_ref.StepId
|
|
634
|
+
source_port_id = GraphId_portNodeId(workflow_node_id, PortDirection(0), source_ref.PortId) if (match_value_1 is None) else GraphId_portNodeId(GraphId_stepNodeId(scope, match_value_1), PortDirection(1), source_ref.PortId)
|
|
635
|
+
if has_node(state, target_input_port_id) if has_node(state, source_port_id) else False:
|
|
636
|
+
add_edge_by_type(state, EdgeKind(2) if (source_ref.StepId is None) else EdgeKind(3), source_port_id, target_input_port_id, None)
|
|
637
|
+
|
|
638
|
+
else:
|
|
639
|
+
add_diagnostic(state, GraphIssueKind(0), ((((("Unable to wire source \'" + source) + "\' to step input \'") + step.Id) + "/") + step_input.Id) + "\'.", scope, source)
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
finally:
|
|
644
|
+
dispose(enumerator_1)
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
finally:
|
|
649
|
+
dispose(enumerator)
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
def wire_workflow_outputs(state: BuildState, scope: str, workflow_node_id: str, workflow: CWLWorkflowDescription) -> None:
|
|
654
|
+
enumerator: Any = get_enumerator(workflow.Outputs)
|
|
655
|
+
try:
|
|
656
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
657
|
+
output: CWLOutput = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
658
|
+
enumerator_1: Any = get_enumerator(output.GetOutputSources())
|
|
659
|
+
try:
|
|
660
|
+
while enumerator_1.System_Collections_IEnumerator_MoveNext():
|
|
661
|
+
output_source: str = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
662
|
+
parsed_source: ParsedSourceReference = ReferenceParsing_parseSourceReference(output_source)
|
|
663
|
+
if is_null_or_white_space(parsed_source.PortId):
|
|
664
|
+
add_diagnostic(state, GraphIssueKind(1), ((("Workflow output \'" + output.Name) + "\' has invalid outputSource \'") + output_source) + "\'.", scope, output_source)
|
|
665
|
+
|
|
666
|
+
else:
|
|
667
|
+
source_port_id: str
|
|
668
|
+
match_value: str | None = parsed_source.StepId
|
|
669
|
+
source_port_id = GraphId_portNodeId(workflow_node_id, PortDirection(0), parsed_source.PortId) if (match_value is None) else GraphId_portNodeId(GraphId_stepNodeId(scope, match_value), PortDirection(1), parsed_source.PortId)
|
|
670
|
+
target_port_id: str = GraphId_portNodeId(workflow_node_id, PortDirection(1), output.Name)
|
|
671
|
+
if has_node(state, target_port_id) if has_node(state, source_port_id) else False:
|
|
672
|
+
add_edge_by_type(state, EdgeKind(4), source_port_id, target_port_id, None)
|
|
673
|
+
|
|
674
|
+
else:
|
|
675
|
+
add_diagnostic(state, GraphIssueKind(0), ((("Unable to wire workflow output \'" + output.Name) + "\' from source \'") + output_source) + "\'.", scope, output_source)
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
finally:
|
|
680
|
+
dispose(enumerator_1)
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
finally:
|
|
684
|
+
dispose(enumerator)
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
def build_workflow_steps(state: BuildState, scope: str, workflow_file_path: str | None, workflow_node_id: str, workflow: CWLWorkflowDescription) -> None:
|
|
689
|
+
enumerator: Any = get_enumerator(workflow.Steps)
|
|
690
|
+
try:
|
|
691
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
692
|
+
step: WorkflowStep = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
693
|
+
step_node_id: str = add_step_node(state, scope, workflow_node_id, step)
|
|
694
|
+
add_step_ports(state, step_node_id, step)
|
|
695
|
+
add_edge_by_type(state, EdgeKind(1), step_node_id, build_run_node(state, GraphId_childScope(scope, ("" + step.Id) + "/run"), step_node_id, workflow_file_path, step.Run)[1], "calls")
|
|
696
|
+
|
|
697
|
+
finally:
|
|
698
|
+
dispose(enumerator)
|
|
699
|
+
|
|
700
|
+
def action(step_1: WorkflowStep, state: Any=state, scope: Any=scope, workflow_file_path: Any=workflow_file_path, workflow_node_id: Any=workflow_node_id, workflow: Any=workflow) -> None:
|
|
701
|
+
wire_step_inputs(state, scope, workflow_node_id, step_1)
|
|
702
|
+
|
|
703
|
+
iterate(action, workflow.Steps)
|
|
704
|
+
wire_workflow_outputs(state, scope, workflow_node_id, workflow)
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
def build_with(options: WorkflowGraphBuildOptions, processing_unit: CWLProcessingUnit) -> WorkflowGraph:
|
|
708
|
+
root_scope: str = GraphId_normalizeSegment(options.RootScope)
|
|
709
|
+
root_scope_1: str = "root" if is_null_or_white_space(root_scope) else root_scope
|
|
710
|
+
state: BuildState = create_state(options, GraphId_unitNodeId(root_scope_1))
|
|
711
|
+
ignore(build_processing_unit(state, root_scope_1, options.RootWorkflowFilePath, None, True, processing_unit))
|
|
712
|
+
return state.Graph
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
def build(processing_unit: CWLProcessingUnit) -> WorkflowGraph:
|
|
716
|
+
return build_with(WorkflowGraphBuildOptionsModule_defaultOptions, processing_unit)
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
__all__ = ["BuildState_reflection", "RunResolutionResult_reflection", "create_graph", "create_state", "add_diagnostic", "has_node", "add_node", "add_edge", "add_edge_by_type", "create_metadata", "add_processing_unit_node", "add_port_node", "add_step_node", "add_workflow_ports", "add_tool_ports", "add_expression_tool_ports", "add_operation_ports", "add_step_ports", "trim_to_name_candidate", "is_cwl_reference", "try_basename_no_cwl_extension", "try_get_processing_unit_name", "choose_label", "get_run_path_candidates", "resolve_run_string", "build_processing_unit", "build_run_node", "wire_step_inputs", "wire_workflow_outputs", "build_workflow_steps", "build_with", "build"]
|
|
720
|
+
|