arctrl 3.0.0a3__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 +18 -0
- arctrl/py/CWL/__init__.py +0 -0
- arctrl/py/CWL/cwltypes.py +150 -0
- arctrl/py/CWL/decode.py +973 -0
- arctrl/py/CWL/encode.py +1 -0
- arctrl/py/CWL/inputs.py +88 -0
- arctrl/py/CWL/outputs.py +85 -0
- arctrl/py/CWL/requirements.py +77 -0
- arctrl/py/CWL/tool_description.py +103 -0
- arctrl/py/CWL/workflow_description.py +104 -0
- arctrl/py/CWL/workflow_steps.py +113 -0
- arctrl/py/Contract/__init__.py +0 -0
- arctrl/py/Contract/arc.py +60 -0
- arctrl/py/Contract/arc_assay.py +125 -0
- arctrl/py/Contract/arc_investigation.py +88 -0
- arctrl/py/Contract/arc_run.py +125 -0
- arctrl/py/Contract/arc_study.py +126 -0
- arctrl/py/Contract/arc_workflow.py +125 -0
- arctrl/py/Contract/contract.py +153 -0
- arctrl/py/Contract/datamap.py +372 -0
- arctrl/py/Contract/git.py +118 -0
- arctrl/py/Contract/validation_packages_config.py +107 -0
- arctrl/py/ContractIO/__init__.py +0 -0
- arctrl/py/ContractIO/contract_io.py +344 -0
- arctrl/py/ContractIO/file_system_helper.py +264 -0
- arctrl/py/Core/Helper/__init__.py +0 -0
- arctrl/py/Core/Helper/collections_.py +438 -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 +248 -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 +1264 -0
- arctrl/py/Core/Table/arc_table_aux.py +575 -0
- arctrl/py/Core/Table/arc_tables.py +591 -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 +5064 -0
- arctrl/py/Core/comment.py +128 -0
- arctrl/py/Core/comment_list.py +127 -0
- arctrl/py/Core/conversion.py +1313 -0
- arctrl/py/Core/data.py +245 -0
- arctrl/py/Core/data_context.py +157 -0
- arctrl/py/Core/data_file.py +112 -0
- arctrl/py/Core/data_map.py +225 -0
- arctrl/py/Core/identifier_setters.py +31 -0
- arctrl/py/Core/iproperty_value.py +36 -0
- arctrl/py/Core/ontology_annotation.py +299 -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 +5 -0
- arctrl/py/FileSystem/default_gitignore.py +5 -0
- arctrl/py/FileSystem/file_system.py +58 -0
- arctrl/py/FileSystem/file_system_tree.py +426 -0
- arctrl/py/FileSystem/path.py +64 -0
- arctrl/py/Json/DataMap/__init__.py +0 -0
- arctrl/py/Json/DataMap/data_context.py +101 -0
- arctrl/py/Json/DataMap/data_map.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 +79 -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 +79 -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 +133 -0
- arctrl/py/Json/ROCrate/ldgraph.py +111 -0
- arctrl/py/Json/ROCrate/ldnode.py +290 -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 +393 -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 +155 -0
- arctrl/py/Json/encode.py +92 -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/string_table.py +76 -0
- arctrl/py/Json/study.py +793 -0
- arctrl/py/JsonIO/DataMap/__init__.py +0 -0
- arctrl/py/JsonIO/DataMap/data_map.py +53 -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 +121 -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 +85 -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/decode.py +9 -0
- arctrl/py/JsonIO/encode.py +1 -0
- arctrl/py/JsonIO/investigation.py +113 -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/study.py +114 -0
- arctrl/py/ROCrate/Generic/__init__.py +0 -0
- arctrl/py/ROCrate/Generic/comment.py +131 -0
- arctrl/py/ROCrate/Generic/dataset.py +817 -0
- arctrl/py/ROCrate/Generic/defined_term.py +131 -0
- arctrl/py/ROCrate/Generic/file.py +237 -0
- arctrl/py/ROCrate/Generic/lab_process.py +324 -0
- arctrl/py/ROCrate/Generic/lab_protocol.py +338 -0
- arctrl/py/ROCrate/Generic/organization.py +83 -0
- arctrl/py/ROCrate/Generic/person.py +484 -0
- arctrl/py/ROCrate/Generic/postal_address.py +195 -0
- arctrl/py/ROCrate/Generic/property_value.py +696 -0
- arctrl/py/ROCrate/Generic/sample.py +202 -0
- arctrl/py/ROCrate/Generic/scholarly_article.py +229 -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/__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 +362 -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 +193 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +210 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
- arctrl/py/Spreadsheet/DataMapTable/__init__.py +0 -0
- arctrl/py/Spreadsheet/DataMapTable/data_map_column.py +114 -0
- arctrl/py/Spreadsheet/DataMapTable/data_map_header.py +618 -0
- arctrl/py/Spreadsheet/DataMapTable/data_map_table.py +119 -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 +508 -0
- arctrl/py/Spreadsheet/Metadata/study.py +312 -0
- arctrl/py/Spreadsheet/Metadata/workflow.py +151 -0
- arctrl/py/Spreadsheet/__init__.py +0 -0
- arctrl/py/Spreadsheet/arc_assay.py +233 -0
- arctrl/py/Spreadsheet/arc_investigation.py +418 -0
- arctrl/py/Spreadsheet/arc_run.py +190 -0
- arctrl/py/Spreadsheet/arc_study.py +144 -0
- arctrl/py/Spreadsheet/arc_workflow.py +176 -0
- arctrl/py/Spreadsheet/assembly_info.py +1 -0
- arctrl/py/Spreadsheet/collection_aux.py +167 -0
- arctrl/py/Spreadsheet/data_map.py +44 -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/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 +1400 -0
- arctrl/py/column_index.py +280 -0
- arctrl/py/conversion.py +2184 -0
- arctrl/py/cross_async.py +76 -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 +338 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +469 -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 +464 -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 +57 -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 +217 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +47 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +186 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +90 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +78 -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 +393 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +127 -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 +218 -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 +180 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +600 -0
- arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +330 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +63 -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 +53 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +40 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +54 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
- arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
- arctrl/py/fable_modules/thoth_json_core/decode.py +1588 -0
- arctrl/py/fable_modules/thoth_json_core/encode.py +261 -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/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 +665 -0
- arctrl/py/fable_modules/yamlicious/regex.py +21 -0
- arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +256 -0
- arctrl/py/fable_modules/yamlicious/writer.py +175 -0
- arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
- arctrl/py/json.py +213 -0
- arctrl/py/rocrate_io.py +72 -0
- arctrl/py/template_web.py +23 -0
- arctrl/py/xlsx.py +148 -0
- arctrl/rocrate.py +21 -0
- arctrl-3.0.0a3.dist-info/LICENSE +21 -0
- arctrl-3.0.0a3.dist-info/METADATA +119 -0
- arctrl-3.0.0a3.dist-info/RECORD +456 -0
- arctrl-3.0.0a3.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from typing import Any
|
|
4
|
+
from ...fable_modules.fable_library.array_ import (map as map_1, initialize, iterate_indexed, iterate as iterate_2, sort_descending, map_indexed, indexed, sort_by)
|
|
5
|
+
from ...fable_modules.fable_library.list import (FSharpList, is_empty, iterate as iterate_1, append)
|
|
6
|
+
from ...fable_modules.fable_library.map_util import (add_to_dict, get_item_from_dict)
|
|
7
|
+
from ...fable_modules.fable_library.mutable_map import Dictionary
|
|
8
|
+
from ...fable_modules.fable_library.option import (default_arg, map as map_2, value as value_3)
|
|
9
|
+
from ...fable_modules.fable_library.range import range_big_int
|
|
10
|
+
from ...fable_modules.fable_library.reflection import (TypeInfo, class_type)
|
|
11
|
+
from ...fable_modules.fable_library.seq import (to_array, delay, map, iterate, remove_at, collect, singleton, empty, try_find_index, length, filter, choose, indexed as indexed_1, to_list, append as append_1, fold, item)
|
|
12
|
+
from ...fable_modules.fable_library.seq2 import Array_groupBy
|
|
13
|
+
from ...fable_modules.fable_library.string_ import (to_fail, printf, join)
|
|
14
|
+
from ...fable_modules.fable_library.system_text import (StringBuilder__ctor, StringBuilder__AppendLine_Z721C83C5)
|
|
15
|
+
from ...fable_modules.fable_library.types import (Array, to_string, Int32Array)
|
|
16
|
+
from ...fable_modules.fable_library.util import (ignore, equal_arrays, array_hash, IEnumerable_1, get_enumerator, dispose, equals, compare_primitives, safe_hash, compare_arrays)
|
|
17
|
+
from ..Helper.collections_ import ResizeArray_map
|
|
18
|
+
from ..Helper.hash_codes import (box_hash_array, box_hash_seq)
|
|
19
|
+
from ..ontology_annotation import OntologyAnnotation
|
|
20
|
+
from .arc_table_aux import (SanityChecks_validate, get_column_count, get_row_count, Unchecked_tryGetCellAt, SanityChecks_validateColumnIndex, SanityChecks_validateRowIndex, Unchecked_setCellAt, try_find_duplicate_unique, SanityChecks_validateColumn, Unchecked_addColumn, Unchecked_fillMissingCells, Unchecked_removeHeader, Unchecked_removeColumnCells, try_find_duplicate_unique_in_array, Unchecked_removeColumnCells_withIndexChange, Unchecked_moveColumnTo, Unchecked_getEmptyCellForHeader, Unchecked_addRow, Unchecked_addRows, Unchecked_removeRowCells_withIndexChange, Unchecked_extendToRowCount, Unchecked_alignByHeaders, box_hash_values)
|
|
21
|
+
from .composite_cell import CompositeCell
|
|
22
|
+
from .composite_column import CompositeColumn
|
|
23
|
+
from .composite_header import CompositeHeader
|
|
24
|
+
|
|
25
|
+
def _expr780() -> TypeInfo:
|
|
26
|
+
return class_type("ARCtrl.ArcTable", None, ArcTable)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ArcTable:
|
|
30
|
+
def __init__(self, name: str, headers: Array[CompositeHeader], values: Any) -> None:
|
|
31
|
+
valid: bool = SanityChecks_validate(headers, values, True)
|
|
32
|
+
self.name_004021: str = name
|
|
33
|
+
self.headers_004022: Array[CompositeHeader] = headers
|
|
34
|
+
self.values_004023: Any = values
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def Headers(self, __unit: None=None) -> Array[CompositeHeader]:
|
|
38
|
+
this: ArcTable = self
|
|
39
|
+
return this.headers_004022
|
|
40
|
+
|
|
41
|
+
@Headers.setter
|
|
42
|
+
def Headers(self, new_headers: Array[CompositeHeader]) -> None:
|
|
43
|
+
this: ArcTable = self
|
|
44
|
+
ignore(SanityChecks_validate(new_headers, this.values_004023, True))
|
|
45
|
+
this.headers_004022 = new_headers
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def Values(self, __unit: None=None) -> Any:
|
|
49
|
+
this: ArcTable = self
|
|
50
|
+
return this.values_004023
|
|
51
|
+
|
|
52
|
+
@Values.setter
|
|
53
|
+
def Values(self, new_values: Any) -> None:
|
|
54
|
+
this: ArcTable = self
|
|
55
|
+
ignore(SanityChecks_validate(this.headers_004022, new_values, True))
|
|
56
|
+
this.values_004023 = new_values
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def Name(self, __unit: None=None) -> str:
|
|
60
|
+
this: ArcTable = self
|
|
61
|
+
return this.name_004021
|
|
62
|
+
|
|
63
|
+
@Name.setter
|
|
64
|
+
def Name(self, new_name: str) -> None:
|
|
65
|
+
this: ArcTable = self
|
|
66
|
+
this.name_004021 = new_name
|
|
67
|
+
|
|
68
|
+
@staticmethod
|
|
69
|
+
def create(name: str, headers: Array[CompositeHeader], values: Any) -> ArcTable:
|
|
70
|
+
return ArcTable(name, headers, values)
|
|
71
|
+
|
|
72
|
+
@staticmethod
|
|
73
|
+
def init(name: str) -> ArcTable:
|
|
74
|
+
class ObjectExpr699:
|
|
75
|
+
@property
|
|
76
|
+
def Equals(self) -> Callable[[tuple[int, int], tuple[int, int]], bool]:
|
|
77
|
+
return equal_arrays
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def GetHashCode(self) -> Callable[[tuple[int, int]], int]:
|
|
81
|
+
return array_hash
|
|
82
|
+
|
|
83
|
+
return ArcTable(name, [], Dictionary([], ObjectExpr699()))
|
|
84
|
+
|
|
85
|
+
@staticmethod
|
|
86
|
+
def create_from_headers(name: str, headers: Array[CompositeHeader]) -> ArcTable:
|
|
87
|
+
class ObjectExpr700:
|
|
88
|
+
@property
|
|
89
|
+
def Equals(self) -> Callable[[tuple[int, int], tuple[int, int]], bool]:
|
|
90
|
+
return equal_arrays
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def GetHashCode(self) -> Callable[[tuple[int, int]], int]:
|
|
94
|
+
return array_hash
|
|
95
|
+
|
|
96
|
+
return ArcTable.create(name, headers, Dictionary([], ObjectExpr700()))
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def create_from_rows(name: str, headers: Array[CompositeHeader], rows: Array[Array[CompositeCell]]) -> ArcTable:
|
|
100
|
+
t: ArcTable = ArcTable.create_from_headers(name, headers)
|
|
101
|
+
t.AddRows(rows)
|
|
102
|
+
return t
|
|
103
|
+
|
|
104
|
+
def Validate(self, raise_exception: bool | None=None) -> bool:
|
|
105
|
+
this: ArcTable = self
|
|
106
|
+
raise_exception_1: bool = default_arg(raise_exception, True)
|
|
107
|
+
return SanityChecks_validate(this.Headers, this.Values, raise_exception_1)
|
|
108
|
+
|
|
109
|
+
@staticmethod
|
|
110
|
+
def validate(raise_exception: bool | None=None) -> Callable[[ArcTable], bool]:
|
|
111
|
+
def _arrow701(table: ArcTable) -> bool:
|
|
112
|
+
return table.Validate(raise_exception)
|
|
113
|
+
|
|
114
|
+
return _arrow701
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def ColumnCount(self, __unit: None=None) -> int:
|
|
118
|
+
this: ArcTable = self
|
|
119
|
+
return get_column_count(this.Headers)
|
|
120
|
+
|
|
121
|
+
@staticmethod
|
|
122
|
+
def column_count(table: ArcTable) -> int:
|
|
123
|
+
return table.ColumnCount
|
|
124
|
+
|
|
125
|
+
@property
|
|
126
|
+
def RowCount(self, __unit: None=None) -> int:
|
|
127
|
+
this: ArcTable = self
|
|
128
|
+
return get_row_count(this.Values)
|
|
129
|
+
|
|
130
|
+
@staticmethod
|
|
131
|
+
def row_count(table: ArcTable) -> int:
|
|
132
|
+
return table.RowCount
|
|
133
|
+
|
|
134
|
+
@property
|
|
135
|
+
def Columns(self, __unit: None=None) -> Array[CompositeColumn]:
|
|
136
|
+
this: ArcTable = self
|
|
137
|
+
def _arrow703(__unit: None=None) -> IEnumerable_1[CompositeColumn]:
|
|
138
|
+
def _arrow702(i: int) -> CompositeColumn:
|
|
139
|
+
return this.GetColumn(i)
|
|
140
|
+
|
|
141
|
+
return map(_arrow702, range_big_int(0, 1, this.ColumnCount - 1))
|
|
142
|
+
|
|
143
|
+
return to_array(delay(_arrow703))
|
|
144
|
+
|
|
145
|
+
def Copy(self, __unit: None=None) -> ArcTable:
|
|
146
|
+
this: ArcTable = self
|
|
147
|
+
def f(h: CompositeHeader) -> CompositeHeader:
|
|
148
|
+
return h.Copy()
|
|
149
|
+
|
|
150
|
+
next_headers: Array[CompositeHeader] = ResizeArray_map(f, this.Headers)
|
|
151
|
+
class ObjectExpr704:
|
|
152
|
+
@property
|
|
153
|
+
def Equals(self) -> Callable[[tuple[int, int], tuple[int, int]], bool]:
|
|
154
|
+
return equal_arrays
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def GetHashCode(self) -> Callable[[tuple[int, int]], int]:
|
|
158
|
+
return array_hash
|
|
159
|
+
|
|
160
|
+
next_values: Any = Dictionary([], ObjectExpr704())
|
|
161
|
+
def action(tupled_arg: tuple[int, int]) -> None:
|
|
162
|
+
ci: int = tupled_arg[0] or 0
|
|
163
|
+
ri: int = tupled_arg[1] or 0
|
|
164
|
+
add_to_dict(next_values, (ci, ri), get_item_from_dict(this.Values, (ci, ri)).Copy())
|
|
165
|
+
|
|
166
|
+
iterate(action, this.Values.keys())
|
|
167
|
+
return ArcTable.create(this.Name, next_headers, next_values)
|
|
168
|
+
|
|
169
|
+
def TryGetCellAt(self, column: int, row: int) -> CompositeCell | None:
|
|
170
|
+
this: ArcTable = self
|
|
171
|
+
return Unchecked_tryGetCellAt(column, row, this.Values)
|
|
172
|
+
|
|
173
|
+
@staticmethod
|
|
174
|
+
def try_get_cell_at(column: int, row: int) -> Callable[[ArcTable], CompositeCell | None]:
|
|
175
|
+
def _arrow705(table: ArcTable) -> CompositeCell | None:
|
|
176
|
+
return table.TryGetCellAt(column, row)
|
|
177
|
+
|
|
178
|
+
return _arrow705
|
|
179
|
+
|
|
180
|
+
def GetCellAt(self, column: int, row: int) -> CompositeCell:
|
|
181
|
+
this: ArcTable = self
|
|
182
|
+
try:
|
|
183
|
+
return get_item_from_dict(this.Values, (column, row))
|
|
184
|
+
|
|
185
|
+
except Exception as match_value:
|
|
186
|
+
arg_2: str = this.Name
|
|
187
|
+
return to_fail(printf("Unable to find cell for index: (%i, %i) in table %s"))(column)(row)(arg_2)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
@staticmethod
|
|
191
|
+
def get_cell_at(column: int, row: int) -> Callable[[ArcTable], CompositeCell]:
|
|
192
|
+
def _arrow706(table: ArcTable) -> CompositeCell:
|
|
193
|
+
return table.GetCellAt(column, row)
|
|
194
|
+
|
|
195
|
+
return _arrow706
|
|
196
|
+
|
|
197
|
+
def IterColumns(self, action: Callable[[CompositeColumn], None]) -> None:
|
|
198
|
+
this: ArcTable = self
|
|
199
|
+
for column_index in range(0, (this.ColumnCount - 1) + 1, 1):
|
|
200
|
+
action(this.GetColumn(column_index))
|
|
201
|
+
|
|
202
|
+
@staticmethod
|
|
203
|
+
def iter_columns(action: Callable[[CompositeColumn], None]) -> Callable[[ArcTable], ArcTable]:
|
|
204
|
+
def _arrow707(table: ArcTable) -> ArcTable:
|
|
205
|
+
copy: ArcTable = table.Copy()
|
|
206
|
+
copy.IterColumns(action)
|
|
207
|
+
return copy
|
|
208
|
+
|
|
209
|
+
return _arrow707
|
|
210
|
+
|
|
211
|
+
def IteriColumns(self, action: Callable[[int, CompositeColumn], None]) -> None:
|
|
212
|
+
this: ArcTable = self
|
|
213
|
+
for column_index in range(0, (this.ColumnCount - 1) + 1, 1):
|
|
214
|
+
action(column_index, this.GetColumn(column_index))
|
|
215
|
+
|
|
216
|
+
@staticmethod
|
|
217
|
+
def iteri_columns(action: Callable[[int, CompositeColumn], None]) -> Callable[[ArcTable], ArcTable]:
|
|
218
|
+
def _arrow708(table: ArcTable) -> ArcTable:
|
|
219
|
+
copy: ArcTable = table.Copy()
|
|
220
|
+
copy.IteriColumns(action)
|
|
221
|
+
return copy
|
|
222
|
+
|
|
223
|
+
return _arrow708
|
|
224
|
+
|
|
225
|
+
def UpdateCellAt(self, column_index: int, row_index: int, c: CompositeCell, skip_validation: bool | None=None) -> None:
|
|
226
|
+
this: ArcTable = self
|
|
227
|
+
if not default_arg(skip_validation, False):
|
|
228
|
+
SanityChecks_validateColumnIndex(column_index, this.ColumnCount, False)
|
|
229
|
+
SanityChecks_validateRowIndex(row_index, this.RowCount, False)
|
|
230
|
+
ignore(c.ValidateAgainstHeader(this.Headers[column_index], True))
|
|
231
|
+
|
|
232
|
+
Unchecked_setCellAt(column_index, row_index, c, this.Values)
|
|
233
|
+
|
|
234
|
+
@staticmethod
|
|
235
|
+
def update_cell_at(column_index: int, row_index: int, cell: CompositeCell, skip_validation: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
236
|
+
def _arrow709(table: ArcTable) -> ArcTable:
|
|
237
|
+
new_table: ArcTable = table.Copy()
|
|
238
|
+
new_table.UpdateCellAt(column_index, row_index, cell, skip_validation)
|
|
239
|
+
return new_table
|
|
240
|
+
|
|
241
|
+
return _arrow709
|
|
242
|
+
|
|
243
|
+
def SetCellAt(self, column_index: int, row_index: int, c: CompositeCell, skip_validation: bool | None=None) -> None:
|
|
244
|
+
this: ArcTable = self
|
|
245
|
+
if not default_arg(skip_validation, False):
|
|
246
|
+
SanityChecks_validateColumnIndex(column_index, this.ColumnCount, False)
|
|
247
|
+
ignore(c.ValidateAgainstHeader(this.Headers[column_index], True))
|
|
248
|
+
|
|
249
|
+
Unchecked_setCellAt(column_index, row_index, c, this.Values)
|
|
250
|
+
|
|
251
|
+
@staticmethod
|
|
252
|
+
def set_cell_at(column_index: int, row_index: int, cell: CompositeCell, skip_validation: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
253
|
+
def _arrow710(table: ArcTable) -> ArcTable:
|
|
254
|
+
new_table: ArcTable = table.Copy()
|
|
255
|
+
new_table.SetCellAt(column_index, row_index, cell, skip_validation)
|
|
256
|
+
return new_table
|
|
257
|
+
|
|
258
|
+
return _arrow710
|
|
259
|
+
|
|
260
|
+
def UpdateCellsBy(self, f: Callable[[int, int, CompositeCell], CompositeCell], skip_validation: bool | None=None) -> None:
|
|
261
|
+
this: ArcTable = self
|
|
262
|
+
skip_validation_1: bool = default_arg(skip_validation, False)
|
|
263
|
+
enumerator: Any = get_enumerator(this.Values)
|
|
264
|
+
try:
|
|
265
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
266
|
+
kv: Any = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
267
|
+
pattern_input: tuple[int, int] = kv[0]
|
|
268
|
+
ri: int = pattern_input[1] or 0
|
|
269
|
+
ci: int = pattern_input[0] or 0
|
|
270
|
+
new_cell: CompositeCell = f(ci, ri, kv[1])
|
|
271
|
+
if not skip_validation_1:
|
|
272
|
+
ignore(new_cell.ValidateAgainstHeader(this.Headers[ci], True))
|
|
273
|
+
|
|
274
|
+
Unchecked_setCellAt(ci, ri, new_cell, this.Values)
|
|
275
|
+
|
|
276
|
+
finally:
|
|
277
|
+
dispose(enumerator)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
@staticmethod
|
|
281
|
+
def update_cells_by(f: Callable[[int, int, CompositeCell], CompositeCell], skip_validation: bool | None=None) -> Callable[[ArcTable], None]:
|
|
282
|
+
def _arrow711(table: ArcTable) -> None:
|
|
283
|
+
new_table: ArcTable = table.Copy()
|
|
284
|
+
new_table.UpdateCellsBy(f, skip_validation)
|
|
285
|
+
|
|
286
|
+
return _arrow711
|
|
287
|
+
|
|
288
|
+
def UpdateCellBy(self, column_index: int, row_index: int, f: Callable[[CompositeCell], CompositeCell], skip_validation: bool | None=None) -> None:
|
|
289
|
+
this: ArcTable = self
|
|
290
|
+
skip_validation_1: bool = default_arg(skip_validation, False)
|
|
291
|
+
if not skip_validation_1:
|
|
292
|
+
SanityChecks_validateColumnIndex(column_index, this.ColumnCount, False)
|
|
293
|
+
SanityChecks_validateRowIndex(row_index, this.RowCount, False)
|
|
294
|
+
|
|
295
|
+
new_cell: CompositeCell = f(this.GetCellAt(column_index, row_index))
|
|
296
|
+
if not skip_validation_1:
|
|
297
|
+
ignore(new_cell.ValidateAgainstHeader(this.Headers[column_index], True))
|
|
298
|
+
|
|
299
|
+
Unchecked_setCellAt(column_index, row_index, new_cell, this.Values)
|
|
300
|
+
|
|
301
|
+
@staticmethod
|
|
302
|
+
def update_cell_by(column_index: int, row_index: int, f: Callable[[CompositeCell], CompositeCell], skip_validation: bool | None=None) -> Callable[[ArcTable], None]:
|
|
303
|
+
def _arrow712(table: ArcTable) -> None:
|
|
304
|
+
new_table: ArcTable = table.Copy()
|
|
305
|
+
new_table.UpdateCellBy(column_index, row_index, f, skip_validation)
|
|
306
|
+
|
|
307
|
+
return _arrow712
|
|
308
|
+
|
|
309
|
+
def UpdateHeader(self, index: int, new_header: CompositeHeader, force_convert_cells: bool | None=None) -> None:
|
|
310
|
+
this: ArcTable = self
|
|
311
|
+
force_convert_cells_1: bool = default_arg(force_convert_cells, False)
|
|
312
|
+
SanityChecks_validateColumnIndex(index, this.ColumnCount, False)
|
|
313
|
+
header: CompositeHeader = new_header
|
|
314
|
+
match_value: int | None = try_find_duplicate_unique(header, remove_at(index, this.Headers))
|
|
315
|
+
if match_value is not None:
|
|
316
|
+
raise Exception(((("Invalid input. Tried setting unique header `" + str(header)) + "`, but header of same type already exists at index ") + str(match_value)) + ".")
|
|
317
|
+
|
|
318
|
+
c: CompositeColumn = CompositeColumn(new_header, this.GetColumn(index).Cells)
|
|
319
|
+
if c.Validate():
|
|
320
|
+
set_header: None
|
|
321
|
+
this.Headers[index] = new_header
|
|
322
|
+
|
|
323
|
+
elif force_convert_cells_1:
|
|
324
|
+
def mapping(c_1: CompositeCell) -> CompositeCell:
|
|
325
|
+
if c_1.is_free_text:
|
|
326
|
+
return c_1.ToTermCell()
|
|
327
|
+
|
|
328
|
+
else:
|
|
329
|
+
return c_1
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def mapping_1(c_2: CompositeCell) -> CompositeCell:
|
|
333
|
+
return c_2.ToFreeTextCell()
|
|
334
|
+
|
|
335
|
+
converted_cells: Array[CompositeCell] = map_1(mapping, c.Cells, None) if new_header.IsTermColumn else map_1(mapping_1, c.Cells, None)
|
|
336
|
+
this.UpdateColumn(index, new_header, converted_cells)
|
|
337
|
+
|
|
338
|
+
else:
|
|
339
|
+
raise Exception("Tried setting header for column with invalid type of cells. Set `forceConvertCells` flag to automatically convert cells into valid CompositeCell type.")
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
@staticmethod
|
|
343
|
+
def update_header(index: int, header: CompositeHeader) -> Callable[[ArcTable], ArcTable]:
|
|
344
|
+
def _arrow713(table: ArcTable) -> ArcTable:
|
|
345
|
+
new_table: ArcTable = table.Copy()
|
|
346
|
+
new_table.UpdateHeader(index, header)
|
|
347
|
+
return new_table
|
|
348
|
+
|
|
349
|
+
return _arrow713
|
|
350
|
+
|
|
351
|
+
def AddColumn(self, header: CompositeHeader, cells: Array[CompositeCell] | None=None, index: int | None=None, force_replace: bool | None=None, skip_fill_missing: bool | None=None) -> None:
|
|
352
|
+
this: ArcTable = self
|
|
353
|
+
index_1: int = default_arg(index, this.ColumnCount) or 0
|
|
354
|
+
cells_1: Array[CompositeCell] = default_arg(cells, [])
|
|
355
|
+
force_replace_1: bool = default_arg(force_replace, False)
|
|
356
|
+
SanityChecks_validateColumnIndex(index_1, this.ColumnCount, True)
|
|
357
|
+
SanityChecks_validateColumn(CompositeColumn.create(header, cells_1))
|
|
358
|
+
Unchecked_addColumn(header, cells_1, index_1, force_replace_1, False, this.Headers, this.Values)
|
|
359
|
+
if not equals(skip_fill_missing, True):
|
|
360
|
+
Unchecked_fillMissingCells(this.Headers, this.Values)
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
@staticmethod
|
|
364
|
+
def add_column(header: CompositeHeader, cells: Array[CompositeCell] | None=None, index: int | None=None, force_replace: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
365
|
+
def _arrow714(table: ArcTable) -> ArcTable:
|
|
366
|
+
new_table: ArcTable = table.Copy()
|
|
367
|
+
new_table.AddColumn(header, cells, index, force_replace)
|
|
368
|
+
return new_table
|
|
369
|
+
|
|
370
|
+
return _arrow714
|
|
371
|
+
|
|
372
|
+
def AddColumnFill(self, header: CompositeHeader, cell: CompositeCell, index: int | None=None, force_replace: bool | None=None) -> None:
|
|
373
|
+
this: ArcTable = self
|
|
374
|
+
def _arrow715(_arg: int) -> CompositeCell:
|
|
375
|
+
return cell.Copy()
|
|
376
|
+
|
|
377
|
+
cells: Array[CompositeCell] = initialize(this.RowCount, _arrow715, None)
|
|
378
|
+
this.AddColumn(header, cells, index, force_replace)
|
|
379
|
+
|
|
380
|
+
@staticmethod
|
|
381
|
+
def add_column_fill(header: CompositeHeader, cell: CompositeCell, index: int | None=None, force_replace: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
382
|
+
def _arrow716(table: ArcTable) -> ArcTable:
|
|
383
|
+
new_table: ArcTable = table.Copy()
|
|
384
|
+
new_table.AddColumnFill(header, cell, index, force_replace)
|
|
385
|
+
return new_table
|
|
386
|
+
|
|
387
|
+
return _arrow716
|
|
388
|
+
|
|
389
|
+
def UpdateColumn(self, column_index: int, header: CompositeHeader, cells: Array[CompositeCell] | None=None, skip_fill_missing: bool | None=None) -> None:
|
|
390
|
+
this: ArcTable = self
|
|
391
|
+
SanityChecks_validateColumnIndex(column_index, this.ColumnCount, False)
|
|
392
|
+
column: CompositeColumn = CompositeColumn.create(header, cells)
|
|
393
|
+
SanityChecks_validateColumn(column)
|
|
394
|
+
header_1: CompositeHeader = column.Header
|
|
395
|
+
match_value: int | None = try_find_duplicate_unique(header_1, remove_at(column_index, this.Headers))
|
|
396
|
+
if match_value is not None:
|
|
397
|
+
raise Exception(((("Invalid input. Tried setting unique header `" + str(header_1)) + "`, but header of same type already exists at index ") + str(match_value)) + ".")
|
|
398
|
+
|
|
399
|
+
Unchecked_removeHeader(column_index, this.Headers)
|
|
400
|
+
Unchecked_removeColumnCells(column_index, this.Values)
|
|
401
|
+
this.Headers.insert(column_index, column.Header)
|
|
402
|
+
def action(row_index: int, v: CompositeCell) -> None:
|
|
403
|
+
Unchecked_setCellAt(column_index, row_index, v, this.Values)
|
|
404
|
+
|
|
405
|
+
iterate_indexed(action, column.Cells)
|
|
406
|
+
if not equals(skip_fill_missing, True):
|
|
407
|
+
Unchecked_fillMissingCells(this.Headers, this.Values)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
@staticmethod
|
|
411
|
+
def update_column(column_index: int, header: CompositeHeader, cells: Array[CompositeCell] | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
412
|
+
def _arrow717(table: ArcTable) -> ArcTable:
|
|
413
|
+
new_table: ArcTable = table.Copy()
|
|
414
|
+
new_table.UpdateColumn(column_index, header, cells)
|
|
415
|
+
return new_table
|
|
416
|
+
|
|
417
|
+
return _arrow717
|
|
418
|
+
|
|
419
|
+
def InsertColumn(self, index: int, header: CompositeHeader, cells: Array[CompositeCell] | None=None) -> None:
|
|
420
|
+
this: ArcTable = self
|
|
421
|
+
this.AddColumn(header, cells, index, False)
|
|
422
|
+
|
|
423
|
+
@staticmethod
|
|
424
|
+
def insert_column(index: int, header: CompositeHeader, cells: Array[CompositeCell] | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
425
|
+
def _arrow718(table: ArcTable) -> ArcTable:
|
|
426
|
+
new_table: ArcTable = table.Copy()
|
|
427
|
+
new_table.InsertColumn(index, header, cells)
|
|
428
|
+
return new_table
|
|
429
|
+
|
|
430
|
+
return _arrow718
|
|
431
|
+
|
|
432
|
+
def AppendColumn(self, header: CompositeHeader, cells: Array[CompositeCell] | None=None) -> None:
|
|
433
|
+
this: ArcTable = self
|
|
434
|
+
this.AddColumn(header, cells, this.ColumnCount, False)
|
|
435
|
+
|
|
436
|
+
@staticmethod
|
|
437
|
+
def append_column(header: CompositeHeader, cells: Array[CompositeCell] | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
438
|
+
def _arrow719(table: ArcTable) -> ArcTable:
|
|
439
|
+
new_table: ArcTable = table.Copy()
|
|
440
|
+
new_table.AppendColumn(header, cells)
|
|
441
|
+
return new_table
|
|
442
|
+
|
|
443
|
+
return _arrow719
|
|
444
|
+
|
|
445
|
+
def AddColumns(self, columns: Array[CompositeColumn], index: int | None=None, force_replace: bool | None=None, skip_fill_missing: bool | None=None) -> None:
|
|
446
|
+
this: ArcTable = self
|
|
447
|
+
index_1: int = default_arg(index, this.ColumnCount) or 0
|
|
448
|
+
force_replace_1: bool = default_arg(force_replace, False)
|
|
449
|
+
SanityChecks_validateColumnIndex(index_1, this.ColumnCount, True)
|
|
450
|
+
def mapping(x: CompositeColumn) -> CompositeHeader:
|
|
451
|
+
return x.Header
|
|
452
|
+
|
|
453
|
+
duplicates: FSharpList[dict[str, Any]] = try_find_duplicate_unique_in_array(map(mapping, columns))
|
|
454
|
+
if not is_empty(duplicates):
|
|
455
|
+
sb: Any = StringBuilder__ctor()
|
|
456
|
+
ignore(StringBuilder__AppendLine_Z721C83C5(sb, "Found duplicate unique columns in `columns`."))
|
|
457
|
+
def action(x_1: dict[str, Any]) -> None:
|
|
458
|
+
ignore(StringBuilder__AppendLine_Z721C83C5(sb, ((((("Duplicate `" + str(x_1["HeaderType"])) + "` at index ") + str(x_1["Index1"])) + " and ") + str(x_1["Index2"])) + "."))
|
|
459
|
+
|
|
460
|
+
iterate_1(action, duplicates)
|
|
461
|
+
raise Exception(to_string(sb))
|
|
462
|
+
|
|
463
|
+
def action_1(x_2: CompositeColumn) -> None:
|
|
464
|
+
SanityChecks_validateColumn(x_2)
|
|
465
|
+
|
|
466
|
+
iterate_2(action_1, columns)
|
|
467
|
+
def action_2(col: CompositeColumn) -> None:
|
|
468
|
+
nonlocal index_1
|
|
469
|
+
prev_headers_count: int = len(this.Headers) or 0
|
|
470
|
+
Unchecked_addColumn(col.Header, col.Cells, index_1, force_replace_1, False, this.Headers, this.Values)
|
|
471
|
+
if len(this.Headers) > prev_headers_count:
|
|
472
|
+
index_1 = (index_1 + 1) or 0
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
iterate_2(action_2, columns)
|
|
476
|
+
if not equals(skip_fill_missing, True):
|
|
477
|
+
Unchecked_fillMissingCells(this.Headers, this.Values)
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
@staticmethod
|
|
481
|
+
def add_columns(columns: Array[CompositeColumn], index: int | None=None, skip_fill_missing: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
482
|
+
def _arrow720(table: ArcTable) -> ArcTable:
|
|
483
|
+
new_table: ArcTable = table.Copy()
|
|
484
|
+
new_table.AddColumns(columns, index, None, skip_fill_missing)
|
|
485
|
+
return new_table
|
|
486
|
+
|
|
487
|
+
return _arrow720
|
|
488
|
+
|
|
489
|
+
def RemoveColumn(self, index: int) -> None:
|
|
490
|
+
this: ArcTable = self
|
|
491
|
+
SanityChecks_validateColumnIndex(index, this.ColumnCount, False)
|
|
492
|
+
column_count: int = this.ColumnCount or 0
|
|
493
|
+
Unchecked_removeHeader(index, this.Headers)
|
|
494
|
+
Unchecked_removeColumnCells_withIndexChange(index, column_count, this.RowCount, this.Values)
|
|
495
|
+
|
|
496
|
+
@staticmethod
|
|
497
|
+
def remove_column(index: int) -> Callable[[ArcTable], ArcTable]:
|
|
498
|
+
def _arrow721(table: ArcTable) -> ArcTable:
|
|
499
|
+
new_table: ArcTable = table.Copy()
|
|
500
|
+
new_table.RemoveColumn(index)
|
|
501
|
+
return new_table
|
|
502
|
+
|
|
503
|
+
return _arrow721
|
|
504
|
+
|
|
505
|
+
def RemoveColumns(self, index_arr: Array[int]) -> None:
|
|
506
|
+
this: ArcTable = self
|
|
507
|
+
def _arrow722(index: int) -> None:
|
|
508
|
+
SanityChecks_validateColumnIndex(index, this.ColumnCount, False)
|
|
509
|
+
|
|
510
|
+
iterate_2(_arrow722, index_arr)
|
|
511
|
+
def _arrow723(index_1: int) -> None:
|
|
512
|
+
this.RemoveColumn(index_1)
|
|
513
|
+
|
|
514
|
+
class ObjectExpr724:
|
|
515
|
+
@property
|
|
516
|
+
def Compare(self) -> Callable[[int, int], int]:
|
|
517
|
+
return compare_primitives
|
|
518
|
+
|
|
519
|
+
iterate_2(_arrow723, sort_descending(index_arr, ObjectExpr724()))
|
|
520
|
+
|
|
521
|
+
@staticmethod
|
|
522
|
+
def remove_columns(index_arr: Array[int]) -> Callable[[ArcTable], ArcTable]:
|
|
523
|
+
def _arrow725(table: ArcTable) -> ArcTable:
|
|
524
|
+
new_table: ArcTable = table.Copy()
|
|
525
|
+
new_table.RemoveColumns(index_arr)
|
|
526
|
+
return new_table
|
|
527
|
+
|
|
528
|
+
return _arrow725
|
|
529
|
+
|
|
530
|
+
def GetColumn(self, column_index: int) -> CompositeColumn:
|
|
531
|
+
this: ArcTable = self
|
|
532
|
+
SanityChecks_validateColumnIndex(column_index, this.ColumnCount, False)
|
|
533
|
+
h: CompositeHeader = this.Headers[column_index]
|
|
534
|
+
def _arrow727(__unit: None=None) -> IEnumerable_1[CompositeCell]:
|
|
535
|
+
def _arrow726(i: int) -> IEnumerable_1[CompositeCell]:
|
|
536
|
+
match_value: CompositeCell | None = this.TryGetCellAt(column_index, i)
|
|
537
|
+
if match_value is not None:
|
|
538
|
+
return singleton(match_value)
|
|
539
|
+
|
|
540
|
+
else:
|
|
541
|
+
to_fail(printf("Unable to find cell for index: (%i, %i)"))(column_index)(i)
|
|
542
|
+
return empty()
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
return collect(_arrow726, range_big_int(0, 1, this.RowCount - 1))
|
|
546
|
+
|
|
547
|
+
cells: Array[CompositeCell] = to_array(delay(_arrow727))
|
|
548
|
+
return CompositeColumn.create(h, cells)
|
|
549
|
+
|
|
550
|
+
@staticmethod
|
|
551
|
+
def get_column(index: int) -> Callable[[ArcTable], CompositeColumn]:
|
|
552
|
+
def _arrow728(table: ArcTable) -> CompositeColumn:
|
|
553
|
+
return table.GetColumn(index)
|
|
554
|
+
|
|
555
|
+
return _arrow728
|
|
556
|
+
|
|
557
|
+
def TryGetColumnByHeader(self, header: CompositeHeader) -> CompositeColumn | None:
|
|
558
|
+
this: ArcTable = self
|
|
559
|
+
def mapping(i: int) -> CompositeColumn:
|
|
560
|
+
return this.GetColumn(i)
|
|
561
|
+
|
|
562
|
+
def predicate(x: CompositeHeader) -> bool:
|
|
563
|
+
return equals(x, header)
|
|
564
|
+
|
|
565
|
+
return map_2(mapping, try_find_index(predicate, this.Headers))
|
|
566
|
+
|
|
567
|
+
@staticmethod
|
|
568
|
+
def try_get_column_by_header(header: CompositeHeader) -> Callable[[ArcTable], CompositeColumn | None]:
|
|
569
|
+
def _arrow729(table: ArcTable) -> CompositeColumn | None:
|
|
570
|
+
return table.TryGetColumnByHeader(header)
|
|
571
|
+
|
|
572
|
+
return _arrow729
|
|
573
|
+
|
|
574
|
+
def TryGetColumnByHeaderBy(self, header_predicate: Callable[[CompositeHeader], bool]) -> CompositeColumn | None:
|
|
575
|
+
this: ArcTable = self
|
|
576
|
+
def mapping(i: int) -> CompositeColumn:
|
|
577
|
+
return this.GetColumn(i)
|
|
578
|
+
|
|
579
|
+
return map_2(mapping, try_find_index(header_predicate, this.Headers))
|
|
580
|
+
|
|
581
|
+
@staticmethod
|
|
582
|
+
def try_get_column_by_header_by(header_predicate: Callable[[CompositeHeader], bool]) -> Callable[[ArcTable], CompositeColumn | None]:
|
|
583
|
+
def _arrow730(table: ArcTable) -> CompositeColumn | None:
|
|
584
|
+
return table.TryGetColumnByHeaderBy(header_predicate)
|
|
585
|
+
|
|
586
|
+
return _arrow730
|
|
587
|
+
|
|
588
|
+
def GetColumnByHeader(self, header: CompositeHeader) -> CompositeColumn:
|
|
589
|
+
this: ArcTable = self
|
|
590
|
+
match_value: CompositeColumn | None = this.TryGetColumnByHeader(header)
|
|
591
|
+
if match_value is None:
|
|
592
|
+
arg: str = this.Name
|
|
593
|
+
return to_fail(printf("Unable to find column with header in table %s: %O"))(arg)(header)
|
|
594
|
+
|
|
595
|
+
else:
|
|
596
|
+
return match_value
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
@staticmethod
|
|
600
|
+
def get_column_by_header(header: CompositeHeader) -> Callable[[ArcTable], CompositeColumn]:
|
|
601
|
+
def _arrow731(table: ArcTable) -> CompositeColumn:
|
|
602
|
+
return table.GetColumnByHeader(header)
|
|
603
|
+
|
|
604
|
+
return _arrow731
|
|
605
|
+
|
|
606
|
+
def TryGetInputColumn(self, __unit: None=None) -> CompositeColumn | None:
|
|
607
|
+
this: ArcTable = self
|
|
608
|
+
def mapping(i: int) -> CompositeColumn:
|
|
609
|
+
return this.GetColumn(i)
|
|
610
|
+
|
|
611
|
+
def predicate(x: CompositeHeader) -> bool:
|
|
612
|
+
return x.is_input
|
|
613
|
+
|
|
614
|
+
return map_2(mapping, try_find_index(predicate, this.Headers))
|
|
615
|
+
|
|
616
|
+
@staticmethod
|
|
617
|
+
def try_get_input_column(__unit: None=None) -> Callable[[ArcTable], CompositeColumn | None]:
|
|
618
|
+
def _arrow732(table: ArcTable) -> CompositeColumn | None:
|
|
619
|
+
return table.TryGetInputColumn()
|
|
620
|
+
|
|
621
|
+
return _arrow732
|
|
622
|
+
|
|
623
|
+
def GetInputColumn(self, __unit: None=None) -> CompositeColumn:
|
|
624
|
+
this: ArcTable = self
|
|
625
|
+
match_value: CompositeColumn | None = this.TryGetInputColumn()
|
|
626
|
+
if match_value is None:
|
|
627
|
+
arg: str = this.Name
|
|
628
|
+
return to_fail(printf("Unable to find input column in table %s"))(arg)
|
|
629
|
+
|
|
630
|
+
else:
|
|
631
|
+
return match_value
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
@staticmethod
|
|
635
|
+
def get_input_column(__unit: None=None) -> Callable[[ArcTable], CompositeColumn]:
|
|
636
|
+
def _arrow733(table: ArcTable) -> CompositeColumn:
|
|
637
|
+
return table.GetInputColumn()
|
|
638
|
+
|
|
639
|
+
return _arrow733
|
|
640
|
+
|
|
641
|
+
def TryGetOutputColumn(self, __unit: None=None) -> CompositeColumn | None:
|
|
642
|
+
this: ArcTable = self
|
|
643
|
+
def mapping(i: int) -> CompositeColumn:
|
|
644
|
+
return this.GetColumn(i)
|
|
645
|
+
|
|
646
|
+
def predicate(x: CompositeHeader) -> bool:
|
|
647
|
+
return x.is_output
|
|
648
|
+
|
|
649
|
+
return map_2(mapping, try_find_index(predicate, this.Headers))
|
|
650
|
+
|
|
651
|
+
@staticmethod
|
|
652
|
+
def try_get_output_column(__unit: None=None) -> Callable[[ArcTable], CompositeColumn | None]:
|
|
653
|
+
def _arrow734(table: ArcTable) -> CompositeColumn | None:
|
|
654
|
+
return table.TryGetOutputColumn()
|
|
655
|
+
|
|
656
|
+
return _arrow734
|
|
657
|
+
|
|
658
|
+
def GetOutputColumn(self, __unit: None=None) -> CompositeColumn:
|
|
659
|
+
this: ArcTable = self
|
|
660
|
+
match_value: CompositeColumn | None = this.TryGetOutputColumn()
|
|
661
|
+
if match_value is None:
|
|
662
|
+
arg: str = this.Name
|
|
663
|
+
return to_fail(printf("Unable to find output column in table %s"))(arg)
|
|
664
|
+
|
|
665
|
+
else:
|
|
666
|
+
return match_value
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
@staticmethod
|
|
670
|
+
def get_output_column(__unit: None=None) -> Callable[[ArcTable], CompositeColumn]:
|
|
671
|
+
def _arrow735(table: ArcTable) -> CompositeColumn:
|
|
672
|
+
return table.GetOutputColumn()
|
|
673
|
+
|
|
674
|
+
return _arrow735
|
|
675
|
+
|
|
676
|
+
def MoveColumn(self, start_col: int, end_col: int) -> None:
|
|
677
|
+
this: ArcTable = self
|
|
678
|
+
if start_col == end_col:
|
|
679
|
+
pass
|
|
680
|
+
|
|
681
|
+
elif True if (start_col < 0) else (start_col >= this.ColumnCount):
|
|
682
|
+
to_fail(printf("Cannt move column. Invalid start column index: %i"))(start_col)
|
|
683
|
+
|
|
684
|
+
elif True if (end_col < 0) else (end_col >= this.ColumnCount):
|
|
685
|
+
to_fail(printf("Cannt move column. Invalid end column index: %i"))(end_col)
|
|
686
|
+
|
|
687
|
+
else:
|
|
688
|
+
Unchecked_moveColumnTo(this.RowCount, start_col, end_col, this.Headers, this.Values)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
@staticmethod
|
|
692
|
+
def move_column(start_col: int, end_col: int) -> Callable[[ArcTable], ArcTable]:
|
|
693
|
+
def _arrow736(table: ArcTable) -> ArcTable:
|
|
694
|
+
new_table: ArcTable = table.Copy()
|
|
695
|
+
new_table.MoveColumn(start_col, end_col)
|
|
696
|
+
return new_table
|
|
697
|
+
|
|
698
|
+
return _arrow736
|
|
699
|
+
|
|
700
|
+
def AddRow(self, cells: Array[CompositeCell] | None=None, index: int | None=None) -> None:
|
|
701
|
+
this: ArcTable = self
|
|
702
|
+
index_1: int = default_arg(index, this.RowCount) or 0
|
|
703
|
+
def _arrow738(__unit: None=None) -> IEnumerable_1[CompositeCell]:
|
|
704
|
+
def _arrow737(column_index: int) -> IEnumerable_1[CompositeCell]:
|
|
705
|
+
return singleton(Unchecked_getEmptyCellForHeader(this.Headers[column_index], Unchecked_tryGetCellAt(column_index, 0, this.Values)))
|
|
706
|
+
|
|
707
|
+
return collect(_arrow737, range_big_int(0, 1, this.ColumnCount - 1))
|
|
708
|
+
|
|
709
|
+
cells_1: Array[CompositeCell] = to_array(delay(_arrow738)) if (cells is None) else value_3(cells)
|
|
710
|
+
SanityChecks_validateRowIndex(index_1, this.RowCount, True)
|
|
711
|
+
column_count: int = this.ColumnCount or 0
|
|
712
|
+
new_cells_count: int = length(cells_1) or 0
|
|
713
|
+
if column_count == 0:
|
|
714
|
+
raise Exception("Table contains no columns! Cannot add row to empty table!")
|
|
715
|
+
|
|
716
|
+
elif new_cells_count != column_count:
|
|
717
|
+
raise Exception(((("Cannot add a new row with " + str(new_cells_count)) + " cells, as the table has ") + str(column_count)) + " columns.")
|
|
718
|
+
|
|
719
|
+
for column_index_1 in range(0, (this.ColumnCount - 1) + 1, 1):
|
|
720
|
+
h_1: CompositeHeader = this.Headers[column_index_1]
|
|
721
|
+
SanityChecks_validateColumn(CompositeColumn.create(h_1, [cells_1[column_index_1]]))
|
|
722
|
+
Unchecked_addRow(index_1, cells_1, this.Headers, this.Values)
|
|
723
|
+
|
|
724
|
+
@staticmethod
|
|
725
|
+
def add_row(cells: Array[CompositeCell] | None=None, index: int | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
726
|
+
def _arrow739(table: ArcTable) -> ArcTable:
|
|
727
|
+
new_table: ArcTable = table.Copy()
|
|
728
|
+
new_table.AddRow(cells, index)
|
|
729
|
+
return new_table
|
|
730
|
+
|
|
731
|
+
return _arrow739
|
|
732
|
+
|
|
733
|
+
def UpdateRow(self, row_index: int, cells: Array[CompositeCell]) -> None:
|
|
734
|
+
this: ArcTable = self
|
|
735
|
+
SanityChecks_validateRowIndex(row_index, this.RowCount, False)
|
|
736
|
+
column_count: int = this.RowCount or 0
|
|
737
|
+
new_cells_count: int = length(cells) or 0
|
|
738
|
+
if column_count == 0:
|
|
739
|
+
raise Exception("Table contains no columns! Cannot add row to empty table!")
|
|
740
|
+
|
|
741
|
+
elif new_cells_count != column_count:
|
|
742
|
+
raise Exception(((("Cannot add a new row with " + str(new_cells_count)) + " cells, as the table has ") + str(column_count)) + " columns.")
|
|
743
|
+
|
|
744
|
+
def action(i: int, cell: CompositeCell) -> None:
|
|
745
|
+
h: CompositeHeader = this.Headers[i]
|
|
746
|
+
SanityChecks_validateColumn(CompositeColumn.create(h, [cell]))
|
|
747
|
+
|
|
748
|
+
iterate_indexed(action, cells)
|
|
749
|
+
def action_1(column_index: int, cell_1: CompositeCell) -> None:
|
|
750
|
+
Unchecked_setCellAt(column_index, row_index, cell_1, this.Values)
|
|
751
|
+
|
|
752
|
+
iterate_indexed(action_1, cells)
|
|
753
|
+
|
|
754
|
+
@staticmethod
|
|
755
|
+
def update_row(row_index: int, cells: Array[CompositeCell]) -> Callable[[ArcTable], ArcTable]:
|
|
756
|
+
def _arrow740(table: ArcTable) -> ArcTable:
|
|
757
|
+
new_table: ArcTable = table.Copy()
|
|
758
|
+
new_table.UpdateRow(row_index, cells)
|
|
759
|
+
return new_table
|
|
760
|
+
|
|
761
|
+
return _arrow740
|
|
762
|
+
|
|
763
|
+
def AppendRow(self, cells: Array[CompositeCell] | None=None) -> None:
|
|
764
|
+
this: ArcTable = self
|
|
765
|
+
this.AddRow(cells, this.RowCount)
|
|
766
|
+
|
|
767
|
+
@staticmethod
|
|
768
|
+
def append_row(cells: Array[CompositeCell] | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
769
|
+
def _arrow741(table: ArcTable) -> ArcTable:
|
|
770
|
+
new_table: ArcTable = table.Copy()
|
|
771
|
+
new_table.AppendRow(cells)
|
|
772
|
+
return new_table
|
|
773
|
+
|
|
774
|
+
return _arrow741
|
|
775
|
+
|
|
776
|
+
def InsertRow(self, index: int, cells: Array[CompositeCell] | None=None) -> None:
|
|
777
|
+
this: ArcTable = self
|
|
778
|
+
this.AddRow(cells, index)
|
|
779
|
+
|
|
780
|
+
@staticmethod
|
|
781
|
+
def insert_row(index: int, cells: Array[CompositeCell] | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
782
|
+
def _arrow742(table: ArcTable) -> ArcTable:
|
|
783
|
+
new_table: ArcTable = table.Copy()
|
|
784
|
+
new_table.AddRow(cells, index)
|
|
785
|
+
return new_table
|
|
786
|
+
|
|
787
|
+
return _arrow742
|
|
788
|
+
|
|
789
|
+
def AddRows(self, rows: Array[Array[CompositeCell]], index: int | None=None) -> None:
|
|
790
|
+
this: ArcTable = self
|
|
791
|
+
index_1: int = default_arg(index, this.RowCount) or 0
|
|
792
|
+
SanityChecks_validateRowIndex(index_1, this.RowCount, True)
|
|
793
|
+
def action(row: Array[CompositeCell]) -> None:
|
|
794
|
+
column_count: int = this.ColumnCount or 0
|
|
795
|
+
new_cells_count: int = length(row) or 0
|
|
796
|
+
if column_count == 0:
|
|
797
|
+
raise Exception("Table contains no columns! Cannot add row to empty table!")
|
|
798
|
+
|
|
799
|
+
elif new_cells_count != column_count:
|
|
800
|
+
raise Exception(((("Cannot add a new row with " + str(new_cells_count)) + " cells, as the table has ") + str(column_count)) + " columns.")
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
iterate_2(action, rows)
|
|
804
|
+
for idx in range(0, (len(rows) - 1) + 1, 1):
|
|
805
|
+
row_1: Array[CompositeCell] = rows[idx]
|
|
806
|
+
for column_index in range(0, (this.ColumnCount - 1) + 1, 1):
|
|
807
|
+
h: CompositeHeader = this.Headers[column_index]
|
|
808
|
+
SanityChecks_validateColumn(CompositeColumn.create(h, [row_1[column_index]]))
|
|
809
|
+
Unchecked_addRows(index_1, rows, this.Headers, this.Values)
|
|
810
|
+
|
|
811
|
+
@staticmethod
|
|
812
|
+
def add_rows(rows: Array[Array[CompositeCell]], index: int | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
813
|
+
def _arrow743(table: ArcTable) -> ArcTable:
|
|
814
|
+
new_table: ArcTable = table.Copy()
|
|
815
|
+
new_table.AddRows(rows, index)
|
|
816
|
+
return new_table
|
|
817
|
+
|
|
818
|
+
return _arrow743
|
|
819
|
+
|
|
820
|
+
def AddRowsEmpty(self, row_count: int, index: int | None=None) -> None:
|
|
821
|
+
this: ArcTable = self
|
|
822
|
+
def _arrow745(__unit: None=None) -> IEnumerable_1[CompositeCell]:
|
|
823
|
+
def _arrow744(column_index: int) -> IEnumerable_1[CompositeCell]:
|
|
824
|
+
return singleton(Unchecked_getEmptyCellForHeader(this.Headers[column_index], Unchecked_tryGetCellAt(column_index, 0, this.Values)))
|
|
825
|
+
|
|
826
|
+
return collect(_arrow744, range_big_int(0, 1, this.ColumnCount - 1))
|
|
827
|
+
|
|
828
|
+
row: Array[CompositeCell] = to_array(delay(_arrow745))
|
|
829
|
+
def _arrow746(_arg: int) -> Array[CompositeCell]:
|
|
830
|
+
return row
|
|
831
|
+
|
|
832
|
+
rows: Array[Array[CompositeCell]] = initialize(row_count, _arrow746, None)
|
|
833
|
+
this.AddRows(rows, index)
|
|
834
|
+
|
|
835
|
+
@staticmethod
|
|
836
|
+
def add_rows_empty(row_count: int, index: int | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
837
|
+
def _arrow747(table: ArcTable) -> ArcTable:
|
|
838
|
+
new_table: ArcTable = table.Copy()
|
|
839
|
+
new_table.AddRowsEmpty(row_count, index)
|
|
840
|
+
return new_table
|
|
841
|
+
|
|
842
|
+
return _arrow747
|
|
843
|
+
|
|
844
|
+
def RemoveRow(self, index: int) -> None:
|
|
845
|
+
this: ArcTable = self
|
|
846
|
+
SanityChecks_validateRowIndex(index, this.RowCount, False)
|
|
847
|
+
Unchecked_removeRowCells_withIndexChange(index, this.ColumnCount, this.RowCount, this.Values)
|
|
848
|
+
|
|
849
|
+
@staticmethod
|
|
850
|
+
def remove_row(index: int) -> Callable[[ArcTable], ArcTable]:
|
|
851
|
+
def _arrow748(table: ArcTable) -> ArcTable:
|
|
852
|
+
new_table: ArcTable = table.Copy()
|
|
853
|
+
new_table.RemoveRow(index)
|
|
854
|
+
return new_table
|
|
855
|
+
|
|
856
|
+
return _arrow748
|
|
857
|
+
|
|
858
|
+
def RemoveRows(self, index_arr: Array[int]) -> None:
|
|
859
|
+
this: ArcTable = self
|
|
860
|
+
def _arrow749(index: int) -> None:
|
|
861
|
+
SanityChecks_validateRowIndex(index, this.RowCount, False)
|
|
862
|
+
|
|
863
|
+
iterate_2(_arrow749, index_arr)
|
|
864
|
+
def _arrow750(index_1: int) -> None:
|
|
865
|
+
this.RemoveRow(index_1)
|
|
866
|
+
|
|
867
|
+
class ObjectExpr751:
|
|
868
|
+
@property
|
|
869
|
+
def Compare(self) -> Callable[[int, int], int]:
|
|
870
|
+
return compare_primitives
|
|
871
|
+
|
|
872
|
+
iterate_2(_arrow750, sort_descending(index_arr, ObjectExpr751()))
|
|
873
|
+
|
|
874
|
+
@staticmethod
|
|
875
|
+
def remove_rows(index_arr: Array[int]) -> Callable[[ArcTable], ArcTable]:
|
|
876
|
+
def _arrow752(table: ArcTable) -> ArcTable:
|
|
877
|
+
new_table: ArcTable = table.Copy()
|
|
878
|
+
new_table.RemoveColumns(index_arr)
|
|
879
|
+
return new_table
|
|
880
|
+
|
|
881
|
+
return _arrow752
|
|
882
|
+
|
|
883
|
+
def GetRow(self, row_index: int, SkipValidation: bool | None=None) -> Array[CompositeCell]:
|
|
884
|
+
this: ArcTable = self
|
|
885
|
+
if not equals(SkipValidation, True):
|
|
886
|
+
SanityChecks_validateRowIndex(row_index, this.RowCount, False)
|
|
887
|
+
|
|
888
|
+
def _arrow754(__unit: None=None) -> IEnumerable_1[CompositeCell]:
|
|
889
|
+
def _arrow753(column_index: int) -> CompositeCell:
|
|
890
|
+
return value_3(this.TryGetCellAt(column_index, row_index))
|
|
891
|
+
|
|
892
|
+
return map(_arrow753, range_big_int(0, 1, this.ColumnCount - 1))
|
|
893
|
+
|
|
894
|
+
return to_array(delay(_arrow754))
|
|
895
|
+
|
|
896
|
+
@staticmethod
|
|
897
|
+
def get_row(index: int) -> Callable[[ArcTable], Array[CompositeCell]]:
|
|
898
|
+
def _arrow755(table: ArcTable) -> Array[CompositeCell]:
|
|
899
|
+
return table.GetRow(index)
|
|
900
|
+
|
|
901
|
+
return _arrow755
|
|
902
|
+
|
|
903
|
+
def Join(self, table: ArcTable, index: int | None=None, join_options: str | None=None, force_replace: bool | None=None, skip_fill_missing: bool | None=None) -> None:
|
|
904
|
+
this: ArcTable = self
|
|
905
|
+
join_options_1: str = default_arg(join_options, "headers")
|
|
906
|
+
force_replace_1: bool = default_arg(force_replace, False)
|
|
907
|
+
skip_fill_missing_1: bool = default_arg(skip_fill_missing, False)
|
|
908
|
+
index_1: int = default_arg(index, this.ColumnCount) or 0
|
|
909
|
+
index_1 = (this.ColumnCount if (index_1 == -1) else index_1) or 0
|
|
910
|
+
SanityChecks_validateColumnIndex(index_1, this.ColumnCount, True)
|
|
911
|
+
only_headers: bool = join_options_1 == "headers"
|
|
912
|
+
columns: Array[CompositeColumn]
|
|
913
|
+
pre: Array[CompositeColumn] = table.Columns
|
|
914
|
+
def mapping_2(c_1: CompositeColumn) -> CompositeColumn:
|
|
915
|
+
units_opt: Array[OntologyAnnotation] | None = c_1.TryGetColumnUnits()
|
|
916
|
+
if units_opt is None:
|
|
917
|
+
return CompositeColumn(c_1.Header, [])
|
|
918
|
+
|
|
919
|
+
else:
|
|
920
|
+
def mapping_1(u: OntologyAnnotation, c_1: Any=c_1) -> CompositeCell:
|
|
921
|
+
return CompositeCell.create_unitized("", u)
|
|
922
|
+
|
|
923
|
+
return CompositeColumn(c_1.Header, map_1(mapping_1, units_opt, None))
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
def mapping(c: CompositeColumn) -> CompositeColumn:
|
|
927
|
+
return CompositeColumn(c.Header, [])
|
|
928
|
+
|
|
929
|
+
columns = map_1(mapping_2, pre, None) if (join_options_1 == "withUnit") else (pre if (join_options_1 == "withValues") else map_1(mapping, pre, None))
|
|
930
|
+
def mapping_3(x: CompositeColumn) -> CompositeHeader:
|
|
931
|
+
return x.Header
|
|
932
|
+
|
|
933
|
+
duplicates: FSharpList[dict[str, Any]] = try_find_duplicate_unique_in_array(map(mapping_3, columns))
|
|
934
|
+
if not is_empty(duplicates):
|
|
935
|
+
sb: Any = StringBuilder__ctor()
|
|
936
|
+
ignore(StringBuilder__AppendLine_Z721C83C5(sb, "Found duplicate unique columns in `columns`."))
|
|
937
|
+
def action(x_1: dict[str, Any]) -> None:
|
|
938
|
+
ignore(StringBuilder__AppendLine_Z721C83C5(sb, ((((("Duplicate `" + str(x_1["HeaderType"])) + "` at index ") + str(x_1["Index1"])) + " and ") + str(x_1["Index2"])) + "."))
|
|
939
|
+
|
|
940
|
+
iterate_1(action, duplicates)
|
|
941
|
+
raise Exception(to_string(sb))
|
|
942
|
+
|
|
943
|
+
def action_1(x_2: CompositeColumn) -> None:
|
|
944
|
+
SanityChecks_validateColumn(x_2)
|
|
945
|
+
|
|
946
|
+
iterate_2(action_1, columns)
|
|
947
|
+
def action_2(col: CompositeColumn) -> None:
|
|
948
|
+
nonlocal index_1
|
|
949
|
+
prev_headers_count: int = len(this.Headers) or 0
|
|
950
|
+
Unchecked_addColumn(col.Header, col.Cells, index_1, force_replace_1, only_headers, this.Headers, this.Values)
|
|
951
|
+
if len(this.Headers) > prev_headers_count:
|
|
952
|
+
index_1 = (index_1 + 1) or 0
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
iterate_2(action_2, columns)
|
|
956
|
+
if not skip_fill_missing_1:
|
|
957
|
+
Unchecked_fillMissingCells(this.Headers, this.Values)
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
@staticmethod
|
|
961
|
+
def join(table: ArcTable, index: int | None=None, join_options: str | None=None, force_replace: bool | None=None) -> Callable[[ArcTable], ArcTable]:
|
|
962
|
+
def _arrow756(this: ArcTable) -> ArcTable:
|
|
963
|
+
copy: ArcTable = this.Copy()
|
|
964
|
+
copy.Join(table, index, join_options, force_replace)
|
|
965
|
+
return copy
|
|
966
|
+
|
|
967
|
+
return _arrow756
|
|
968
|
+
|
|
969
|
+
def AddProtocolTypeColumn(self, types: Array[OntologyAnnotation] | None=None, index: int | None=None) -> None:
|
|
970
|
+
this: ArcTable = self
|
|
971
|
+
def mapping_1(array: Array[OntologyAnnotation]) -> Array[CompositeCell]:
|
|
972
|
+
def mapping(Item: OntologyAnnotation, array: Any=array) -> CompositeCell:
|
|
973
|
+
return CompositeCell(0, Item)
|
|
974
|
+
|
|
975
|
+
return map_1(mapping, array, None)
|
|
976
|
+
|
|
977
|
+
cells: Array[CompositeCell] | None = map_2(mapping_1, types)
|
|
978
|
+
this.AddColumn(CompositeHeader(4), cells, index)
|
|
979
|
+
|
|
980
|
+
def AddProtocolVersionColumn(self, versions: Array[str] | None=None, index: int | None=None) -> None:
|
|
981
|
+
this: ArcTable = self
|
|
982
|
+
def mapping_1(array: Array[str]) -> Array[CompositeCell]:
|
|
983
|
+
def mapping(Item: str, array: Any=array) -> CompositeCell:
|
|
984
|
+
return CompositeCell(1, Item)
|
|
985
|
+
|
|
986
|
+
return map_1(mapping, array, None)
|
|
987
|
+
|
|
988
|
+
cells: Array[CompositeCell] | None = map_2(mapping_1, versions)
|
|
989
|
+
this.AddColumn(CompositeHeader(7), cells, index)
|
|
990
|
+
|
|
991
|
+
def AddProtocolUriColumn(self, uris: Array[str] | None=None, index: int | None=None) -> None:
|
|
992
|
+
this: ArcTable = self
|
|
993
|
+
def mapping_1(array: Array[str]) -> Array[CompositeCell]:
|
|
994
|
+
def mapping(Item: str, array: Any=array) -> CompositeCell:
|
|
995
|
+
return CompositeCell(1, Item)
|
|
996
|
+
|
|
997
|
+
return map_1(mapping, array, None)
|
|
998
|
+
|
|
999
|
+
cells: Array[CompositeCell] | None = map_2(mapping_1, uris)
|
|
1000
|
+
this.AddColumn(CompositeHeader(6), cells, index)
|
|
1001
|
+
|
|
1002
|
+
def AddProtocolDescriptionColumn(self, descriptions: Array[str] | None=None, index: int | None=None) -> None:
|
|
1003
|
+
this: ArcTable = self
|
|
1004
|
+
def mapping_1(array: Array[str]) -> Array[CompositeCell]:
|
|
1005
|
+
def mapping(Item: str, array: Any=array) -> CompositeCell:
|
|
1006
|
+
return CompositeCell(1, Item)
|
|
1007
|
+
|
|
1008
|
+
return map_1(mapping, array, None)
|
|
1009
|
+
|
|
1010
|
+
cells: Array[CompositeCell] | None = map_2(mapping_1, descriptions)
|
|
1011
|
+
this.AddColumn(CompositeHeader(5), cells, index)
|
|
1012
|
+
|
|
1013
|
+
def AddProtocolNameColumn(self, names: Array[str] | None=None, index: int | None=None) -> None:
|
|
1014
|
+
this: ArcTable = self
|
|
1015
|
+
def mapping_1(array: Array[str]) -> Array[CompositeCell]:
|
|
1016
|
+
def mapping(Item: str, array: Any=array) -> CompositeCell:
|
|
1017
|
+
return CompositeCell(1, Item)
|
|
1018
|
+
|
|
1019
|
+
return map_1(mapping, array, None)
|
|
1020
|
+
|
|
1021
|
+
cells: Array[CompositeCell] | None = map_2(mapping_1, names)
|
|
1022
|
+
this.AddColumn(CompositeHeader(8), cells, index)
|
|
1023
|
+
|
|
1024
|
+
def GetProtocolTypeColumn(self, __unit: None=None) -> CompositeColumn:
|
|
1025
|
+
this: ArcTable = self
|
|
1026
|
+
return this.GetColumnByHeader(CompositeHeader(4))
|
|
1027
|
+
|
|
1028
|
+
def GetProtocolVersionColumn(self, __unit: None=None) -> CompositeColumn:
|
|
1029
|
+
this: ArcTable = self
|
|
1030
|
+
return this.GetColumnByHeader(CompositeHeader(7))
|
|
1031
|
+
|
|
1032
|
+
def GetProtocolUriColumn(self, __unit: None=None) -> CompositeColumn:
|
|
1033
|
+
this: ArcTable = self
|
|
1034
|
+
return this.GetColumnByHeader(CompositeHeader(6))
|
|
1035
|
+
|
|
1036
|
+
def GetProtocolDescriptionColumn(self, __unit: None=None) -> CompositeColumn:
|
|
1037
|
+
this: ArcTable = self
|
|
1038
|
+
return this.GetColumnByHeader(CompositeHeader(5))
|
|
1039
|
+
|
|
1040
|
+
def GetProtocolNameColumn(self, __unit: None=None) -> CompositeColumn:
|
|
1041
|
+
this: ArcTable = self
|
|
1042
|
+
return this.GetColumnByHeader(CompositeHeader(8))
|
|
1043
|
+
|
|
1044
|
+
def TryGetProtocolNameColumn(self, __unit: None=None) -> CompositeColumn | None:
|
|
1045
|
+
this: ArcTable = self
|
|
1046
|
+
return this.TryGetColumnByHeader(CompositeHeader(8))
|
|
1047
|
+
|
|
1048
|
+
def GetComponentColumns(self, __unit: None=None) -> Array[CompositeColumn]:
|
|
1049
|
+
this: ArcTable = self
|
|
1050
|
+
def mapping(h_1: CompositeHeader) -> CompositeColumn:
|
|
1051
|
+
return this.GetColumnByHeader(h_1)
|
|
1052
|
+
|
|
1053
|
+
def predicate(h: CompositeHeader) -> bool:
|
|
1054
|
+
return h.is_component
|
|
1055
|
+
|
|
1056
|
+
return map_1(mapping, to_array(filter(predicate, this.Headers)), None)
|
|
1057
|
+
|
|
1058
|
+
@staticmethod
|
|
1059
|
+
def SplitByColumnValues(column_index: int) -> Callable[[ArcTable], Array[ArcTable]]:
|
|
1060
|
+
def _arrow758(table: ArcTable) -> Array[ArcTable]:
|
|
1061
|
+
def mapping_3(i: int, index_group: Array[int]) -> ArcTable:
|
|
1062
|
+
headers: Array[CompositeHeader] = list(table.Headers)
|
|
1063
|
+
def mapping_2(i_1: int, i: Any=i, index_group: Any=index_group) -> Array[CompositeCell]:
|
|
1064
|
+
return table.GetRow(i_1, True)
|
|
1065
|
+
|
|
1066
|
+
rows: Array[Array[CompositeCell]] = map_1(mapping_2, index_group, None)
|
|
1067
|
+
return ArcTable.create_from_rows(table.Name, headers, rows)
|
|
1068
|
+
|
|
1069
|
+
def mapping_1(tupled_arg: tuple[CompositeCell, Array[tuple[int, CompositeCell]]]) -> Array[int]:
|
|
1070
|
+
def mapping(tuple_1: tuple[int, CompositeCell], tupled_arg: Any=tupled_arg) -> int:
|
|
1071
|
+
return tuple_1[0]
|
|
1072
|
+
|
|
1073
|
+
return map_1(mapping, tupled_arg[1], Int32Array)
|
|
1074
|
+
|
|
1075
|
+
def projection(tuple: tuple[int, CompositeCell]) -> CompositeCell:
|
|
1076
|
+
return tuple[1]
|
|
1077
|
+
|
|
1078
|
+
class ObjectExpr757:
|
|
1079
|
+
@property
|
|
1080
|
+
def Equals(self) -> Callable[[CompositeCell, CompositeCell], bool]:
|
|
1081
|
+
return equals
|
|
1082
|
+
|
|
1083
|
+
@property
|
|
1084
|
+
def GetHashCode(self) -> Callable[[CompositeCell], int]:
|
|
1085
|
+
return safe_hash
|
|
1086
|
+
|
|
1087
|
+
return map_indexed(mapping_3, map_1(mapping_1, Array_groupBy(projection, indexed(table.GetColumn(column_index).Cells), ObjectExpr757()), None), None)
|
|
1088
|
+
|
|
1089
|
+
return _arrow758
|
|
1090
|
+
|
|
1091
|
+
@staticmethod
|
|
1092
|
+
def SplitByColumnValuesByHeader(header: CompositeHeader) -> Callable[[ArcTable], Array[ArcTable]]:
|
|
1093
|
+
def _arrow759(table: ArcTable) -> Array[ArcTable]:
|
|
1094
|
+
def predicate(x: CompositeHeader) -> bool:
|
|
1095
|
+
return equals(x, header)
|
|
1096
|
+
|
|
1097
|
+
index: int | None = try_find_index(predicate, table.Headers)
|
|
1098
|
+
if index is None:
|
|
1099
|
+
return [table.Copy()]
|
|
1100
|
+
|
|
1101
|
+
else:
|
|
1102
|
+
i: int = index or 0
|
|
1103
|
+
return ArcTable.SplitByColumnValues(i)(table)
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
return _arrow759
|
|
1107
|
+
|
|
1108
|
+
@staticmethod
|
|
1109
|
+
def SplitByProtocolREF() -> Callable[[ArcTable], Array[ArcTable]]:
|
|
1110
|
+
def _arrow760(table: ArcTable) -> Array[ArcTable]:
|
|
1111
|
+
return ArcTable.SplitByColumnValuesByHeader(CompositeHeader(8))(table)
|
|
1112
|
+
|
|
1113
|
+
return _arrow760
|
|
1114
|
+
|
|
1115
|
+
@staticmethod
|
|
1116
|
+
def update_reference_by_annotation_table(ref_table: ArcTable, annotation_table: ArcTable) -> ArcTable:
|
|
1117
|
+
ref_table_1: ArcTable = ref_table.Copy()
|
|
1118
|
+
annotation_table_1: ArcTable = annotation_table.Copy()
|
|
1119
|
+
def chooser(tupled_arg: tuple[int, CompositeHeader]) -> int | None:
|
|
1120
|
+
if tupled_arg[1].is_protocol_column:
|
|
1121
|
+
return None
|
|
1122
|
+
|
|
1123
|
+
else:
|
|
1124
|
+
return tupled_arg[0]
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
non_protocol_columns: Array[int] = to_array(choose(chooser, indexed_1(ref_table_1.Headers)))
|
|
1128
|
+
ref_table_1.RemoveColumns(non_protocol_columns)
|
|
1129
|
+
Unchecked_extendToRowCount(annotation_table_1.RowCount, ref_table_1.Headers, ref_table_1.Values)
|
|
1130
|
+
arr: Array[CompositeColumn] = annotation_table_1.Columns
|
|
1131
|
+
for idx in range(0, (len(arr) - 1) + 1, 1):
|
|
1132
|
+
c: CompositeColumn = arr[idx]
|
|
1133
|
+
ref_table_1.AddColumn(c.Header, c.Cells, None, True)
|
|
1134
|
+
return ref_table_1
|
|
1135
|
+
|
|
1136
|
+
@staticmethod
|
|
1137
|
+
def append(table1: ArcTable, table2: ArcTable) -> ArcTable:
|
|
1138
|
+
def get_list(t: ArcTable) -> FSharpList[FSharpList[tuple[CompositeHeader, CompositeCell]]]:
|
|
1139
|
+
def _arrow764(__unit: None=None, t: Any=t) -> IEnumerable_1[FSharpList[tuple[CompositeHeader, CompositeCell]]]:
|
|
1140
|
+
def _arrow763(row: int) -> FSharpList[tuple[CompositeHeader, CompositeCell]]:
|
|
1141
|
+
def _arrow762(__unit: None=None) -> IEnumerable_1[tuple[CompositeHeader, CompositeCell]]:
|
|
1142
|
+
def _arrow761(col: int) -> tuple[CompositeHeader, CompositeCell]:
|
|
1143
|
+
return (t.Headers[col], get_item_from_dict(t.Values, (col, row)))
|
|
1144
|
+
|
|
1145
|
+
return map(_arrow761, range_big_int(0, 1, t.ColumnCount - 1))
|
|
1146
|
+
|
|
1147
|
+
return to_list(delay(_arrow762))
|
|
1148
|
+
|
|
1149
|
+
return map(_arrow763, range_big_int(0, 1, t.RowCount - 1))
|
|
1150
|
+
|
|
1151
|
+
return to_list(delay(_arrow764))
|
|
1152
|
+
|
|
1153
|
+
pattern_input: tuple[Array[CompositeHeader], Any] = Unchecked_alignByHeaders(False, append(get_list(table1), get_list(table2)))
|
|
1154
|
+
return ArcTable.create(table1.Name, pattern_input[0], pattern_input[1])
|
|
1155
|
+
|
|
1156
|
+
def __str__(self, __unit: None=None) -> str:
|
|
1157
|
+
this: ArcTable = self
|
|
1158
|
+
row_count: int = this.RowCount or 0
|
|
1159
|
+
def _arrow773(__unit: None=None) -> IEnumerable_1[str]:
|
|
1160
|
+
def _arrow772(__unit: None=None) -> IEnumerable_1[str]:
|
|
1161
|
+
def _arrow771(__unit: None=None) -> IEnumerable_1[str]:
|
|
1162
|
+
def _arrow770(__unit: None=None) -> IEnumerable_1[str]:
|
|
1163
|
+
def _arrow765(row_i: int) -> str:
|
|
1164
|
+
return join("\t|\t", map(to_string, this.GetRow(row_i)))
|
|
1165
|
+
|
|
1166
|
+
def _arrow768(__unit: None=None) -> IEnumerable_1[str]:
|
|
1167
|
+
def _arrow767(__unit: None=None) -> IEnumerable_1[str]:
|
|
1168
|
+
def _arrow766(row_i_1: int) -> str:
|
|
1169
|
+
return join("\t|\t", map(to_string, this.GetRow(row_i_1)))
|
|
1170
|
+
|
|
1171
|
+
return map(_arrow766, range_big_int(row_count - 20, 1, row_count - 1))
|
|
1172
|
+
|
|
1173
|
+
return append_1(singleton("..."), delay(_arrow767))
|
|
1174
|
+
|
|
1175
|
+
def _arrow769(row_i_2: int) -> str:
|
|
1176
|
+
return join("\t|\t", map(to_string, this.GetRow(row_i_2)))
|
|
1177
|
+
|
|
1178
|
+
return append_1(map(_arrow765, range_big_int(0, 1, 19)), delay(_arrow768)) if (row_count > 50) else (singleton("No rows") if (row_count == 0) else map(_arrow769, range_big_int(0, 1, row_count - 1)))
|
|
1179
|
+
|
|
1180
|
+
return append_1(singleton(join("\t|\t", map(to_string, this.Headers))), delay(_arrow770))
|
|
1181
|
+
|
|
1182
|
+
return append_1(singleton("-------------"), delay(_arrow771))
|
|
1183
|
+
|
|
1184
|
+
return append_1(singleton(("Table: " + this.Name) + ""), delay(_arrow772))
|
|
1185
|
+
|
|
1186
|
+
return join("\n", to_list(delay(_arrow773)))
|
|
1187
|
+
|
|
1188
|
+
def StructurallyEquals(self, other: ArcTable) -> bool:
|
|
1189
|
+
this: ArcTable = self
|
|
1190
|
+
def sort(arg: Any) -> Array[Any]:
|
|
1191
|
+
def projection(_arg: Any, arg: Any=arg) -> tuple[int, int]:
|
|
1192
|
+
return _arg[0]
|
|
1193
|
+
|
|
1194
|
+
class ObjectExpr774:
|
|
1195
|
+
@property
|
|
1196
|
+
def Compare(self) -> Callable[[tuple[int, int], tuple[int, int]], int]:
|
|
1197
|
+
return compare_arrays
|
|
1198
|
+
|
|
1199
|
+
return sort_by(projection, list(arg), ObjectExpr774())
|
|
1200
|
+
|
|
1201
|
+
def _arrow777(__unit: None=None) -> bool:
|
|
1202
|
+
a: IEnumerable_1[CompositeHeader] = this.Headers
|
|
1203
|
+
b: IEnumerable_1[CompositeHeader] = other.Headers
|
|
1204
|
+
def folder(acc: bool, e: bool) -> bool:
|
|
1205
|
+
if acc:
|
|
1206
|
+
return e
|
|
1207
|
+
|
|
1208
|
+
else:
|
|
1209
|
+
return False
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
def _arrow776(__unit: None=None) -> IEnumerable_1[bool]:
|
|
1213
|
+
def _arrow775(i: int) -> bool:
|
|
1214
|
+
return equals(item(i, a), item(i, b))
|
|
1215
|
+
|
|
1216
|
+
return map(_arrow775, range_big_int(0, 1, length(a) - 1))
|
|
1217
|
+
|
|
1218
|
+
return fold(folder, True, to_list(delay(_arrow776))) if (length(a) == length(b)) else False
|
|
1219
|
+
|
|
1220
|
+
if _arrow777() if (this.Name == other.Name) else False:
|
|
1221
|
+
a_1: IEnumerable_1[Any] = sort(this.Values)
|
|
1222
|
+
b_1: IEnumerable_1[Any] = sort(other.Values)
|
|
1223
|
+
def folder_1(acc_1: bool, e_1: bool) -> bool:
|
|
1224
|
+
if acc_1:
|
|
1225
|
+
return e_1
|
|
1226
|
+
|
|
1227
|
+
else:
|
|
1228
|
+
return False
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
def _arrow779(__unit: None=None) -> IEnumerable_1[bool]:
|
|
1232
|
+
def _arrow778(i_1: int) -> bool:
|
|
1233
|
+
return equals(item(i_1, a_1), item(i_1, b_1))
|
|
1234
|
+
|
|
1235
|
+
return map(_arrow778, range_big_int(0, 1, length(a_1) - 1))
|
|
1236
|
+
|
|
1237
|
+
return fold(folder_1, True, to_list(delay(_arrow779))) if (length(a_1) == length(b_1)) else False
|
|
1238
|
+
|
|
1239
|
+
else:
|
|
1240
|
+
return False
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
def ReferenceEquals(self, other: ArcTable) -> bool:
|
|
1244
|
+
this: ArcTable = self
|
|
1245
|
+
return this is other
|
|
1246
|
+
|
|
1247
|
+
def __eq__(self, other: Any=None) -> bool:
|
|
1248
|
+
this: ArcTable = self
|
|
1249
|
+
return this.StructurallyEquals(other) if isinstance(other, ArcTable) else False
|
|
1250
|
+
|
|
1251
|
+
def __hash__(self, __unit: None=None) -> Any:
|
|
1252
|
+
this: ArcTable = self
|
|
1253
|
+
v_hash: Any = box_hash_values(this.ColumnCount, this.Values)
|
|
1254
|
+
return box_hash_array([this.Name, box_hash_seq(this.Headers), v_hash])
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
ArcTable_reflection = _expr780
|
|
1258
|
+
|
|
1259
|
+
def ArcTable__ctor_76CAD84E(name: str, headers: Array[CompositeHeader], values: Any) -> ArcTable:
|
|
1260
|
+
return ArcTable(name, headers, values)
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
__all__ = ["ArcTable_reflection"]
|
|
1264
|
+
|