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.
Files changed (511) hide show
  1. arctrl/__init__.py +23 -0
  2. arctrl/cwl.py +12 -0
  3. arctrl/py/CWL/__init__.py +0 -0
  4. arctrl/py/CWL/cwlprocessing_unit.py +221 -0
  5. arctrl/py/CWL/cwltypes.py +364 -0
  6. arctrl/py/CWL/decode.py +3532 -0
  7. arctrl/py/CWL/encode.py +1905 -0
  8. arctrl/py/CWL/expression_tool_description.py +192 -0
  9. arctrl/py/CWL/hash_helpers.py +60 -0
  10. arctrl/py/CWL/inputs.py +122 -0
  11. arctrl/py/CWL/operation_description.py +169 -0
  12. arctrl/py/CWL/outputs.py +171 -0
  13. arctrl/py/CWL/parameter_reference.py +74 -0
  14. arctrl/py/CWL/requirements.py +350 -0
  15. arctrl/py/CWL/tool_description.py +192 -0
  16. arctrl/py/CWL/workflow_description.py +181 -0
  17. arctrl/py/CWL/workflow_steps.py +354 -0
  18. arctrl/py/Contract/__init__.py +0 -0
  19. arctrl/py/Contract/arc.py +89 -0
  20. arctrl/py/Contract/arc_assay.py +125 -0
  21. arctrl/py/Contract/arc_investigation.py +88 -0
  22. arctrl/py/Contract/arc_run.py +291 -0
  23. arctrl/py/Contract/arc_study.py +126 -0
  24. arctrl/py/Contract/arc_workflow.py +213 -0
  25. arctrl/py/Contract/contract.py +153 -0
  26. arctrl/py/Contract/datamap.py +396 -0
  27. arctrl/py/Contract/git.py +116 -0
  28. arctrl/py/Contract/license.py +58 -0
  29. arctrl/py/Contract/validation_packages_config.py +107 -0
  30. arctrl/py/ContractIO/__init__.py +0 -0
  31. arctrl/py/ContractIO/contract_io.py +350 -0
  32. arctrl/py/ContractIO/file_system_helper.py +264 -0
  33. arctrl/py/Conversion/__init__.py +0 -0
  34. arctrl/py/Conversion/assay.py +151 -0
  35. arctrl/py/Conversion/basic.py +559 -0
  36. arctrl/py/Conversion/column_index.py +91 -0
  37. arctrl/py/Conversion/datamap.py +36 -0
  38. arctrl/py/Conversion/date_time.py +32 -0
  39. arctrl/py/Conversion/investigation.py +171 -0
  40. arctrl/py/Conversion/person.py +148 -0
  41. arctrl/py/Conversion/process.py +828 -0
  42. arctrl/py/Conversion/run.py +367 -0
  43. arctrl/py/Conversion/scholarly_article.py +163 -0
  44. arctrl/py/Conversion/study.py +99 -0
  45. arctrl/py/Conversion/table.py +229 -0
  46. arctrl/py/Conversion/workflow.py +680 -0
  47. arctrl/py/Core/Helper/__init__.py +0 -0
  48. arctrl/py/Core/Helper/collections_.py +512 -0
  49. arctrl/py/Core/Helper/date_time.py +26 -0
  50. arctrl/py/Core/Helper/hash_codes.py +60 -0
  51. arctrl/py/Core/Helper/identifier.py +290 -0
  52. arctrl/py/Core/Helper/orcid.py +42 -0
  53. arctrl/py/Core/Helper/printer.py +13 -0
  54. arctrl/py/Core/Helper/regex.py +554 -0
  55. arctrl/py/Core/Helper/sem_ver.py +71 -0
  56. arctrl/py/Core/Helper/url.py +148 -0
  57. arctrl/py/Core/Process/__init__.py +0 -0
  58. arctrl/py/Core/Process/column_index.py +280 -0
  59. arctrl/py/Core/Process/component.py +200 -0
  60. arctrl/py/Core/Process/factor.py +151 -0
  61. arctrl/py/Core/Process/factor_value.py +182 -0
  62. arctrl/py/Core/Process/material.py +74 -0
  63. arctrl/py/Core/Process/material_attribute.py +95 -0
  64. arctrl/py/Core/Process/material_attribute_value.py +184 -0
  65. arctrl/py/Core/Process/material_type.py +45 -0
  66. arctrl/py/Core/Process/process.py +477 -0
  67. arctrl/py/Core/Process/process_input.py +265 -0
  68. arctrl/py/Core/Process/process_output.py +235 -0
  69. arctrl/py/Core/Process/process_parameter_value.py +200 -0
  70. arctrl/py/Core/Process/process_sequence.py +435 -0
  71. arctrl/py/Core/Process/protocol.py +175 -0
  72. arctrl/py/Core/Process/protocol_parameter.py +98 -0
  73. arctrl/py/Core/Process/sample.py +82 -0
  74. arctrl/py/Core/Process/source.py +62 -0
  75. arctrl/py/Core/Table/__init__.py +0 -0
  76. arctrl/py/Core/Table/arc_table.py +1206 -0
  77. arctrl/py/Core/Table/arc_table_aux.py +1308 -0
  78. arctrl/py/Core/Table/arc_tables.py +574 -0
  79. arctrl/py/Core/Table/composite_cell.py +319 -0
  80. arctrl/py/Core/Table/composite_column.py +73 -0
  81. arctrl/py/Core/Table/composite_header.py +739 -0
  82. arctrl/py/Core/__init__.py +0 -0
  83. arctrl/py/Core/arc_types.py +5312 -0
  84. arctrl/py/Core/comment.py +128 -0
  85. arctrl/py/Core/comment_list.py +127 -0
  86. arctrl/py/Core/conversion.py +1375 -0
  87. arctrl/py/Core/data.py +247 -0
  88. arctrl/py/Core/data_context.py +157 -0
  89. arctrl/py/Core/data_file.py +112 -0
  90. arctrl/py/Core/datamap.py +217 -0
  91. arctrl/py/Core/identifier_setters.py +43 -0
  92. arctrl/py/Core/iproperty_value.py +36 -0
  93. arctrl/py/Core/ontology_annotation.py +298 -0
  94. arctrl/py/Core/ontology_source_reference.py +114 -0
  95. arctrl/py/Core/person.py +259 -0
  96. arctrl/py/Core/publication.py +161 -0
  97. arctrl/py/Core/template.py +231 -0
  98. arctrl/py/Core/templates.py +148 -0
  99. arctrl/py/Core/uri.py +11 -0
  100. arctrl/py/Core/value.py +188 -0
  101. arctrl/py/FileSystem/__init__.py +0 -0
  102. arctrl/py/FileSystem/commit.py +21 -0
  103. arctrl/py/FileSystem/default_gitattributes.py +1 -0
  104. arctrl/py/FileSystem/default_gitignore.py +1 -0
  105. arctrl/py/FileSystem/default_license.py +1 -0
  106. arctrl/py/FileSystem/file_system.py +58 -0
  107. arctrl/py/FileSystem/file_system_tree.py +483 -0
  108. arctrl/py/FileSystem/path.py +266 -0
  109. arctrl/py/Json/Datamap/__init__.py +0 -0
  110. arctrl/py/Json/Datamap/data_context.py +101 -0
  111. arctrl/py/Json/Datamap/datamap.py +53 -0
  112. arctrl/py/Json/Process/__init__.py +0 -0
  113. arctrl/py/Json/Process/assay_materials.py +46 -0
  114. arctrl/py/Json/Process/component.py +125 -0
  115. arctrl/py/Json/Process/factor.py +107 -0
  116. arctrl/py/Json/Process/factor_value.py +101 -0
  117. arctrl/py/Json/Process/material.py +226 -0
  118. arctrl/py/Json/Process/material_attribute.py +79 -0
  119. arctrl/py/Json/Process/material_attribute_value.py +101 -0
  120. arctrl/py/Json/Process/material_type.py +53 -0
  121. arctrl/py/Json/Process/process.py +296 -0
  122. arctrl/py/Json/Process/process_input.py +83 -0
  123. arctrl/py/Json/Process/process_output.py +67 -0
  124. arctrl/py/Json/Process/process_parameter_value.py +81 -0
  125. arctrl/py/Json/Process/protocol.py +354 -0
  126. arctrl/py/Json/Process/protocol_parameter.py +91 -0
  127. arctrl/py/Json/Process/sample.py +277 -0
  128. arctrl/py/Json/Process/source.py +214 -0
  129. arctrl/py/Json/Process/study_materials.py +52 -0
  130. arctrl/py/Json/Process/value.py +56 -0
  131. arctrl/py/Json/ROCrate/__init__.py +0 -0
  132. arctrl/py/Json/ROCrate/ldcontext.py +143 -0
  133. arctrl/py/Json/ROCrate/ldgraph.py +117 -0
  134. arctrl/py/Json/ROCrate/ldnode.py +304 -0
  135. arctrl/py/Json/ROCrate/ldref.py +44 -0
  136. arctrl/py/Json/ROCrate/ldvalue.py +102 -0
  137. arctrl/py/Json/Table/__init__.py +0 -0
  138. arctrl/py/Json/Table/arc_table.py +375 -0
  139. arctrl/py/Json/Table/cell_table.py +83 -0
  140. arctrl/py/Json/Table/composite_cell.py +136 -0
  141. arctrl/py/Json/Table/composite_header.py +67 -0
  142. arctrl/py/Json/Table/iotype.py +24 -0
  143. arctrl/py/Json/Table/oatable.py +82 -0
  144. arctrl/py/Json/Table/templates.py +281 -0
  145. arctrl/py/Json/__init__.py +0 -0
  146. arctrl/py/Json/assay.py +600 -0
  147. arctrl/py/Json/comment.py +206 -0
  148. arctrl/py/Json/context/rocrate/__init__.py +0 -0
  149. arctrl/py/Json/context/rocrate/isa_assay_context.py +101 -0
  150. arctrl/py/Json/context/rocrate/isa_comment_context.py +60 -0
  151. arctrl/py/Json/context/rocrate/isa_component_context.py +77 -0
  152. arctrl/py/Json/context/rocrate/isa_data_context.py +74 -0
  153. arctrl/py/Json/context/rocrate/isa_factor_context.py +74 -0
  154. arctrl/py/Json/context/rocrate/isa_factor_value_context.py +84 -0
  155. arctrl/py/Json/context/rocrate/isa_investigation_context.py +110 -0
  156. arctrl/py/Json/context/rocrate/isa_material_attribute_context.py +64 -0
  157. arctrl/py/Json/context/rocrate/isa_material_attribute_value_context.py +80 -0
  158. arctrl/py/Json/context/rocrate/isa_material_context.py +71 -0
  159. arctrl/py/Json/context/rocrate/isa_ontology_annotation_context.py +68 -0
  160. arctrl/py/Json/context/rocrate/isa_ontology_source_reference_context.py +75 -0
  161. arctrl/py/Json/context/rocrate/isa_organization_context.py +55 -0
  162. arctrl/py/Json/context/rocrate/isa_person_context.py +131 -0
  163. arctrl/py/Json/context/rocrate/isa_process_context.py +94 -0
  164. arctrl/py/Json/context/rocrate/isa_process_parameter_value_context.py +80 -0
  165. arctrl/py/Json/context/rocrate/isa_protocol_context.py +97 -0
  166. arctrl/py/Json/context/rocrate/isa_protocol_parameter_context.py +64 -0
  167. arctrl/py/Json/context/rocrate/isa_publication_context.py +78 -0
  168. arctrl/py/Json/context/rocrate/isa_sample_context.py +65 -0
  169. arctrl/py/Json/context/rocrate/isa_source_context.py +66 -0
  170. arctrl/py/Json/context/rocrate/isa_study_context.py +125 -0
  171. arctrl/py/Json/context/rocrate/property_value_context.py +73 -0
  172. arctrl/py/Json/context/rocrate/rocrate_context.py +81 -0
  173. arctrl/py/Json/converter_options.py +23 -0
  174. arctrl/py/Json/data.py +356 -0
  175. arctrl/py/Json/data_file.py +63 -0
  176. arctrl/py/Json/decode.py +271 -0
  177. arctrl/py/Json/encode.py +140 -0
  178. arctrl/py/Json/idtable.py +44 -0
  179. arctrl/py/Json/investigation.py +695 -0
  180. arctrl/py/Json/ontology_annotation.py +404 -0
  181. arctrl/py/Json/ontology_source_reference.py +255 -0
  182. arctrl/py/Json/person.py +658 -0
  183. arctrl/py/Json/property_value.py +359 -0
  184. arctrl/py/Json/publication.py +279 -0
  185. arctrl/py/Json/run.py +275 -0
  186. arctrl/py/Json/string_table.py +87 -0
  187. arctrl/py/Json/study.py +793 -0
  188. arctrl/py/Json/workflow.py +307 -0
  189. arctrl/py/JsonIO/Process/__init__.py +0 -0
  190. arctrl/py/JsonIO/Process/component.py +60 -0
  191. arctrl/py/JsonIO/Process/factor.py +36 -0
  192. arctrl/py/JsonIO/Process/factor_value.py +38 -0
  193. arctrl/py/JsonIO/Process/material.py +60 -0
  194. arctrl/py/JsonIO/Process/material_attribute.py +38 -0
  195. arctrl/py/JsonIO/Process/material_attribute_value.py +60 -0
  196. arctrl/py/JsonIO/Process/material_type.py +36 -0
  197. arctrl/py/JsonIO/Process/process.py +60 -0
  198. arctrl/py/JsonIO/Process/process_input.py +38 -0
  199. arctrl/py/JsonIO/Process/process_output.py +60 -0
  200. arctrl/py/JsonIO/Process/process_parameter_value.py +60 -0
  201. arctrl/py/JsonIO/Process/process_sequence.py +71 -0
  202. arctrl/py/JsonIO/Process/protocol.py +60 -0
  203. arctrl/py/JsonIO/Process/protocol_parameter.py +36 -0
  204. arctrl/py/JsonIO/Process/sample.py +60 -0
  205. arctrl/py/JsonIO/Process/source.py +60 -0
  206. arctrl/py/JsonIO/Process/study_materials.py +52 -0
  207. arctrl/py/JsonIO/Process/value.py +32 -0
  208. arctrl/py/JsonIO/Table/__init__.py +0 -0
  209. arctrl/py/JsonIO/Table/arc_table.py +103 -0
  210. arctrl/py/JsonIO/Table/composite_cell.py +36 -0
  211. arctrl/py/JsonIO/Table/composite_header.py +36 -0
  212. arctrl/py/JsonIO/Table/compression.py +67 -0
  213. arctrl/py/JsonIO/Table/iotype.py +36 -0
  214. arctrl/py/JsonIO/Table/templates.py +113 -0
  215. arctrl/py/JsonIO/__init__.py +0 -0
  216. arctrl/py/JsonIO/assay.py +113 -0
  217. arctrl/py/JsonIO/comment.py +80 -0
  218. arctrl/py/JsonIO/data.py +60 -0
  219. arctrl/py/JsonIO/data_file.py +58 -0
  220. arctrl/py/JsonIO/datamap.py +36 -0
  221. arctrl/py/JsonIO/decode.py +9 -0
  222. arctrl/py/JsonIO/encode.py +1 -0
  223. arctrl/py/JsonIO/investigation.py +91 -0
  224. arctrl/py/JsonIO/ldobject.py +106 -0
  225. arctrl/py/JsonIO/ontology_annotation.py +80 -0
  226. arctrl/py/JsonIO/ontology_source_reference.py +80 -0
  227. arctrl/py/JsonIO/person.py +82 -0
  228. arctrl/py/JsonIO/publication.py +82 -0
  229. arctrl/py/JsonIO/run.py +68 -0
  230. arctrl/py/JsonIO/study.py +114 -0
  231. arctrl/py/JsonIO/workflow.py +68 -0
  232. arctrl/py/ROCrate/ISAProfile/__init__.py +0 -0
  233. arctrl/py/ROCrate/ISAProfile/assay.py +70 -0
  234. arctrl/py/ROCrate/ISAProfile/data.py +65 -0
  235. arctrl/py/ROCrate/ISAProfile/dataset.py +24 -0
  236. arctrl/py/ROCrate/ISAProfile/investigation.py +73 -0
  237. arctrl/py/ROCrate/ISAProfile/lab_process.py +162 -0
  238. arctrl/py/ROCrate/ISAProfile/lab_protocol.py +37 -0
  239. arctrl/py/ROCrate/ISAProfile/person.py +72 -0
  240. arctrl/py/ROCrate/ISAProfile/property_value.py +98 -0
  241. arctrl/py/ROCrate/ISAProfile/sample.py +64 -0
  242. arctrl/py/ROCrate/ISAProfile/scholarly_article.py +98 -0
  243. arctrl/py/ROCrate/ISAProfile/study.py +74 -0
  244. arctrl/py/ROCrate/LDTypes/__init__.py +0 -0
  245. arctrl/py/ROCrate/LDTypes/comment.py +131 -0
  246. arctrl/py/ROCrate/LDTypes/computational_workflow.py +455 -0
  247. arctrl/py/ROCrate/LDTypes/computer_language.py +269 -0
  248. arctrl/py/ROCrate/LDTypes/create_action.py +303 -0
  249. arctrl/py/ROCrate/LDTypes/creative_work.py +566 -0
  250. arctrl/py/ROCrate/LDTypes/dataset.py +943 -0
  251. arctrl/py/ROCrate/LDTypes/defined_term.py +131 -0
  252. arctrl/py/ROCrate/LDTypes/file.py +281 -0
  253. arctrl/py/ROCrate/LDTypes/formal_parameter.py +431 -0
  254. arctrl/py/ROCrate/LDTypes/lab_process.py +352 -0
  255. arctrl/py/ROCrate/LDTypes/lab_protocol.py +395 -0
  256. arctrl/py/ROCrate/LDTypes/organization.py +83 -0
  257. arctrl/py/ROCrate/LDTypes/person.py +484 -0
  258. arctrl/py/ROCrate/LDTypes/postal_address.py +195 -0
  259. arctrl/py/ROCrate/LDTypes/property_value.py +952 -0
  260. arctrl/py/ROCrate/LDTypes/sample.py +202 -0
  261. arctrl/py/ROCrate/LDTypes/scholarly_article.py +229 -0
  262. arctrl/py/ROCrate/LDTypes/software_source_code.py +310 -0
  263. arctrl/py/ROCrate/LDTypes/workflow_invocation.py +48 -0
  264. arctrl/py/ROCrate/LDTypes/workflow_protocol.py +52 -0
  265. arctrl/py/ROCrate/__init__.py +0 -0
  266. arctrl/py/ROCrate/arc_rocrate_metadata.py +39 -0
  267. arctrl/py/ROCrate/dyn_obj_extensions.py +1 -0
  268. arctrl/py/ROCrate/helper.py +8 -0
  269. arctrl/py/ROCrate/ldcontext.py +406 -0
  270. arctrl/py/ROCrate/ldobject.py +1247 -0
  271. arctrl/py/ROCrate/rocrate_context.py +51 -0
  272. arctrl/py/Spreadsheet/AnnotationTable/__init__.py +0 -0
  273. arctrl/py/Spreadsheet/AnnotationTable/arc_table.py +203 -0
  274. arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
  275. arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +305 -0
  276. arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
  277. arctrl/py/Spreadsheet/DatamapTable/__init__.py +0 -0
  278. arctrl/py/Spreadsheet/DatamapTable/datamap_column.py +114 -0
  279. arctrl/py/Spreadsheet/DatamapTable/datamap_header.py +621 -0
  280. arctrl/py/Spreadsheet/DatamapTable/datamap_table.py +118 -0
  281. arctrl/py/Spreadsheet/Metadata/__init__.py +0 -0
  282. arctrl/py/Spreadsheet/Metadata/assays.py +125 -0
  283. arctrl/py/Spreadsheet/Metadata/comment.py +77 -0
  284. arctrl/py/Spreadsheet/Metadata/contacts.py +134 -0
  285. arctrl/py/Spreadsheet/Metadata/conversions.py +190 -0
  286. arctrl/py/Spreadsheet/Metadata/design_descriptors.py +34 -0
  287. arctrl/py/Spreadsheet/Metadata/factors.py +107 -0
  288. arctrl/py/Spreadsheet/Metadata/ontology_annotation.py +88 -0
  289. arctrl/py/Spreadsheet/Metadata/ontology_source_reference.py +96 -0
  290. arctrl/py/Spreadsheet/Metadata/protocols.py +146 -0
  291. arctrl/py/Spreadsheet/Metadata/publication.py +122 -0
  292. arctrl/py/Spreadsheet/Metadata/run.py +122 -0
  293. arctrl/py/Spreadsheet/Metadata/sparse_table.py +499 -0
  294. arctrl/py/Spreadsheet/Metadata/study.py +312 -0
  295. arctrl/py/Spreadsheet/Metadata/workflow.py +159 -0
  296. arctrl/py/Spreadsheet/__init__.py +0 -0
  297. arctrl/py/Spreadsheet/arc_assay.py +233 -0
  298. arctrl/py/Spreadsheet/arc_investigation.py +435 -0
  299. arctrl/py/Spreadsheet/arc_run.py +190 -0
  300. arctrl/py/Spreadsheet/arc_study.py +144 -0
  301. arctrl/py/Spreadsheet/arc_workflow.py +177 -0
  302. arctrl/py/Spreadsheet/assembly_info.py +1 -0
  303. arctrl/py/Spreadsheet/collection_aux.py +167 -0
  304. arctrl/py/Spreadsheet/datamap.py +43 -0
  305. arctrl/py/Spreadsheet/template.py +460 -0
  306. arctrl/py/ValidationPackages/__init__.py +0 -0
  307. arctrl/py/ValidationPackages/validation_package.py +82 -0
  308. arctrl/py/ValidationPackages/validation_packages_config.py +132 -0
  309. arctrl/py/WebRequest/__init__.py +0 -0
  310. arctrl/py/WebRequest/web_request.py +9 -0
  311. arctrl/py/WebRequest/web_request_py.py +135 -0
  312. arctrl/py/WorkflowGraph/__init__.py +0 -0
  313. arctrl/py/WorkflowGraph/adapters.py +141 -0
  314. arctrl/py/WorkflowGraph/build_options.py +45 -0
  315. arctrl/py/WorkflowGraph/builder.py +720 -0
  316. arctrl/py/WorkflowGraph/graph_types.py +260 -0
  317. arctrl/py/WorkflowGraph/query_helpers.py +76 -0
  318. arctrl/py/WorkflowGraph/reference_parsing.py +59 -0
  319. arctrl/py/WorkflowGraph/visualization_siren.py +574 -0
  320. arctrl/py/WorkflowGraph/workflow_graph.py +119 -0
  321. arctrl/py/Yaml/__init__.py +0 -0
  322. arctrl/py/Yaml/decode.py +1 -0
  323. arctrl/py/Yaml/encode.py +10 -0
  324. arctrl/py/Yaml/validation_package.py +77 -0
  325. arctrl/py/Yaml/validation_packages_config.py +86 -0
  326. arctrl/py/__init__.py +0 -0
  327. arctrl/py/arc.py +1891 -0
  328. arctrl/py/column_index.py +280 -0
  329. arctrl/py/conversion.py +142 -0
  330. arctrl/py/cross_async.py +76 -0
  331. arctrl/py/cwlrun_resolver.py +228 -0
  332. arctrl/py/fable_modules/dynamic_obj/__init__.py +0 -0
  333. arctrl/py/fable_modules/dynamic_obj/dyn_obj.py +136 -0
  334. arctrl/py/fable_modules/dynamic_obj/dynamic_obj.py +415 -0
  335. arctrl/py/fable_modules/dynamic_obj/fable_js.py +1 -0
  336. arctrl/py/fable_modules/dynamic_obj/fable_py.py +288 -0
  337. arctrl/py/fable_modules/dynamic_obj/hash_codes.py +82 -0
  338. arctrl/py/fable_modules/dynamic_obj/property_helper.py +25 -0
  339. arctrl/py/fable_modules/dynamic_obj/reflection_utils.py +87 -0
  340. arctrl/py/fable_modules/fable_library/__init__.py +0 -0
  341. arctrl/py/fable_modules/fable_library/array_.py +1528 -0
  342. arctrl/py/fable_modules/fable_library/async_.py +377 -0
  343. arctrl/py/fable_modules/fable_library/async_builder.py +379 -0
  344. arctrl/py/fable_modules/fable_library/big_int.py +330 -0
  345. arctrl/py/fable_modules/fable_library/bit_converter.py +131 -0
  346. arctrl/py/fable_modules/fable_library/boolean.py +26 -0
  347. arctrl/py/fable_modules/fable_library/char.py +237 -0
  348. arctrl/py/fable_modules/fable_library/choice.py +212 -0
  349. arctrl/py/fable_modules/fable_library/date.py +779 -0
  350. arctrl/py/fable_modules/fable_library/date_offset.py +79 -0
  351. arctrl/py/fable_modules/fable_library/decimal_.py +190 -0
  352. arctrl/py/fable_modules/fable_library/diagnostics.py +54 -0
  353. arctrl/py/fable_modules/fable_library/double.py +87 -0
  354. arctrl/py/fable_modules/fable_library/encoding.py +41 -0
  355. arctrl/py/fable_modules/fable_library/event.py +206 -0
  356. arctrl/py/fable_modules/fable_library/file.py +107 -0
  357. arctrl/py/fable_modules/fable_library/fsharp_collections.py +52 -0
  358. arctrl/py/fable_modules/fable_library/fsharp_core.py +123 -0
  359. arctrl/py/fable_modules/fable_library/global_.py +63 -0
  360. arctrl/py/fable_modules/fable_library/guid.py +41 -0
  361. arctrl/py/fable_modules/fable_library/int32.py +73 -0
  362. arctrl/py/fable_modules/fable_library/list.py +1788 -0
  363. arctrl/py/fable_modules/fable_library/long.py +240 -0
  364. arctrl/py/fable_modules/fable_library/mailbox_processor.py +179 -0
  365. arctrl/py/fable_modules/fable_library/map.py +1854 -0
  366. arctrl/py/fable_modules/fable_library/map_util.py +148 -0
  367. arctrl/py/fable_modules/fable_library/mutable_map.py +397 -0
  368. arctrl/py/fable_modules/fable_library/mutable_set.py +279 -0
  369. arctrl/py/fable_modules/fable_library/native.py +45 -0
  370. arctrl/py/fable_modules/fable_library/numeric.py +46 -0
  371. arctrl/py/fable_modules/fable_library/observable.py +222 -0
  372. arctrl/py/fable_modules/fable_library/option.py +128 -0
  373. arctrl/py/fable_modules/fable_library/path.py +62 -0
  374. arctrl/py/fable_modules/fable_library/range.py +117 -0
  375. arctrl/py/fable_modules/fable_library/reflection.py +463 -0
  376. arctrl/py/fable_modules/fable_library/reg_exp.py +137 -0
  377. arctrl/py/fable_modules/fable_library/resize_array.py +31 -0
  378. arctrl/py/fable_modules/fable_library/result.py +212 -0
  379. arctrl/py/fable_modules/fable_library/seq.py +1979 -0
  380. arctrl/py/fable_modules/fable_library/seq2.py +221 -0
  381. arctrl/py/fable_modules/fable_library/set.py +2414 -0
  382. arctrl/py/fable_modules/fable_library/singleton_local_time_zone.py +36 -0
  383. arctrl/py/fable_modules/fable_library/string_.py +573 -0
  384. arctrl/py/fable_modules/fable_library/system_collections_generic.py +462 -0
  385. arctrl/py/fable_modules/fable_library/system_text.py +237 -0
  386. arctrl/py/fable_modules/fable_library/task.py +116 -0
  387. arctrl/py/fable_modules/fable_library/task_builder.py +122 -0
  388. arctrl/py/fable_modules/fable_library/thread.py +5 -0
  389. arctrl/py/fable_modules/fable_library/time_span.py +283 -0
  390. arctrl/py/fable_modules/fable_library/timer.py +24 -0
  391. arctrl/py/fable_modules/fable_library/types.py +401 -0
  392. arctrl/py/fable_modules/fable_library/uri.py +109 -0
  393. arctrl/py/fable_modules/fable_library/util.py +2735 -0
  394. arctrl/py/fable_modules/fable_openpyxl/__init__.py +0 -0
  395. arctrl/py/fable_modules/fable_openpyxl/openpyxl.py +362 -0
  396. arctrl/py/fable_modules/fable_python/cognite-sdk/__init__.py +0 -0
  397. arctrl/py/fable_modules/fable_python/cognite-sdk/cognite_sdk.py +22 -0
  398. arctrl/py/fable_modules/fable_python/flask/__init__.py +0 -0
  399. arctrl/py/fable_modules/fable_python/flask/flask.py +34 -0
  400. arctrl/py/fable_modules/fable_python/jupyter/__init__.py +0 -0
  401. arctrl/py/fable_modules/fable_python/jupyter/ipy_widgets.py +47 -0
  402. arctrl/py/fable_modules/fable_python/jupyter/ipython.py +13 -0
  403. arctrl/py/fable_modules/fable_python/stdlib/__init__.py +0 -0
  404. arctrl/py/fable_modules/fable_python/stdlib/ast.py +1 -0
  405. arctrl/py/fable_modules/fable_python/stdlib/asyncio/__init__.py +0 -0
  406. arctrl/py/fable_modules/fable_python/stdlib/asyncio/events.py +17 -0
  407. arctrl/py/fable_modules/fable_python/stdlib/asyncio/futures.py +52 -0
  408. arctrl/py/fable_modules/fable_python/stdlib/asyncio/tasks.py +38 -0
  409. arctrl/py/fable_modules/fable_python/stdlib/base64_.py +1 -0
  410. arctrl/py/fable_modules/fable_python/stdlib/builtins_.py +38 -0
  411. arctrl/py/fable_modules/fable_python/stdlib/html.py +1 -0
  412. arctrl/py/fable_modules/fable_python/stdlib/json.py +1 -0
  413. arctrl/py/fable_modules/fable_python/stdlib/math_.py +1 -0
  414. arctrl/py/fable_modules/fable_python/stdlib/os_.py +1 -0
  415. arctrl/py/fable_modules/fable_python/stdlib/queue_.py +1 -0
  416. arctrl/py/fable_modules/fable_python/stdlib/string_.py +1 -0
  417. arctrl/py/fable_modules/fable_python/stdlib/sys_.py +30 -0
  418. arctrl/py/fable_modules/fable_python/stdlib/time_.py +1 -0
  419. arctrl/py/fable_modules/fable_python/stdlib/tk_inter.py +1 -0
  420. arctrl/py/fable_modules/fs_spreadsheet/Cells/__init__.py +0 -0
  421. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cell.py +340 -0
  422. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +466 -0
  423. arctrl/py/fable_modules/fs_spreadsheet/DSL/__init__.py +0 -0
  424. arctrl/py/fable_modules/fs_spreadsheet/DSL/cell_builder.py +214 -0
  425. arctrl/py/fable_modules/fs_spreadsheet/DSL/column_builder.py +139 -0
  426. arctrl/py/fable_modules/fs_spreadsheet/DSL/dsl.py +50 -0
  427. arctrl/py/fable_modules/fs_spreadsheet/DSL/expression.py +65 -0
  428. arctrl/py/fable_modules/fs_spreadsheet/DSL/operators.py +9 -0
  429. arctrl/py/fable_modules/fs_spreadsheet/DSL/row_builder.py +139 -0
  430. arctrl/py/fable_modules/fs_spreadsheet/DSL/sheet_builder.py +118 -0
  431. arctrl/py/fable_modules/fs_spreadsheet/DSL/table_builder.py +122 -0
  432. arctrl/py/fable_modules/fs_spreadsheet/DSL/transform.py +463 -0
  433. arctrl/py/fable_modules/fs_spreadsheet/DSL/types.py +314 -0
  434. arctrl/py/fable_modules/fs_spreadsheet/DSL/workbook_builder.py +106 -0
  435. arctrl/py/fable_modules/fs_spreadsheet/Json/__init__.py +0 -0
  436. arctrl/py/fable_modules/fs_spreadsheet/Json/cell.py +103 -0
  437. arctrl/py/fable_modules/fs_spreadsheet/Json/column.py +70 -0
  438. arctrl/py/fable_modules/fs_spreadsheet/Json/row.py +70 -0
  439. arctrl/py/fable_modules/fs_spreadsheet/Json/table.py +54 -0
  440. arctrl/py/fable_modules/fs_spreadsheet/Json/value.py +93 -0
  441. arctrl/py/fable_modules/fs_spreadsheet/Json/workbook.py +71 -0
  442. arctrl/py/fable_modules/fs_spreadsheet/Json/worksheet.py +216 -0
  443. arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
  444. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +43 -0
  445. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +190 -0
  446. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +92 -0
  447. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +77 -0
  448. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_row.py +48 -0
  449. arctrl/py/fable_modules/fs_spreadsheet/Tables/__init__.py +0 -0
  450. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table.py +461 -0
  451. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +117 -0
  452. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_row.py +23 -0
  453. arctrl/py/fable_modules/fs_spreadsheet/__init__.py +0 -0
  454. arctrl/py/fable_modules/fs_spreadsheet/fs_address.py +236 -0
  455. arctrl/py/fable_modules/fs_spreadsheet/fs_column.py +172 -0
  456. arctrl/py/fable_modules/fs_spreadsheet/fs_row.py +183 -0
  457. arctrl/py/fable_modules/fs_spreadsheet/fs_workbook.py +192 -0
  458. arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +610 -0
  459. arctrl/py/fable_modules/fs_spreadsheet/hash_codes.py +60 -0
  460. arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +329 -0
  461. arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
  462. arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +60 -0
  463. arctrl/py/fable_modules/fs_spreadsheet_py/cell_type.py +50 -0
  464. arctrl/py/fable_modules/fs_spreadsheet_py/fs_extension.py +60 -0
  465. arctrl/py/fable_modules/fs_spreadsheet_py/json.py +47 -0
  466. arctrl/py/fable_modules/fs_spreadsheet_py/table.py +54 -0
  467. arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +41 -0
  468. arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +52 -0
  469. arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
  470. arctrl/py/fable_modules/siren/__init__.py +0 -0
  471. arctrl/py/fable_modules/siren/config.py +1038 -0
  472. arctrl/py/fable_modules/siren/formatting.py +1121 -0
  473. arctrl/py/fable_modules/siren/siren.py +1941 -0
  474. arctrl/py/fable_modules/siren/siren_types.py +1229 -0
  475. arctrl/py/fable_modules/siren/theme_variables.py +517 -0
  476. arctrl/py/fable_modules/siren/util.py +37 -0
  477. arctrl/py/fable_modules/siren/yaml.py +101 -0
  478. arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
  479. arctrl/py/fable_modules/thoth_json_core/decode.py +1614 -0
  480. arctrl/py/fable_modules/thoth_json_core/encode.py +305 -0
  481. arctrl/py/fable_modules/thoth_json_core/types.py +181 -0
  482. arctrl/py/fable_modules/thoth_json_python/__init__.py +0 -0
  483. arctrl/py/fable_modules/thoth_json_python/decode.py +112 -0
  484. arctrl/py/fable_modules/thoth_json_python/encode.py +72 -0
  485. arctrl/py/fable_modules/thoth_json_python/python.py +1 -0
  486. arctrl/py/fable_modules/yamlicious/Interop/__init__.py +0 -0
  487. arctrl/py/fable_modules/yamlicious/Interop/js_interop.py +1 -0
  488. arctrl/py/fable_modules/yamlicious/Interop/py_interop.py +7 -0
  489. arctrl/py/fable_modules/yamlicious/__init__.py +0 -0
  490. arctrl/py/fable_modules/yamlicious/decode.py +1784 -0
  491. arctrl/py/fable_modules/yamlicious/encode.py +84 -0
  492. arctrl/py/fable_modules/yamlicious/flow_to_block.py +994 -0
  493. arctrl/py/fable_modules/yamlicious/library.py +10 -0
  494. arctrl/py/fable_modules/yamlicious/persil.py +57 -0
  495. arctrl/py/fable_modules/yamlicious/preprocessing.py +99 -0
  496. arctrl/py/fable_modules/yamlicious/reader.py +739 -0
  497. arctrl/py/fable_modules/yamlicious/regex.py +29 -0
  498. arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +265 -0
  499. arctrl/py/fable_modules/yamlicious/writer.py +175 -0
  500. arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
  501. arctrl/py/json.py +389 -0
  502. arctrl/py/license.py +169 -0
  503. arctrl/py/rocrate_io.py +242 -0
  504. arctrl/py/template_web.py +23 -0
  505. arctrl/py/xlsx.py +212 -0
  506. arctrl/py/yaml.py +79 -0
  507. arctrl/rocrate.py +21 -0
  508. arctrl-3.0.0.dist-info/METADATA +157 -0
  509. arctrl-3.0.0.dist-info/RECORD +511 -0
  510. arctrl-3.0.0.dist-info/WHEEL +4 -0
  511. arctrl-3.0.0.dist-info/licenses/LICENSE +21 -0
arctrl/py/arc.py ADDED
@@ -0,0 +1,1891 @@
1
+ from __future__ import annotations
2
+ from collections.abc import Callable
3
+ from typing import Any
4
+ from .Contract.arc import try_isaread_contract_from_path
5
+ from .Contract.arc_assay import (ARCtrl_ArcAssay__ArcAssay_ToDeleteContract, ARCtrl_ArcAssay__ArcAssay_ToCreateContract_6FCE9E49, ARCtrl_ArcAssay__ArcAssay_ToUpdateContract, ARCtrl_ArcAssay__ArcAssay_tryFromReadContract_Static_7570923F)
6
+ from .Contract.arc_investigation import (ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract, ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F)
7
+ from .Contract.arc_run import (ARCtrl_ArcRun__ArcRun_ToDeleteContract, ARCtrl_ArcRun__ArcRun_ToCreateContract_6FCE9E49, ARCtrl_ArcRun__ArcRun_ToUpdateContract, ARCtrl_ArcRun__ArcRun_tryFromReadContract_Static_7570923F, ARCtrl_ArcRun__ArcRun_tryCWLFromReadContract_Static, ARCtrl_ArcRun__ArcRun_tryYMLFromReadContract_Static)
8
+ from .Contract.arc_study import (ARCtrl_ArcStudy__ArcStudy_ToCreateContract_6FCE9E49, ARCtrl_ArcStudy__ArcStudy_ToUpdateContract, ARCtrl_ArcStudy__ArcStudy_tryFromReadContract_Static_7570923F)
9
+ from .Contract.arc_workflow import (ARCtrl_ArcWorkflow__ArcWorkflow_ToDeleteContract, ARCtrl_ArcWorkflow__ArcWorkflow_ToCreateContract_6FCE9E49, ARCtrl_ArcWorkflow__ArcWorkflow_ToUpdateContract, ARCtrl_ArcWorkflow__ArcWorkflow_tryFromReadContract_Static_7570923F, ARCtrl_ArcWorkflow__ArcWorkflow_tryCWLFromReadContract_Static)
10
+ from .Contract.contract import (Contract, DTOType, DTO)
11
+ from .Contract.datamap import (ARCtrl_Datamap__Datamap_ToCreateContractForStudy_Z721C83C5, ARCtrl_Datamap__Datamap_ToUpdateContractForStudy_Z721C83C5, ARCtrl_Datamap__Datamap_ToCreateContractForAssay_Z721C83C5, ARCtrl_Datamap__Datamap_ToUpdateContractForAssay_Z721C83C5, ARCtrl_Datamap__Datamap_ToCreateContractForWorkflow_Z721C83C5, ARCtrl_Datamap__Datamap_ToUpdateContractForWorkflow_Z721C83C5, ARCtrl_Datamap__Datamap_ToCreateContractForRun_Z721C83C5, ARCtrl_Datamap__Datamap_ToUpdateContractForRun_Z721C83C5, ARCtrl_Datamap__Datamap_tryFromReadContractForAssay_Static, ARCtrl_Datamap__Datamap_tryFromReadContractForStudy_Static, ARCtrl_Datamap__Datamap_tryFromReadContractForWorkflow_Static, ARCtrl_Datamap__Datamap_tryFromReadContractForRun_Static)
12
+ from .Contract.git import (Init_createInitContract_6DFDD678, gitignore_contract, gitattributes_contract, Init_createAddRemoteContract_Z721C83C5, Clone_createCloneContract_5000466F)
13
+ from .Contract.validation_packages_config import (ValidationPackagesConfigHelper_ConfigFilePath, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toCreateContract_Static_724DAE55, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toDeleteContract_Static_724DAE55, ValidationPackagesConfigHelper_ReadContract, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_tryFromReadContract_Static_7570923F)
14
+ from .Core.arc_types import (ArcInvestigation, ArcAssay, ArcStudy, ArcRun, ArcWorkflow, ArcInvestigation_reflection)
15
+ from .Core.comment import (Comment, Remark)
16
+ from .Core.data import Data
17
+ from .Core.data_context import DataContext
18
+ from .Core.datamap import Datamap
19
+ from .Core.Helper.collections_ import (ResizeArray_iter, ResizeArray_map)
20
+ from .Core.Helper.identifier import (create_missing_identifier, Workflow_cwlFileNameFromIdentifier, Run_cwlFileNameFromIdentifier, Study_fileNameFromIdentifier, Study_datamapFileNameFromIdentifier, Assay_fileNameFromIdentifier, Assay_datamapFileNameFromIdentifier, Workflow_fileNameFromIdentifier, Workflow_datamapFileNameFromIdentifier, Run_fileNameFromIdentifier, Run_datamapFileNameFromIdentifier)
21
+ from .Core.identifier_setters import set_investigation_identifier
22
+ from .Core.ontology_source_reference import OntologySourceReference
23
+ from .Core.person import Person
24
+ from .Core.publication import Publication
25
+ from .Core.Table.arc_table import ArcTable
26
+ from .Core.Table.arc_tables import ArcTables
27
+ from .Core.Table.composite_cell import CompositeCell
28
+ from .Core.Table.composite_column import CompositeColumn
29
+ from .CWL.cwlprocessing_unit import CWLProcessingUnit
30
+ from .CWL.decode import Decode_decodeCWLProcessingUnit
31
+ from .CWL.parameter_reference import CWLParameterReference
32
+ from .FileSystem.file_system import FileSystem
33
+ from .FileSystem.file_system_tree import FileSystemTree
34
+ from .FileSystem.path import (get_assay_folder_path, get_run_folder_path, get_workflow_folder_path, get_study_folder_path, normalize_path_key)
35
+ from .Json.encode import default_spaces
36
+ from .Spreadsheet.arc_assay import ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F
37
+ from .Spreadsheet.arc_investigation import ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF
38
+ from .Spreadsheet.arc_run import ARCtrl_ArcRun__ArcRun_toFsWorkbook_Static_Z3EFAF6F8
39
+ from .Spreadsheet.arc_study import ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522
40
+ from .Spreadsheet.arc_workflow import ARCtrl_ArcWorkflow__ArcWorkflow_toFsWorkbook_Static_Z1C75CB0E
41
+ from .Spreadsheet.datamap import to_fs_workbook
42
+ from .ValidationPackages.validation_packages_config import ValidationPackagesConfig
43
+ from .WorkflowGraph.adapters import of_investigation
44
+ from .WorkflowGraph.graph_types import (WorkflowGraph, GraphBuildIssue, WorkflowGraphIndex)
45
+ from .ContractIO.contract_io import full_fill_contract_batch_async
46
+ from .ContractIO.file_system_helper import get_all_file_paths_async
47
+ from .cwlrun_resolver import resolve_run_references_from_lookup
48
+ from .fable_modules.thoth_json_python.decode import Decode_fromString
49
+ from .fable_modules.thoth_json_python.encode import to_string
50
+ from .license import License
51
+ from .fable_modules.fable_library.array_ import (filter, map, choose, iterate as iterate_1, exists, fold, concat, contains as contains_2, append as append_1, try_pick, equals_with)
52
+ from .fable_modules.fable_library.async_ import run_synchronously
53
+ from .fable_modules.fable_library.async_builder import (Async, singleton)
54
+ from .fable_modules.fable_library.list import FSharpList
55
+ from .fable_modules.fable_library.map import (of_seq as of_seq_1, of_array, try_find as try_find_1)
56
+ from .fable_modules.fable_library.map_util import add_to_dict
57
+ from .fable_modules.fable_library.option import (value as value_9, map as map_1, default_arg, bind, default_arg_with)
58
+ from .fable_modules.fable_library.reflection import (TypeInfo, class_type)
59
+ from .fable_modules.fable_library.result import FSharpResult_2
60
+ from .fable_modules.fable_library.seq import (to_array, contains, delay, append, singleton as singleton_1, iterate, try_find, find, empty, collect, to_list)
61
+ from .fable_modules.fable_library.set import (of_seq, contains as contains_1, union_many, FSharpSet__Contains)
62
+ from .fable_modules.fable_library.string_ import (starts_with_exact, join, to_fail, printf, replace, to_text)
63
+ from .fable_modules.fable_library.types import (Array, FSharpRef)
64
+ from .fable_modules.fable_library.util import (string_hash, IEnumerable_1, compare_primitives, curry2, ignore, safe_hash, get_enumerator, dispose, to_enumerable, equals)
65
+ from .fable_modules.fs_spreadsheet.Cells.fs_cells_collection import Dictionary_tryGet
66
+ from .fable_modules.thoth_json_core.types import IEncodable
67
+ from .rocrate_io import (ROCrate_get_decoderDeprecated, ROCrate_get_decoder, ROCrate_encoder_Z7FE34C43)
68
+
69
+ def _expr4663() -> TypeInfo:
70
+ return class_type("ARCtrl.ARC", None, ARC, ArcInvestigation_reflection())
71
+
72
+
73
+ class ARC(ArcInvestigation):
74
+ def __init__(self, identifier: str, title: str | None=None, description: str | None=None, submission_date: str | None=None, public_release_date: str | None=None, ontology_source_references: Array[OntologySourceReference] | None=None, publications: Array[Publication] | None=None, contacts: Array[Person] | None=None, assays: Array[ArcAssay] | None=None, studies: Array[ArcStudy] | None=None, workflows: Array[ArcWorkflow] | None=None, runs: Array[ArcRun] | None=None, registered_study_identifiers: Array[str] | None=None, comments: Array[Comment] | None=None, remarks: Array[Remark] | None=None, fs: FileSystem | None=None, license: License | None=None) -> None:
75
+ super().__init__(identifier, title, description, submission_date, public_release_date, ontology_source_references, publications, contacts, assays, studies, workflows, runs, registered_study_identifiers, comments, remarks)
76
+ this: FSharpRef[ARC] = FSharpRef(None)
77
+ this.contents = self
78
+ self._license: License | None = license
79
+ def _arrow4662(__unit: None=None) -> FileSystem:
80
+ fs_1: FileSystem = default_arg(fs, FileSystem.create(tree = FileSystemTree(1, "", [])))
81
+ return ARCAux_updateFSByARC(this.contents, license, fs_1)
82
+
83
+ self._fs: FileSystem = _arrow4662()
84
+ self.init_0040133: int = 1
85
+
86
+ @property
87
+ def FileSystem(self, __unit: None=None) -> FileSystem:
88
+ this: ARC = self
89
+ return this._fs
90
+
91
+ @FileSystem.setter
92
+ def FileSystem(self, fs: FileSystem) -> None:
93
+ this: ARC = self
94
+ this._fs = fs
95
+
96
+ @property
97
+ def License(self, __unit: None=None) -> License | None:
98
+ this: ARC = self
99
+ return this._license
100
+
101
+ @License.setter
102
+ def License(self, license: License | None=None) -> None:
103
+ this: ARC = self
104
+ this._license = license
105
+
106
+ @staticmethod
107
+ def from_arc_investigation(isa: ArcInvestigation, fs: FileSystem | None=None, license: License | None=None) -> ARC:
108
+ return ARC(isa.Identifier, isa.Title, isa.Description, isa.SubmissionDate, isa.PublicReleaseDate, isa.OntologySourceReferences, isa.Publications, isa.Contacts, isa.Assays, isa.Studies, isa.Workflows, isa.Runs, isa.RegisteredStudyIdentifiers, isa.Comments, isa.Remarks, fs, license)
109
+
110
+ def TryWriteAsync(self, arc_path: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
111
+ this: ARC = self
112
+ return full_fill_contract_batch_async(arc_path, this.GetWriteContracts())
113
+
114
+ def TryUpdateAsync(self, arc_path: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
115
+ this: ARC = self
116
+ return full_fill_contract_batch_async(arc_path, this.GetUpdateContracts())
117
+
118
+ def SetLicenseFulltext(self, fulltext: str, path: str | None=None) -> None:
119
+ this: ARC = self
120
+ match_value: License | None = this.License
121
+ if match_value is None:
122
+ license_1: License = License("fulltext", fulltext)
123
+ this.License = license_1
124
+ if path is not None:
125
+ license_1.Path = value_9(path)
126
+
127
+
128
+ else:
129
+ license: License = match_value
130
+ license.Type = "fulltext"
131
+ license.Content = fulltext
132
+ if path is not None:
133
+ license.Path = value_9(path)
134
+
135
+
136
+
137
+ @staticmethod
138
+ def try_load_async(arc_path: str) -> Async[FSharpResult_2[ARC, Array[str]]]:
139
+ def _arrow4538(__unit: None=None) -> Async[FSharpResult_2[ARC, Array[str]]]:
140
+ def _arrow4537(_arg: Array[str]) -> Async[FSharpResult_2[ARC, Array[str]]]:
141
+ arc: ARC = ARC.from_file_paths(to_array(_arg))
142
+ contracts: Array[Contract] = arc.GetReadContracts()
143
+ def _arrow4536(_arg_1: FSharpResult_2[Array[Contract], Array[str]]) -> Async[FSharpResult_2[ARC, Array[str]]]:
144
+ ful_filled_contracts: FSharpResult_2[Array[Contract], Array[str]] = _arg_1
145
+ if ful_filled_contracts.tag == 1:
146
+ return singleton.Return(FSharpResult_2(1, ful_filled_contracts.fields[0]))
147
+
148
+ else:
149
+ arc.SetISAFromContracts(ful_filled_contracts.fields[0])
150
+ return singleton.Return(FSharpResult_2(0, arc))
151
+
152
+
153
+ return singleton.Bind(full_fill_contract_batch_async(arc_path, contracts), _arrow4536)
154
+
155
+ return singleton.Bind(get_all_file_paths_async(arc_path), _arrow4537)
156
+
157
+ return singleton.Delay(_arrow4538)
158
+
159
+ def GetAssayRemoveContracts(self, assay_identifier: str) -> Array[Contract]:
160
+ this: ARC = self
161
+ class ObjectExpr4540:
162
+ @property
163
+ def Equals(self) -> Callable[[str, str], bool]:
164
+ def _arrow4539(x: str, y: str) -> bool:
165
+ return x == y
166
+
167
+ return _arrow4539
168
+
169
+ @property
170
+ def GetHashCode(self) -> Callable[[str], int]:
171
+ return string_hash
172
+
173
+ if not contains(assay_identifier, this.AssayIdentifiers, ObjectExpr4540()):
174
+ raise Exception("ARC does not contain assay with given name")
175
+
176
+ assay: ArcAssay = this.GetAssay(assay_identifier)
177
+ studies: Array[ArcStudy] = assay.StudiesRegisteredIn
178
+ super().RemoveAssay(assay_identifier)
179
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
180
+ assay_folder_path: str = get_assay_folder_path(assay_identifier)
181
+ def predicate(p: str) -> bool:
182
+ return not starts_with_exact(p, assay_folder_path)
183
+
184
+ filtered_paths: Array[str] = filter(predicate, paths)
185
+ this.SetFilePaths(filtered_paths)
186
+ def _arrow4542(__unit: None=None) -> IEnumerable_1[Contract]:
187
+ def _arrow4541(__unit: None=None) -> IEnumerable_1[Contract]:
188
+ return this.GetUpdateContracts()
189
+
190
+ return append(singleton_1(ARCtrl_ArcAssay__ArcAssay_ToDeleteContract(assay)), delay(_arrow4541))
191
+
192
+ return to_array(delay(_arrow4542))
193
+
194
+ def GetRunRemoveContracts(self, run_identifier: str) -> Array[Contract]:
195
+ this: ARC = self
196
+ class ObjectExpr4544:
197
+ @property
198
+ def Equals(self) -> Callable[[str, str], bool]:
199
+ def _arrow4543(x: str, y: str) -> bool:
200
+ return x == y
201
+
202
+ return _arrow4543
203
+
204
+ @property
205
+ def GetHashCode(self) -> Callable[[str], int]:
206
+ return string_hash
207
+
208
+ if not contains(run_identifier, this.RunIdentifiers, ObjectExpr4544()):
209
+ raise Exception("ARC does not contain run with given name")
210
+
211
+ run: ArcRun = this.GetRun(run_identifier)
212
+ this.DeleteRun(run_identifier)
213
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
214
+ run_folder_path: str = get_run_folder_path(run_identifier)
215
+ def predicate(p: str) -> bool:
216
+ return not starts_with_exact(p, run_folder_path)
217
+
218
+ filtered_paths: Array[str] = filter(predicate, paths)
219
+ this.SetFilePaths(filtered_paths)
220
+ def _arrow4546(__unit: None=None) -> IEnumerable_1[Contract]:
221
+ def _arrow4545(__unit: None=None) -> IEnumerable_1[Contract]:
222
+ return this.GetUpdateContracts()
223
+
224
+ return append(singleton_1(ARCtrl_ArcRun__ArcRun_ToDeleteContract(run)), delay(_arrow4545))
225
+
226
+ return to_array(delay(_arrow4546))
227
+
228
+ def GetWorkflowRemoveContracts(self, workflow_identifier: str) -> Array[Contract]:
229
+ this: ARC = self
230
+ class ObjectExpr4548:
231
+ @property
232
+ def Equals(self) -> Callable[[str, str], bool]:
233
+ def _arrow4547(x: str, y: str) -> bool:
234
+ return x == y
235
+
236
+ return _arrow4547
237
+
238
+ @property
239
+ def GetHashCode(self) -> Callable[[str], int]:
240
+ return string_hash
241
+
242
+ if not contains(workflow_identifier, this.WorkflowIdentifiers, ObjectExpr4548()):
243
+ raise Exception("ARC does not contain workflow with given name")
244
+
245
+ workflow: ArcWorkflow = this.GetWorkflow(workflow_identifier)
246
+ this.DeleteWorkflow(workflow_identifier)
247
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
248
+ workflow_folder_path: str = get_workflow_folder_path(workflow_identifier)
249
+ def predicate(p: str) -> bool:
250
+ return not starts_with_exact(p, workflow_folder_path)
251
+
252
+ filtered_paths: Array[str] = filter(predicate, paths)
253
+ this.SetFilePaths(filtered_paths)
254
+ def _arrow4550(__unit: None=None) -> IEnumerable_1[Contract]:
255
+ def _arrow4549(__unit: None=None) -> IEnumerable_1[Contract]:
256
+ return this.GetUpdateContracts()
257
+
258
+ return append(singleton_1(ARCtrl_ArcWorkflow__ArcWorkflow_ToDeleteContract(workflow)), delay(_arrow4549))
259
+
260
+ return to_array(delay(_arrow4550))
261
+
262
+ def TryRemoveAssayAsync(self, arc_path: str, assay_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
263
+ this: ARC = self
264
+ return full_fill_contract_batch_async(arc_path, this.GetAssayRemoveContracts(assay_identifier))
265
+
266
+ def TryRemoveRunAsync(self, arc_path: str, run_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
267
+ this: ARC = self
268
+ return full_fill_contract_batch_async(arc_path, this.GetRunRemoveContracts(run_identifier))
269
+
270
+ def TryRemoveWorkflowAsync(self, arc_path: str, workflow_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
271
+ this: ARC = self
272
+ return full_fill_contract_batch_async(arc_path, this.GetWorkflowRemoveContracts(workflow_identifier))
273
+
274
+ def RemoveRunAsync(self, arc_path: str, run_identifier: str) -> Async[None]:
275
+ this: ARC = self
276
+ def _arrow4552(__unit: None=None) -> Async[None]:
277
+ def _arrow4551(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
278
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
279
+ if result.tag == 1:
280
+ def mapping(e: str) -> str:
281
+ return e
282
+
283
+ appended: str = join("\n", map(mapping, result.fields[0], None))
284
+ to_fail(printf("Could not remove run, failed with the following errors %s"))(appended)
285
+ return singleton.Zero()
286
+
287
+ else:
288
+ return singleton.Zero()
289
+
290
+
291
+ return singleton.Bind(this.TryRemoveRunAsync(arc_path, run_identifier), _arrow4551)
292
+
293
+ return singleton.Delay(_arrow4552)
294
+
295
+ def RemoveWorkflowAsync(self, arc_path: str, workflow_identifier: str) -> Async[None]:
296
+ this: ARC = self
297
+ def _arrow4554(__unit: None=None) -> Async[None]:
298
+ def _arrow4553(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
299
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
300
+ if result.tag == 1:
301
+ def mapping(e: str) -> str:
302
+ return e
303
+
304
+ appended: str = join("\n", map(mapping, result.fields[0], None))
305
+ to_fail(printf("Could not remove workflow, failed with the following errors %s"))(appended)
306
+ return singleton.Zero()
307
+
308
+ else:
309
+ return singleton.Zero()
310
+
311
+
312
+ return singleton.Bind(this.TryRemoveWorkflowAsync(arc_path, workflow_identifier), _arrow4553)
313
+
314
+ return singleton.Delay(_arrow4554)
315
+
316
+ def TryRenameRunAsync(self, arc_path: str, old_run_identifier: str, new_run_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
317
+ this: ARC = self
318
+ return full_fill_contract_batch_async(arc_path, this.GetRunRenameContracts(old_run_identifier, new_run_identifier))
319
+
320
+ def TryRenameWorkflowAsync(self, arc_path: str, old_workflow_identifier: str, new_workflow_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
321
+ this: ARC = self
322
+ return full_fill_contract_batch_async(arc_path, this.GetWorkflowRenameContracts(old_workflow_identifier, new_workflow_identifier))
323
+
324
+ def RenameRunAsync(self, arc_path: str, old_run_identifier: str, new_run_identifier: str) -> Async[None]:
325
+ this: ARC = self
326
+ def _arrow4556(__unit: None=None) -> Async[None]:
327
+ def _arrow4555(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
328
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
329
+ if result.tag == 1:
330
+ def mapping(e: str) -> str:
331
+ return e
332
+
333
+ appended: str = join("\n", map(mapping, result.fields[0], None))
334
+ to_fail(printf("Could not rename run, failed with the following errors %s"))(appended)
335
+ return singleton.Zero()
336
+
337
+ else:
338
+ return singleton.Zero()
339
+
340
+
341
+ return singleton.Bind(this.TryRenameRunAsync(arc_path, old_run_identifier, new_run_identifier), _arrow4555)
342
+
343
+ return singleton.Delay(_arrow4556)
344
+
345
+ def RenameWorkflowAsync(self, arc_path: str, old_workflow_identifier: str, new_workflow_identifier: str) -> Async[None]:
346
+ this: ARC = self
347
+ def _arrow4558(__unit: None=None) -> Async[None]:
348
+ def _arrow4557(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
349
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
350
+ if result.tag == 1:
351
+ def mapping(e: str) -> str:
352
+ return e
353
+
354
+ appended: str = join("\n", map(mapping, result.fields[0], None))
355
+ to_fail(printf("Could not rename workflow, failed with the following errors %s"))(appended)
356
+ return singleton.Zero()
357
+
358
+ else:
359
+ return singleton.Zero()
360
+
361
+
362
+ return singleton.Bind(this.TryRenameWorkflowAsync(arc_path, old_workflow_identifier, new_workflow_identifier), _arrow4557)
363
+
364
+ return singleton.Delay(_arrow4558)
365
+
366
+ def GetAssayRenameContracts(self, old_assay_identifier: str, new_assay_identifier: str) -> Array[Contract]:
367
+ this: ARC = self
368
+ class ObjectExpr4560:
369
+ @property
370
+ def Equals(self) -> Callable[[str, str], bool]:
371
+ def _arrow4559(x: str, y: str) -> bool:
372
+ return x == y
373
+
374
+ return _arrow4559
375
+
376
+ @property
377
+ def GetHashCode(self) -> Callable[[str], int]:
378
+ return string_hash
379
+
380
+ if not contains(old_assay_identifier, this.AssayIdentifiers, ObjectExpr4560()):
381
+ raise Exception("ARC does not contain assay with given name")
382
+
383
+ super().RenameAssay(old_assay_identifier, new_assay_identifier)
384
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
385
+ old_assay_folder_path: str = get_assay_folder_path(old_assay_identifier)
386
+ new_assay_folder_path: str = get_assay_folder_path(new_assay_identifier)
387
+ def mapping(p: str) -> str:
388
+ return replace(p, old_assay_folder_path, new_assay_folder_path)
389
+
390
+ renamed_paths: Array[str] = map(mapping, paths, None)
391
+ this.SetFilePaths(renamed_paths)
392
+ def _arrow4562(__unit: None=None) -> IEnumerable_1[Contract]:
393
+ def _arrow4561(__unit: None=None) -> IEnumerable_1[Contract]:
394
+ return this.GetUpdateContracts()
395
+
396
+ return append(singleton_1(Contract.create_rename(old_assay_folder_path, new_assay_folder_path)), delay(_arrow4561))
397
+
398
+ return to_array(delay(_arrow4562))
399
+
400
+ def GetRunRenameContracts(self, old_run_identifier: str, new_run_identifier: str) -> Array[Contract]:
401
+ this: ARC = self
402
+ class ObjectExpr4564:
403
+ @property
404
+ def Equals(self) -> Callable[[str, str], bool]:
405
+ def _arrow4563(x: str, y: str) -> bool:
406
+ return x == y
407
+
408
+ return _arrow4563
409
+
410
+ @property
411
+ def GetHashCode(self) -> Callable[[str], int]:
412
+ return string_hash
413
+
414
+ if not contains(old_run_identifier, this.RunIdentifiers, ObjectExpr4564()):
415
+ raise Exception("ARC does not contain run with given name")
416
+
417
+ super().RenameRun(old_run_identifier, new_run_identifier)
418
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
419
+ old_path: str = get_run_folder_path(old_run_identifier)
420
+ new_path: str = get_run_folder_path(new_run_identifier)
421
+ def mapping(p: str) -> str:
422
+ return replace(p, old_path, new_path)
423
+
424
+ renamed_paths: Array[str] = map(mapping, paths, None)
425
+ this.SetFilePaths(renamed_paths)
426
+ def _arrow4566(__unit: None=None) -> IEnumerable_1[Contract]:
427
+ def _arrow4565(__unit: None=None) -> IEnumerable_1[Contract]:
428
+ return this.GetUpdateContracts()
429
+
430
+ return append(singleton_1(Contract.create_rename(old_path, new_path)), delay(_arrow4565))
431
+
432
+ return to_array(delay(_arrow4566))
433
+
434
+ def GetWorkflowRenameContracts(self, old_workflow_identifier: str, new_workflow_identifier: str) -> Array[Contract]:
435
+ this: ARC = self
436
+ class ObjectExpr4568:
437
+ @property
438
+ def Equals(self) -> Callable[[str, str], bool]:
439
+ def _arrow4567(x: str, y: str) -> bool:
440
+ return x == y
441
+
442
+ return _arrow4567
443
+
444
+ @property
445
+ def GetHashCode(self) -> Callable[[str], int]:
446
+ return string_hash
447
+
448
+ if not contains(old_workflow_identifier, this.WorkflowIdentifiers, ObjectExpr4568()):
449
+ raise Exception("ARC does not contain workflow with given name")
450
+
451
+ super().RenameWorkflow(old_workflow_identifier, new_workflow_identifier)
452
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
453
+ old_path: str = get_workflow_folder_path(old_workflow_identifier)
454
+ new_path: str = get_workflow_folder_path(new_workflow_identifier)
455
+ def mapping(p: str) -> str:
456
+ return replace(p, old_path, new_path)
457
+
458
+ renamed_paths: Array[str] = map(mapping, paths, None)
459
+ this.SetFilePaths(renamed_paths)
460
+ def _arrow4570(__unit: None=None) -> IEnumerable_1[Contract]:
461
+ def _arrow4569(__unit: None=None) -> IEnumerable_1[Contract]:
462
+ return this.GetUpdateContracts()
463
+
464
+ return append(singleton_1(Contract.create_rename(old_path, new_path)), delay(_arrow4569))
465
+
466
+ return to_array(delay(_arrow4570))
467
+
468
+ def TryRenameAssayAsync(self, arc_path: str, old_assay_identifier: str, new_assay_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
469
+ this: ARC = self
470
+ return full_fill_contract_batch_async(arc_path, this.GetAssayRenameContracts(old_assay_identifier, new_assay_identifier))
471
+
472
+ def GetStudyRemoveContracts(self, study_identifier: str) -> Array[Contract]:
473
+ this: ARC = self
474
+ super().RemoveStudy(study_identifier)
475
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
476
+ study_folder_path: str = get_study_folder_path(study_identifier)
477
+ def predicate(p: str) -> bool:
478
+ return not starts_with_exact(p, study_folder_path)
479
+
480
+ filtered_paths: Array[str] = filter(predicate, paths)
481
+ this.SetFilePaths(filtered_paths)
482
+ return [Contract.create_delete(study_folder_path), ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(this)]
483
+
484
+ def TryRemoveStudyAsync(self, arc_path: str, study_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
485
+ this: ARC = self
486
+ return full_fill_contract_batch_async(arc_path, this.GetStudyRemoveContracts(study_identifier))
487
+
488
+ def GetStudyRenameContracts(self, old_study_identifier: str, new_study_identifier: str) -> Array[Contract]:
489
+ this: ARC = self
490
+ class ObjectExpr4572:
491
+ @property
492
+ def Equals(self) -> Callable[[str, str], bool]:
493
+ def _arrow4571(x: str, y: str) -> bool:
494
+ return x == y
495
+
496
+ return _arrow4571
497
+
498
+ @property
499
+ def GetHashCode(self) -> Callable[[str], int]:
500
+ return string_hash
501
+
502
+ if not contains(old_study_identifier, this.StudyIdentifiers, ObjectExpr4572()):
503
+ raise Exception("ARC does not contain study with given name")
504
+
505
+ super().RenameStudy(old_study_identifier, new_study_identifier)
506
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
507
+ old_study_folder_path: str = get_study_folder_path(old_study_identifier)
508
+ new_study_folder_path: str = get_study_folder_path(new_study_identifier)
509
+ def mapping(p: str) -> str:
510
+ return replace(p, old_study_folder_path, new_study_folder_path)
511
+
512
+ renamed_paths: Array[str] = map(mapping, paths, None)
513
+ this.SetFilePaths(renamed_paths)
514
+ def _arrow4574(__unit: None=None) -> IEnumerable_1[Contract]:
515
+ def _arrow4573(__unit: None=None) -> IEnumerable_1[Contract]:
516
+ return this.GetUpdateContracts()
517
+
518
+ return append(singleton_1(Contract.create_rename(old_study_folder_path, new_study_folder_path)), delay(_arrow4573))
519
+
520
+ return to_array(delay(_arrow4574))
521
+
522
+ def TryRenameStudyAsync(self, arc_path: str, old_study_identifier: str, new_study_identifier: str) -> Async[FSharpResult_2[Array[Contract], Array[str]]]:
523
+ this: ARC = self
524
+ return full_fill_contract_batch_async(arc_path, this.GetStudyRenameContracts(old_study_identifier, new_study_identifier))
525
+
526
+ def WriteAsync(self, arc_path: str) -> Async[None]:
527
+ this: ARC = self
528
+ def _arrow4576(__unit: None=None) -> Async[None]:
529
+ def _arrow4575(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
530
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
531
+ if result.tag == 1:
532
+ def mapping(e: str) -> str:
533
+ return e
534
+
535
+ appended: str = join("\n", map(mapping, result.fields[0], None))
536
+ to_fail(printf("Could not write ARC, failed with the following errors %s"))(appended)
537
+ return singleton.Zero()
538
+
539
+ else:
540
+ return singleton.Zero()
541
+
542
+
543
+ return singleton.Bind(this.TryWriteAsync(arc_path), _arrow4575)
544
+
545
+ return singleton.Delay(_arrow4576)
546
+
547
+ def UpdateAsync(self, arc_path: str) -> Async[None]:
548
+ this: ARC = self
549
+ def _arrow4578(__unit: None=None) -> Async[None]:
550
+ def _arrow4577(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
551
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
552
+ if result.tag == 1:
553
+ def mapping(e: str) -> str:
554
+ return e
555
+
556
+ appended: str = join("\n", map(mapping, result.fields[0], None))
557
+ to_fail(printf("Could not update ARC, failed with the following errors %s"))(appended)
558
+ return singleton.Zero()
559
+
560
+ else:
561
+ return singleton.Zero()
562
+
563
+
564
+ return singleton.Bind(this.TryUpdateAsync(arc_path), _arrow4577)
565
+
566
+ return singleton.Delay(_arrow4578)
567
+
568
+ def RemoveAssayAsync(self, arc_path: str, assay_identifier: str) -> Async[None]:
569
+ this: ARC = self
570
+ def _arrow4580(__unit: None=None) -> Async[None]:
571
+ def _arrow4579(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
572
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
573
+ if result.tag == 1:
574
+ def mapping(e: str) -> str:
575
+ return e
576
+
577
+ appended: str = join("\n", map(mapping, result.fields[0], None))
578
+ to_fail(printf("Could not remove assay, failed with the following errors %s"))(appended)
579
+ return singleton.Zero()
580
+
581
+ else:
582
+ return singleton.Zero()
583
+
584
+
585
+ return singleton.Bind(this.TryRemoveAssayAsync(arc_path, assay_identifier), _arrow4579)
586
+
587
+ return singleton.Delay(_arrow4580)
588
+
589
+ def RenameAssayAsync(self, arc_path: str, old_assay_identifier: str, new_assay_identifier: str) -> Async[None]:
590
+ this: ARC = self
591
+ def _arrow4582(__unit: None=None) -> Async[None]:
592
+ def _arrow4581(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
593
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
594
+ if result.tag == 1:
595
+ def mapping(e: str) -> str:
596
+ return e
597
+
598
+ appended: str = join("\n", map(mapping, result.fields[0], None))
599
+ to_fail(printf("Could not rename assay, failed with the following errors %s"))(appended)
600
+ return singleton.Zero()
601
+
602
+ else:
603
+ return singleton.Zero()
604
+
605
+
606
+ return singleton.Bind(this.TryRenameAssayAsync(arc_path, old_assay_identifier, new_assay_identifier), _arrow4581)
607
+
608
+ return singleton.Delay(_arrow4582)
609
+
610
+ def RemoveStudyAsync(self, arc_path: str, study_identifier: str) -> Async[None]:
611
+ this: ARC = self
612
+ def _arrow4584(__unit: None=None) -> Async[None]:
613
+ def _arrow4583(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
614
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
615
+ if result.tag == 1:
616
+ def mapping(e: str) -> str:
617
+ return e
618
+
619
+ appended: str = join("\n", map(mapping, result.fields[0], None))
620
+ to_fail(printf("Could not remove study, failed with the following errors %s"))(appended)
621
+ return singleton.Zero()
622
+
623
+ else:
624
+ return singleton.Zero()
625
+
626
+
627
+ return singleton.Bind(this.TryRemoveStudyAsync(arc_path, study_identifier), _arrow4583)
628
+
629
+ return singleton.Delay(_arrow4584)
630
+
631
+ def RenameStudyAsync(self, arc_path: str, old_study_identifier: str, new_study_identifier: str) -> Async[None]:
632
+ this: ARC = self
633
+ def _arrow4586(__unit: None=None) -> Async[None]:
634
+ def _arrow4585(_arg: FSharpResult_2[Array[Contract], Array[str]]) -> Async[None]:
635
+ result: FSharpResult_2[Array[Contract], Array[str]] = _arg
636
+ if result.tag == 1:
637
+ def mapping(e: str) -> str:
638
+ return e
639
+
640
+ appended: str = join("\n", map(mapping, result.fields[0], None))
641
+ to_fail(printf("Could not rename study, failed with the following errors %s"))(appended)
642
+ return singleton.Zero()
643
+
644
+ else:
645
+ return singleton.Zero()
646
+
647
+
648
+ return singleton.Bind(this.TryRenameStudyAsync(arc_path, old_study_identifier, new_study_identifier), _arrow4585)
649
+
650
+ return singleton.Delay(_arrow4586)
651
+
652
+ @staticmethod
653
+ def load_async(arc_path: str) -> Async[ARC]:
654
+ def _arrow4588(__unit: None=None) -> Async[ARC]:
655
+ def _arrow4587(_arg: FSharpResult_2[ARC, Array[str]]) -> Async[ARC]:
656
+ result: FSharpResult_2[ARC, Array[str]] = _arg
657
+ if result.tag == 1:
658
+ def mapping(e: str) -> str:
659
+ return e
660
+
661
+ appended: str = join("\n", map(mapping, result.fields[0], None))
662
+ to_fail(printf("Could not load ARC, failed with the following errors %s"))(appended)
663
+ return singleton.Return(ARC(create_missing_identifier()))
664
+
665
+ else:
666
+ return singleton.Return(result.fields[0])
667
+
668
+
669
+ return singleton.Bind(ARC.try_load_async(arc_path), _arrow4587)
670
+
671
+ return singleton.Delay(_arrow4588)
672
+
673
+ def Write(self, arc_path: str) -> None:
674
+ this: ARC = self
675
+ run_synchronously(this.WriteAsync(arc_path))
676
+
677
+ def Update(self, arc_path: str) -> None:
678
+ this: ARC = self
679
+ run_synchronously(this.UpdateAsync(arc_path))
680
+
681
+ def RemoveAssay(self, arc_path: str, assay_identifier: str) -> None:
682
+ this: ARC = self
683
+ run_synchronously(this.RemoveAssayAsync(arc_path, assay_identifier))
684
+
685
+ def RenameAssay(self, arc_path: str, old_assay_identifier: str, new_assay_identifier: str) -> None:
686
+ this: ARC = self
687
+ run_synchronously(this.RenameAssayAsync(arc_path, old_assay_identifier, new_assay_identifier))
688
+
689
+ def RemoveStudy(self, arc_path: str, study_identifier: str) -> None:
690
+ this: ARC = self
691
+ run_synchronously(this.RemoveStudyAsync(arc_path, study_identifier))
692
+
693
+ def RenameStudy(self, arc_path: str, old_study_identifier: str, new_study_identifier: str) -> None:
694
+ this: ARC = self
695
+ run_synchronously(this.RenameStudyAsync(arc_path, old_study_identifier, new_study_identifier))
696
+
697
+ def RemoveRun(self, arc_path: str, run_identifier: str) -> None:
698
+ this: ARC = self
699
+ run_synchronously(this.RemoveRunAsync(arc_path, run_identifier))
700
+
701
+ def RenameRun(self, arc_path: str, old_run_identifier: str, new_run_identifier: str) -> None:
702
+ this: ARC = self
703
+ run_synchronously(this.RenameRunAsync(arc_path, old_run_identifier, new_run_identifier))
704
+
705
+ def RemoveWorkflow(self, arc_path: str, workflow_identifier: str) -> None:
706
+ this: ARC = self
707
+ run_synchronously(this.RemoveWorkflowAsync(arc_path, workflow_identifier))
708
+
709
+ def RenameWorkflow(self, arc_path: str, old_workflow_identifier: str, new_workflow_identifier: str) -> None:
710
+ this: ARC = self
711
+ run_synchronously(this.RenameWorkflowAsync(arc_path, old_workflow_identifier, new_workflow_identifier))
712
+
713
+ @staticmethod
714
+ def load(arc_path: str) -> ARC:
715
+ return run_synchronously(ARC.load_async(arc_path))
716
+
717
+ def MakeDataFilesAbsolute(self, __unit: None=None) -> None:
718
+ this: ARC = self
719
+ class ObjectExpr4589:
720
+ @property
721
+ def Compare(self) -> Callable[[str, str], int]:
722
+ return compare_primitives
723
+
724
+ files_paths: Any = of_seq(this.FileSystem.Tree.ToFilePaths(), ObjectExpr4589())
725
+ def check_existence_from_root(p: str) -> bool:
726
+ return contains_1(p, files_paths)
727
+
728
+ def update_column_option(data_name_function: Callable[[Data], str], col: CompositeColumn | None=None) -> None:
729
+ (pattern_matching_result, col_2) = (None, None)
730
+ if col is not None:
731
+ def _arrow4590(__unit: None=None, data_name_function: Any=data_name_function, col: Any=col) -> bool:
732
+ col_1: CompositeColumn = col
733
+ return col_1.Header.IsDataColumn
734
+
735
+ if _arrow4590():
736
+ pattern_matching_result = 0
737
+ col_2 = col
738
+
739
+ else:
740
+ pattern_matching_result = 1
741
+
742
+
743
+ else:
744
+ pattern_matching_result = 1
745
+
746
+ if pattern_matching_result == 0:
747
+ def f(c: CompositeCell, data_name_function: Any=data_name_function, col: Any=col) -> None:
748
+ if c.AsData.FilePath is not None:
749
+ new_file_path: str = data_name_function(c.AsData)
750
+ c.AsData.FilePath = new_file_path
751
+
752
+
753
+ ResizeArray_iter(f, col_2.Cells)
754
+
755
+ elif pattern_matching_result == 1:
756
+ pass
757
+
758
+
759
+ def update_table(data_name_function_1: Callable[[Data], str], t: ArcTable) -> None:
760
+ update_column_option(data_name_function_1, t.TryGetInputColumn())
761
+ update_column_option(data_name_function_1, t.TryGetOutputColumn())
762
+
763
+ def update_datamap(data_name_function_2: Callable[[Data], str], dm: Datamap) -> None:
764
+ def action(c_1: DataContext, data_name_function_2: Any=data_name_function_2, dm: Any=dm) -> None:
765
+ if c_1.FilePath is not None:
766
+ new_file_path_1: str = data_name_function_2(c_1)
767
+ c_1.FilePath = new_file_path_1
768
+
769
+
770
+ iterate(action, dm.DataContexts)
771
+
772
+ def action_2(s: ArcStudy) -> None:
773
+ def f_1(d: Data, s: Any=s) -> str:
774
+ return d.GetAbsolutePathForStudy(s.Identifier, check_existence_from_root)
775
+
776
+ source_1: Array[ArcTable] = s.Tables
777
+ iterate(curry2(update_table)(f_1), source_1)
778
+ if s.Datamap is not None:
779
+ update_datamap(f_1, value_9(s.Datamap))
780
+
781
+
782
+ iterate(action_2, this.Studies)
783
+ def action_4(a_1: ArcAssay) -> None:
784
+ def f_2(d_1: Data, a_1: Any=a_1) -> str:
785
+ return d_1.GetAbsolutePathForAssay(a_1.Identifier, check_existence_from_root)
786
+
787
+ source_3: Array[ArcTable] = a_1.Tables
788
+ iterate(curry2(update_table)(f_2), source_3)
789
+ if a_1.Datamap is not None:
790
+ update_datamap(f_2, value_9(a_1.Datamap))
791
+
792
+
793
+ iterate(action_4, this.Assays)
794
+
795
+ @staticmethod
796
+ def from_file_paths(file_paths: Array[str]) -> ARC:
797
+ fs: FileSystem = FileSystem.from_file_paths(file_paths)
798
+ return ARC(create_missing_identifier(), None, None, None, None, None, None, None, None, None, None, None, None, None, None, fs)
799
+
800
+ def SetFilePaths(self, file_paths: Array[str]) -> None:
801
+ this: ARC = self
802
+ tree: FileSystemTree = FileSystemTree.from_file_paths(file_paths)
803
+ this._fs = FileSystem(tree, this._fs.History)
804
+
805
+ def GetReadContracts(self, __unit: None=None) -> Array[Contract]:
806
+ this: ARC = self
807
+ return choose(try_isaread_contract_from_path, this._fs.Tree.ToFilePaths(), None)
808
+
809
+ def SetISAFromContracts(self, contracts: Array[Contract]) -> None:
810
+ this: ARC = self
811
+ investigation: ArcInvestigation = ARCAux_getArcInvestigationFromContracts(contracts)
812
+ ignore(set_investigation_identifier(investigation.Identifier, this))
813
+ this.Title = investigation.Title
814
+ this.Description = investigation.Description
815
+ this.SubmissionDate = investigation.SubmissionDate
816
+ this.PublicReleaseDate = investigation.PublicReleaseDate
817
+ this.OntologySourceReferences = investigation.OntologySourceReferences
818
+ this.Publications = investigation.Publications
819
+ this.Contacts = investigation.Contacts
820
+ this.Comments = investigation.Comments
821
+ this.Remarks = investigation.Remarks
822
+ this.RegisteredStudyIdentifiers = investigation.RegisteredStudyIdentifiers
823
+ def mapping(tuple: tuple[ArcStudy, FSharpList[ArcAssay]]) -> ArcStudy:
824
+ return tuple[0]
825
+
826
+ studies: Array[ArcStudy] = map(mapping, ARCAux_getArcStudiesFromContracts(contracts), None)
827
+ assays: Array[ArcAssay] = ARCAux_getArcAssaysFromContracts(contracts)
828
+ workflows: Array[ArcWorkflow] = ARCAux_getArcWorkflowsFromContracts(contracts)
829
+ runs: Array[ArcRun] = ARCAux_getArcRunsFromContracts(contracts)
830
+ license: License | None = ARCAux_getLicenseFromContracts(contracts)
831
+ cwl_by_path: Any = ARCAux_getCWLByPathFromContracts(contracts)
832
+ def try_get_cwlby_path(path: str) -> CWLProcessingUnit | None:
833
+ return ARCAux_tryGetCWLByPath(cwl_by_path, path)
834
+
835
+ def action(ai: str) -> None:
836
+ def predicate(a: ArcAssay, ai: Any=ai) -> bool:
837
+ return a.Identifier == ai
838
+
839
+ if not exists(predicate, assays):
840
+ this.DeleteAssay(ai)
841
+
842
+
843
+ iterate_1(action, this.AssayIdentifiers)
844
+ def action_1(si: str) -> None:
845
+ def predicate_1(s: ArcStudy, si: Any=si) -> bool:
846
+ return s.Identifier == si
847
+
848
+ if not exists(predicate_1, studies):
849
+ this.DeleteStudy(si)
850
+
851
+
852
+ iterate_1(action_1, this.StudyIdentifiers)
853
+ def action_2(study: ArcStudy) -> None:
854
+ def predicate_2(s_1: ArcStudy, study: Any=study) -> bool:
855
+ return s_1.Identifier == study.Identifier
856
+
857
+ registered_study_opt: ArcStudy | None = try_find(predicate_2, this.Studies)
858
+ if registered_study_opt is None:
859
+ this.AddStudy(study)
860
+
861
+ else:
862
+ registered_study: ArcStudy = registered_study_opt
863
+ registered_study.UpdateReferenceByStudyFile(study, True)
864
+
865
+ datamap: Datamap | None = ARCAux_getStudyDatamapFromContracts(study.Identifier, contracts)
866
+ if study.Datamap is None:
867
+ study.Datamap = datamap
868
+
869
+ study.StaticHash = study.GetLightHashCode() or 0
870
+
871
+ iterate_1(action_2, studies)
872
+ def action_3(assay: ArcAssay) -> None:
873
+ def predicate_3(a_1: ArcAssay, assay: Any=assay) -> bool:
874
+ return a_1.Identifier == assay.Identifier
875
+
876
+ registered_assay_opt: ArcAssay | None = try_find(predicate_3, this.Assays)
877
+ if registered_assay_opt is None:
878
+ this.AddAssay(assay)
879
+
880
+ else:
881
+ registered_assay: ArcAssay = registered_assay_opt
882
+ registered_assay.UpdateReferenceByAssayFile(assay, True)
883
+
884
+ def predicate_4(a_2: ArcAssay, assay: Any=assay) -> bool:
885
+ return a_2.Identifier == assay.Identifier
886
+
887
+ assay_1: ArcAssay = find(predicate_4, this.Assays)
888
+ updated_tables: ArcTables
889
+ array_6: Array[ArcStudy] = assay_1.StudiesRegisteredIn
890
+ def folder(tables: ArcTables, study_1: ArcStudy, assay: Any=assay) -> ArcTables:
891
+ return ArcTables.update_reference_tables_by_sheets(ArcTables(study_1.Tables), tables, False)
892
+
893
+ updated_tables = fold(folder, ArcTables(assay_1.Tables), array_6)
894
+ datamap_1: Datamap | None = ARCAux_getAssayDatamapFromContracts(assay_1.Identifier, contracts)
895
+ if assay_1.Datamap is None:
896
+ assay_1.Datamap = datamap_1
897
+
898
+ assay_1.Tables = updated_tables.Tables
899
+
900
+ iterate_1(action_3, assays)
901
+ def action_4(workflow: ArcWorkflow) -> None:
902
+ datamap_2: Datamap | None = ARCAux_getWorkflowDatamapFromContracts(workflow.Identifier, contracts)
903
+ cwl: CWLProcessingUnit | None = ARCAux_getWorkflowCWLFromContracts(workflow.Identifier, contracts)
904
+ cwl_file_path: str = Workflow_cwlFileNameFromIdentifier(workflow.Identifier)
905
+ def mapping_1(processing_unit: CWLProcessingUnit, workflow: Any=workflow) -> CWLProcessingUnit:
906
+ return resolve_run_references_from_lookup(cwl_file_path, processing_unit, try_get_cwlby_path)
907
+
908
+ resolved_cwl: CWLProcessingUnit | None = map_1(mapping_1, cwl)
909
+ if workflow.Datamap is None:
910
+ workflow.Datamap = datamap_2
911
+
912
+ workflow.CWLDescription = resolved_cwl
913
+ this.AddWorkflow(workflow)
914
+ workflow.StaticHash = workflow.GetLightHashCode() or 0
915
+
916
+ iterate_1(action_4, workflows)
917
+ def action_5(run: ArcRun) -> None:
918
+ datamap_3: Datamap | None = ARCAux_getRunDatamapFromContracts(run.Identifier, contracts)
919
+ cwl_1: CWLProcessingUnit | None = ARCAux_getRunCWLFromContracts(run.Identifier, contracts)
920
+ yml: Array[CWLParameterReference] | None = ARCAux_getRunYMLFromContracts(run.Identifier, contracts)
921
+ cwl_file_path_1: str = Run_cwlFileNameFromIdentifier(run.Identifier)
922
+ def mapping_2(processing_unit_1: CWLProcessingUnit, run: Any=run) -> CWLProcessingUnit:
923
+ return resolve_run_references_from_lookup(cwl_file_path_1, processing_unit_1, try_get_cwlby_path)
924
+
925
+ resolved_cwl_1: CWLProcessingUnit | None = map_1(mapping_2, cwl_1)
926
+ if run.Datamap is None:
927
+ run.Datamap = datamap_3
928
+
929
+ run.CWLInput = default_arg(yml, [])
930
+ run.CWLDescription = resolved_cwl_1
931
+ this.AddRun(run)
932
+ run.StaticHash = run.GetLightHashCode() or 0
933
+
934
+ iterate_1(action_5, runs)
935
+ def action_6(a_3: ArcAssay) -> None:
936
+ a_3.StaticHash = a_3.GetLightHashCode() or 0
937
+
938
+ iterate(action_6, this.Assays)
939
+ def action_7(s_2: ArcStudy) -> None:
940
+ s_2.StaticHash = s_2.GetLightHashCode() or 0
941
+
942
+ iterate(action_7, this.Studies)
943
+ this.License = license
944
+ this.StaticHash = this.GetLightHashCode() or 0
945
+
946
+ def UpdateFileSystem(self, __unit: None=None) -> None:
947
+ this: ARC = self
948
+ new_fs: FileSystem = ARCAux_updateFSByARC(this, this._license, this._fs)
949
+ this._fs = new_fs
950
+
951
+ def GetWriteContracts(self, skip_update_fs: bool | None=None) -> Array[Contract]:
952
+ this: ARC = self
953
+ if not default_arg(skip_update_fs, False):
954
+ this.UpdateFileSystem()
955
+
956
+ filemap: Any = dict([])
957
+ add_to_dict(filemap, "isa.investigation.xlsx", (DTOType(4), DTO(0, ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF(this))))
958
+ this.StaticHash = this.GetLightHashCode() or 0
959
+ def action(s: ArcStudy) -> None:
960
+ s.StaticHash = s.GetLightHashCode() or 0
961
+ add_to_dict(filemap, Study_fileNameFromIdentifier(s.Identifier), (DTOType(1), DTO(0, ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(s))))
962
+ if s.Datamap is not None:
963
+ dm: Datamap = value_9(s.Datamap)
964
+ dm.StaticHash = safe_hash(dm) or 0
965
+ add_to_dict(filemap, Study_datamapFileNameFromIdentifier(s.Identifier), (DTOType(5), DTO(0, to_fs_workbook(dm))))
966
+
967
+
968
+ iterate(action, this.Studies)
969
+ def action_1(a: ArcAssay) -> None:
970
+ a.StaticHash = a.GetLightHashCode() or 0
971
+ add_to_dict(filemap, Assay_fileNameFromIdentifier(a.Identifier), (DTOType(0), DTO(0, ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F(a))))
972
+ if a.Datamap is not None:
973
+ dm_1: Datamap = value_9(a.Datamap)
974
+ dm_1.StaticHash = safe_hash(dm_1) or 0
975
+ add_to_dict(filemap, Assay_datamapFileNameFromIdentifier(a.Identifier), (DTOType(5), DTO(0, to_fs_workbook(dm_1))))
976
+
977
+
978
+ iterate(action_1, this.Assays)
979
+ def action_2(w: ArcWorkflow) -> None:
980
+ w.StaticHash = w.GetLightHashCode() or 0
981
+ add_to_dict(filemap, Workflow_fileNameFromIdentifier(w.Identifier), (DTOType(2), DTO(0, ARCtrl_ArcWorkflow__ArcWorkflow_toFsWorkbook_Static_Z1C75CB0E(w))))
982
+ if w.CWLDescription is not None:
983
+ raise Exception("Not implemented yet: CWL description in ARC.GetWriteContracts")
984
+
985
+ if w.Datamap is not None:
986
+ dm_2: Datamap = value_9(w.Datamap)
987
+ dm_2.StaticHash = safe_hash(dm_2) or 0
988
+ add_to_dict(filemap, Workflow_datamapFileNameFromIdentifier(w.Identifier), (DTOType(5), DTO(0, to_fs_workbook(dm_2))))
989
+
990
+
991
+ iterate(action_2, this.Workflows)
992
+ def action_3(r: ArcRun) -> None:
993
+ r.StaticHash = r.GetLightHashCode() or 0
994
+ add_to_dict(filemap, Run_fileNameFromIdentifier(r.Identifier), (DTOType(3), DTO(0, ARCtrl_ArcRun__ArcRun_toFsWorkbook_Static_Z3EFAF6F8(r))))
995
+ if r.CWLDescription is not None:
996
+ raise Exception("Not implemented yet: CWL description in ARC.GetWriteContracts")
997
+
998
+ if len(r.CWLInput) > 0:
999
+ raise Exception("Not implemented yet: CWL YAML input in ARC.GetWriteContracts")
1000
+
1001
+ if r.Datamap is not None:
1002
+ dm_3: Datamap = value_9(r.Datamap)
1003
+ dm_3.StaticHash = safe_hash(dm_3) or 0
1004
+ add_to_dict(filemap, Run_datamapFileNameFromIdentifier(r.Identifier), (DTOType(5), DTO(0, to_fs_workbook(dm_3))))
1005
+
1006
+
1007
+ iterate(action_3, this.Runs)
1008
+ match_value: License | None = this.License
1009
+ if match_value is None:
1010
+ pass
1011
+
1012
+ else:
1013
+ l: License = match_value
1014
+ match_value_1: str = l.Type
1015
+ l.StaticHash = safe_hash(l) or 0
1016
+ add_to_dict(filemap, l.Path, (DTOType(10), DTO(1, l.Content)))
1017
+
1018
+ def mapping(fp: str) -> Contract:
1019
+ match_value_2: tuple[DTOType, DTO] | None = Dictionary_tryGet(fp, filemap)
1020
+ if match_value_2 is None:
1021
+ return Contract.create_create(fp, DTOType(10))
1022
+
1023
+ else:
1024
+ wb: DTO = match_value_2[1]
1025
+ dto: DTOType = match_value_2[0]
1026
+ return Contract.create_create(fp, dto, wb)
1027
+
1028
+
1029
+ return map(mapping, this._fs.Tree.ToFilePaths(True), None)
1030
+
1031
+ def GetUpdateContracts(self, skip_update_fs: bool | None=None) -> Array[Contract]:
1032
+ this: ARC = self
1033
+ if this.StaticHash == 0:
1034
+ this.StaticHash = this.GetLightHashCode() or 0
1035
+ return this.GetWriteContracts(skip_update_fs)
1036
+
1037
+ else:
1038
+ def _arrow4621(__unit: None=None) -> IEnumerable_1[Contract]:
1039
+ hash_1: int = this.GetLightHashCode() or 0
1040
+ def _arrow4620(__unit: None=None) -> IEnumerable_1[Contract]:
1041
+ this.StaticHash = hash_1 or 0
1042
+ def _arrow4596(s: ArcStudy) -> IEnumerable_1[Contract]:
1043
+ hash_2: int = s.GetLightHashCode() or 0
1044
+ def _arrow4595(__unit: None=None) -> IEnumerable_1[Contract]:
1045
+ s.StaticHash = hash_2 or 0
1046
+ match_value: Datamap | None = s.Datamap
1047
+ (pattern_matching_result, dm_2, dm_3) = (None, None, None)
1048
+ if match_value is not None:
1049
+ def _arrow4593(__unit: None=None) -> bool:
1050
+ dm: Datamap = match_value
1051
+ return dm.StaticHash == 0
1052
+
1053
+ if _arrow4593():
1054
+ pattern_matching_result = 0
1055
+ dm_2 = match_value
1056
+
1057
+ else:
1058
+ def _arrow4594(__unit: None=None) -> bool:
1059
+ dm_1: Datamap = match_value
1060
+ return dm_1.StaticHash != safe_hash(dm_1)
1061
+
1062
+ if _arrow4594():
1063
+ pattern_matching_result = 1
1064
+ dm_3 = match_value
1065
+
1066
+ else:
1067
+ pattern_matching_result = 2
1068
+
1069
+
1070
+
1071
+ else:
1072
+ pattern_matching_result = 2
1073
+
1074
+ if pattern_matching_result == 0:
1075
+ def _arrow4591(__unit: None=None) -> IEnumerable_1[Contract]:
1076
+ dm_2.StaticHash = safe_hash(dm_2) or 0
1077
+ return empty()
1078
+
1079
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToCreateContractForStudy_Z721C83C5(dm_2, s.Identifier)), delay(_arrow4591))
1080
+
1081
+ elif pattern_matching_result == 1:
1082
+ def _arrow4592(__unit: None=None) -> IEnumerable_1[Contract]:
1083
+ dm_3.StaticHash = safe_hash(dm_3) or 0
1084
+ return empty()
1085
+
1086
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToUpdateContractForStudy_Z721C83C5(dm_3, s.Identifier)), delay(_arrow4592))
1087
+
1088
+ elif pattern_matching_result == 2:
1089
+ return empty()
1090
+
1091
+
1092
+ return append(ARCtrl_ArcStudy__ArcStudy_ToCreateContract_6FCE9E49(s, True) if (s.StaticHash == 0) else (singleton_1(ARCtrl_ArcStudy__ArcStudy_ToUpdateContract(s)) if (s.StaticHash != hash_2) else empty()), delay(_arrow4595))
1093
+
1094
+ def _arrow4619(__unit: None=None) -> IEnumerable_1[Contract]:
1095
+ def _arrow4602(a: ArcAssay) -> IEnumerable_1[Contract]:
1096
+ hash_3: int = a.GetLightHashCode() or 0
1097
+ def _arrow4601(__unit: None=None) -> IEnumerable_1[Contract]:
1098
+ a.StaticHash = hash_3 or 0
1099
+ match_value_1: Datamap | None = a.Datamap
1100
+ (pattern_matching_result_1, dm_6, dm_7) = (None, None, None)
1101
+ if match_value_1 is not None:
1102
+ def _arrow4599(__unit: None=None) -> bool:
1103
+ dm_4: Datamap = match_value_1
1104
+ return dm_4.StaticHash == 0
1105
+
1106
+ if _arrow4599():
1107
+ pattern_matching_result_1 = 0
1108
+ dm_6 = match_value_1
1109
+
1110
+ else:
1111
+ def _arrow4600(__unit: None=None) -> bool:
1112
+ dm_5: Datamap = match_value_1
1113
+ return dm_5.StaticHash != safe_hash(dm_5)
1114
+
1115
+ if _arrow4600():
1116
+ pattern_matching_result_1 = 1
1117
+ dm_7 = match_value_1
1118
+
1119
+ else:
1120
+ pattern_matching_result_1 = 2
1121
+
1122
+
1123
+
1124
+ else:
1125
+ pattern_matching_result_1 = 2
1126
+
1127
+ if pattern_matching_result_1 == 0:
1128
+ def _arrow4597(__unit: None=None) -> IEnumerable_1[Contract]:
1129
+ dm_6.StaticHash = safe_hash(dm_6) or 0
1130
+ return empty()
1131
+
1132
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToCreateContractForAssay_Z721C83C5(dm_6, a.Identifier)), delay(_arrow4597))
1133
+
1134
+ elif pattern_matching_result_1 == 1:
1135
+ def _arrow4598(__unit: None=None) -> IEnumerable_1[Contract]:
1136
+ dm_7.StaticHash = safe_hash(dm_7) or 0
1137
+ return empty()
1138
+
1139
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToUpdateContractForAssay_Z721C83C5(dm_7, a.Identifier)), delay(_arrow4598))
1140
+
1141
+ elif pattern_matching_result_1 == 2:
1142
+ return empty()
1143
+
1144
+
1145
+ return append(ARCtrl_ArcAssay__ArcAssay_ToCreateContract_6FCE9E49(a, True) if (a.StaticHash == 0) else (singleton_1(ARCtrl_ArcAssay__ArcAssay_ToUpdateContract(a)) if (a.StaticHash != hash_3) else empty()), delay(_arrow4601))
1146
+
1147
+ def _arrow4618(__unit: None=None) -> IEnumerable_1[Contract]:
1148
+ def _arrow4608(w: ArcWorkflow) -> IEnumerable_1[Contract]:
1149
+ hash_4: int = w.GetLightHashCode() or 0
1150
+ def _arrow4607(__unit: None=None) -> IEnumerable_1[Contract]:
1151
+ w.StaticHash = hash_4 or 0
1152
+ match_value_2: Datamap | None = w.Datamap
1153
+ (pattern_matching_result_2, dm_10, dm_11) = (None, None, None)
1154
+ if match_value_2 is not None:
1155
+ def _arrow4605(__unit: None=None) -> bool:
1156
+ dm_8: Datamap = match_value_2
1157
+ return dm_8.StaticHash == 0
1158
+
1159
+ if _arrow4605():
1160
+ pattern_matching_result_2 = 0
1161
+ dm_10 = match_value_2
1162
+
1163
+ else:
1164
+ def _arrow4606(__unit: None=None) -> bool:
1165
+ dm_9: Datamap = match_value_2
1166
+ return dm_9.StaticHash != safe_hash(dm_9)
1167
+
1168
+ if _arrow4606():
1169
+ pattern_matching_result_2 = 1
1170
+ dm_11 = match_value_2
1171
+
1172
+ else:
1173
+ pattern_matching_result_2 = 2
1174
+
1175
+
1176
+
1177
+ else:
1178
+ pattern_matching_result_2 = 2
1179
+
1180
+ if pattern_matching_result_2 == 0:
1181
+ def _arrow4603(__unit: None=None) -> IEnumerable_1[Contract]:
1182
+ dm_10.StaticHash = safe_hash(dm_10) or 0
1183
+ return empty()
1184
+
1185
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToCreateContractForWorkflow_Z721C83C5(dm_10, w.Identifier)), delay(_arrow4603))
1186
+
1187
+ elif pattern_matching_result_2 == 1:
1188
+ def _arrow4604(__unit: None=None) -> IEnumerable_1[Contract]:
1189
+ dm_11.StaticHash = safe_hash(dm_11) or 0
1190
+ return empty()
1191
+
1192
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToUpdateContractForWorkflow_Z721C83C5(dm_11, w.Identifier)), delay(_arrow4604))
1193
+
1194
+ elif pattern_matching_result_2 == 2:
1195
+ return empty()
1196
+
1197
+
1198
+ return append(ARCtrl_ArcWorkflow__ArcWorkflow_ToCreateContract_6FCE9E49(w, True) if (w.StaticHash == 0) else (singleton_1(ARCtrl_ArcWorkflow__ArcWorkflow_ToUpdateContract(w)) if (w.StaticHash != hash_4) else empty()), delay(_arrow4607))
1199
+
1200
+ def _arrow4617(__unit: None=None) -> IEnumerable_1[Contract]:
1201
+ def _arrow4614(r: ArcRun) -> IEnumerable_1[Contract]:
1202
+ hash_5: int = r.GetLightHashCode() or 0
1203
+ def _arrow4613(__unit: None=None) -> IEnumerable_1[Contract]:
1204
+ r.StaticHash = hash_5 or 0
1205
+ match_value_3: Datamap | None = r.Datamap
1206
+ (pattern_matching_result_3, dm_14, dm_15) = (None, None, None)
1207
+ if match_value_3 is not None:
1208
+ def _arrow4611(__unit: None=None) -> bool:
1209
+ dm_12: Datamap = match_value_3
1210
+ return dm_12.StaticHash == 0
1211
+
1212
+ if _arrow4611():
1213
+ pattern_matching_result_3 = 0
1214
+ dm_14 = match_value_3
1215
+
1216
+ else:
1217
+ def _arrow4612(__unit: None=None) -> bool:
1218
+ dm_13: Datamap = match_value_3
1219
+ return dm_13.StaticHash != safe_hash(dm_13)
1220
+
1221
+ if _arrow4612():
1222
+ pattern_matching_result_3 = 1
1223
+ dm_15 = match_value_3
1224
+
1225
+ else:
1226
+ pattern_matching_result_3 = 2
1227
+
1228
+
1229
+
1230
+ else:
1231
+ pattern_matching_result_3 = 2
1232
+
1233
+ if pattern_matching_result_3 == 0:
1234
+ def _arrow4609(__unit: None=None) -> IEnumerable_1[Contract]:
1235
+ dm_14.StaticHash = safe_hash(dm_14) or 0
1236
+ return empty()
1237
+
1238
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToCreateContractForRun_Z721C83C5(dm_14, r.Identifier)), delay(_arrow4609))
1239
+
1240
+ elif pattern_matching_result_3 == 1:
1241
+ def _arrow4610(__unit: None=None) -> IEnumerable_1[Contract]:
1242
+ dm_15.StaticHash = safe_hash(dm_15) or 0
1243
+ return empty()
1244
+
1245
+ return append(singleton_1(ARCtrl_Datamap__Datamap_ToUpdateContractForRun_Z721C83C5(dm_15, r.Identifier)), delay(_arrow4610))
1246
+
1247
+ elif pattern_matching_result_3 == 2:
1248
+ return empty()
1249
+
1250
+
1251
+ return append(ARCtrl_ArcRun__ArcRun_ToCreateContract_6FCE9E49(r, True) if (r.StaticHash == 0) else (singleton_1(ARCtrl_ArcRun__ArcRun_ToUpdateContract(r)) if (r.StaticHash != hash_5) else empty()), delay(_arrow4613))
1252
+
1253
+ def _arrow4616(__unit: None=None) -> IEnumerable_1[Contract]:
1254
+ match_value_4: License | None = this.License
1255
+ if match_value_4 is None:
1256
+ return empty()
1257
+
1258
+ else:
1259
+ l: License = match_value_4
1260
+ hash_6: int = safe_hash(l) or 0
1261
+ def _arrow4615(__unit: None=None) -> IEnumerable_1[Contract]:
1262
+ l.StaticHash = hash_6 or 0
1263
+ return empty()
1264
+
1265
+ return append(singleton_1(l.ToCreateContract()) if (l.StaticHash == 0) else (singleton_1(l.ToUpdateContract()) if (l.StaticHash != hash_6) else empty()), delay(_arrow4615))
1266
+
1267
+
1268
+ return append(collect(_arrow4614, this.Runs), delay(_arrow4616))
1269
+
1270
+ return append(collect(_arrow4608, this.Workflows), delay(_arrow4617))
1271
+
1272
+ return append(collect(_arrow4602, this.Assays), delay(_arrow4618))
1273
+
1274
+ return append(collect(_arrow4596, this.Studies), delay(_arrow4619))
1275
+
1276
+ return append(singleton_1(ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(this)) if (this.StaticHash != hash_1) else empty(), delay(_arrow4620))
1277
+
1278
+ return to_array(delay(_arrow4621))
1279
+
1280
+
1281
+ def GetGitInitContracts(self, branch: str | None=None, repository_address: str | None=None, default_gitignore: bool | None=None, default_gitattributes: bool | None=None) -> Array[Contract]:
1282
+ default_gitignore_1: bool = default_arg(default_gitignore, False)
1283
+ default_gitattributes_1: bool = default_arg(default_gitattributes, False)
1284
+ def _arrow4625(__unit: None=None) -> IEnumerable_1[Contract]:
1285
+ def _arrow4624(__unit: None=None) -> IEnumerable_1[Contract]:
1286
+ def _arrow4623(__unit: None=None) -> IEnumerable_1[Contract]:
1287
+ def _arrow4622(__unit: None=None) -> IEnumerable_1[Contract]:
1288
+ return singleton_1(Init_createAddRemoteContract_Z721C83C5(value_9(repository_address))) if (repository_address is not None) else empty()
1289
+
1290
+ return append(singleton_1(gitattributes_contract) if default_gitattributes_1 else empty(), delay(_arrow4622))
1291
+
1292
+ return append(singleton_1(gitignore_contract) if default_gitignore_1 else empty(), delay(_arrow4623))
1293
+
1294
+ return append(singleton_1(Init_createInitContract_6DFDD678(branch)), delay(_arrow4624))
1295
+
1296
+ return to_array(delay(_arrow4625))
1297
+
1298
+ @staticmethod
1299
+ def get_clone_contract(remote_url: str, merge: bool | None=None, branch: str | None=None, token: tuple[str, str] | None=None, nolfs: bool | None=None) -> Contract:
1300
+ return Clone_createCloneContract_5000466F(remote_url, merge, branch, token, nolfs)
1301
+
1302
+ def Copy(self, __unit: None=None) -> ARC:
1303
+ this: ARC = self
1304
+ next_assays: Array[ArcAssay] = []
1305
+ next_studies: Array[ArcStudy] = []
1306
+ next_workflows: Array[ArcWorkflow] = []
1307
+ next_runs: Array[ArcRun] = []
1308
+ enumerator: Any = get_enumerator(this.Assays)
1309
+ try:
1310
+ while enumerator.System_Collections_IEnumerator_MoveNext():
1311
+ assay: ArcAssay = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
1312
+ copy: ArcAssay = assay.Copy()
1313
+ (next_assays.append(copy))
1314
+
1315
+ finally:
1316
+ dispose(enumerator)
1317
+
1318
+ enumerator_1: Any = get_enumerator(this.Studies)
1319
+ try:
1320
+ while enumerator_1.System_Collections_IEnumerator_MoveNext():
1321
+ study: ArcStudy = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
1322
+ copy_1: ArcStudy = study.Copy()
1323
+ (next_studies.append(copy_1))
1324
+
1325
+ finally:
1326
+ dispose(enumerator_1)
1327
+
1328
+ enumerator_2: Any = get_enumerator(this.Workflows)
1329
+ try:
1330
+ while enumerator_2.System_Collections_IEnumerator_MoveNext():
1331
+ workflow: ArcWorkflow = enumerator_2.System_Collections_Generic_IEnumerator_1_get_Current()
1332
+ copy_2: ArcWorkflow = workflow.Copy()
1333
+ (next_workflows.append(copy_2))
1334
+
1335
+ finally:
1336
+ dispose(enumerator_2)
1337
+
1338
+ enumerator_3: Any = get_enumerator(this.Runs)
1339
+ try:
1340
+ while enumerator_3.System_Collections_IEnumerator_MoveNext():
1341
+ run: ArcRun = enumerator_3.System_Collections_Generic_IEnumerator_1_get_Current()
1342
+ copy_3: ArcRun = run.Copy()
1343
+ (next_runs.append(copy_3))
1344
+
1345
+ finally:
1346
+ dispose(enumerator_3)
1347
+
1348
+ def f(c: Comment) -> Comment:
1349
+ return c.Copy()
1350
+
1351
+ next_comments: Array[Comment] = ResizeArray_map(f, this.Comments)
1352
+ def f_1(c_1: Remark) -> Remark:
1353
+ return c_1.Copy()
1354
+
1355
+ next_remarks: Array[Remark] = ResizeArray_map(f_1, this.Remarks)
1356
+ def f_2(c_2: Person) -> Person:
1357
+ return c_2.Copy()
1358
+
1359
+ next_contacts: Array[Person] = ResizeArray_map(f_2, this.Contacts)
1360
+ def f_3(c_3: Publication) -> Publication:
1361
+ return c_3.Copy()
1362
+
1363
+ next_publications: Array[Publication] = ResizeArray_map(f_3, this.Publications)
1364
+ def f_4(c_4: OntologySourceReference) -> OntologySourceReference:
1365
+ return c_4.Copy()
1366
+
1367
+ next_ontology_source_references: Array[OntologySourceReference] = ResizeArray_map(f_4, this.OntologySourceReferences)
1368
+ next_study_identifiers: Array[str] = list(this.RegisteredStudyIdentifiers)
1369
+ def mapping(_arg: License) -> License:
1370
+ return _arg.Copy()
1371
+
1372
+ next_license: License | None = map_1(mapping, this.License)
1373
+ fs_copy: FileSystem = this._fs.Copy()
1374
+ return ARC(this.Identifier, this.Title, this.Description, this.SubmissionDate, this.PublicReleaseDate, next_ontology_source_references, next_publications, next_contacts, next_assays, next_studies, next_workflows, next_runs, next_study_identifiers, next_comments, next_remarks, fs_copy, next_license)
1375
+
1376
+ def GetRegisteredPayload(self, IgnoreHidden: bool | None=None) -> FileSystemTree:
1377
+ this: ARC = self
1378
+ copy: ARC = this.Copy()
1379
+ registered_studies: Array[ArcStudy] = copy.Studies[:]
1380
+ def mapping(s: ArcStudy) -> Array[ArcAssay]:
1381
+ return s.RegisteredAssays[:]
1382
+
1383
+ registered_assays: Array[ArcAssay] = concat(map(mapping, registered_studies, None), None)
1384
+ def _arrow4628(__unit: None=None) -> IEnumerable_1[str]:
1385
+ def _arrow4627(__unit: None=None) -> IEnumerable_1[str]:
1386
+ def _arrow4626(__unit: None=None) -> IEnumerable_1[str]:
1387
+ return singleton_1(value_9(this.License).Path) if (this.License is not None) else empty()
1388
+
1389
+ return append(singleton_1("README.md"), delay(_arrow4626))
1390
+
1391
+ return append(singleton_1("isa.investigation.xlsx"), delay(_arrow4627))
1392
+
1393
+ class ObjectExpr4629:
1394
+ @property
1395
+ def Compare(self) -> Callable[[str, str], int]:
1396
+ return compare_primitives
1397
+
1398
+ def mapping_1(s_1: ArcStudy) -> Any:
1399
+ study_foldername: str = ((("" + "studies") + "/") + s_1.Identifier) + ""
1400
+ def _arrow4636(__unit: None=None, s_1: Any=s_1) -> IEnumerable_1[str]:
1401
+ def _arrow4635(__unit: None=None) -> IEnumerable_1[str]:
1402
+ def _arrow4634(__unit: None=None) -> IEnumerable_1[str]:
1403
+ def _arrow4633(table: ArcTable) -> IEnumerable_1[str]:
1404
+ def _arrow4632(kv: Any) -> IEnumerable_1[str]:
1405
+ text_value: str = kv[1].ToFreeTextCell().AsFreeText
1406
+ def _arrow4631(__unit: None=None) -> IEnumerable_1[str]:
1407
+ def _arrow4630(__unit: None=None) -> IEnumerable_1[str]:
1408
+ return singleton_1(((((("" + study_foldername) + "/") + "protocols") + "/") + text_value) + "")
1409
+
1410
+ return append(singleton_1(((((("" + study_foldername) + "/") + "resources") + "/") + text_value) + ""), delay(_arrow4630))
1411
+
1412
+ return append(singleton_1(text_value), delay(_arrow4631))
1413
+
1414
+ return collect(_arrow4632, table.Values)
1415
+
1416
+ return collect(_arrow4633, s_1.Tables)
1417
+
1418
+ return append(singleton_1(((("" + study_foldername) + "/") + "README.md") + ""), delay(_arrow4634))
1419
+
1420
+ return append(singleton_1(((("" + study_foldername) + "/") + "isa.study.xlsx") + ""), delay(_arrow4635))
1421
+
1422
+ class ObjectExpr4637:
1423
+ @property
1424
+ def Compare(self) -> Callable[[str, str], int]:
1425
+ return compare_primitives
1426
+
1427
+ return of_seq(to_list(delay(_arrow4636)), ObjectExpr4637())
1428
+
1429
+ class ObjectExpr4638:
1430
+ @property
1431
+ def Compare(self) -> Callable[[str, str], int]:
1432
+ return compare_primitives
1433
+
1434
+ def mapping_2(a: ArcAssay) -> Any:
1435
+ assay_foldername: str = ((("" + "assays") + "/") + a.Identifier) + ""
1436
+ def _arrow4645(__unit: None=None, a: Any=a) -> IEnumerable_1[str]:
1437
+ def _arrow4644(__unit: None=None) -> IEnumerable_1[str]:
1438
+ def _arrow4643(__unit: None=None) -> IEnumerable_1[str]:
1439
+ def _arrow4642(table_1: ArcTable) -> IEnumerable_1[str]:
1440
+ def _arrow4641(kv_1: Any) -> IEnumerable_1[str]:
1441
+ text_value_1: str = kv_1[1].ToFreeTextCell().AsFreeText
1442
+ def _arrow4640(__unit: None=None) -> IEnumerable_1[str]:
1443
+ def _arrow4639(__unit: None=None) -> IEnumerable_1[str]:
1444
+ return singleton_1(((((("" + assay_foldername) + "/") + "protocols") + "/") + text_value_1) + "")
1445
+
1446
+ return append(singleton_1(((((("" + assay_foldername) + "/") + "dataset") + "/") + text_value_1) + ""), delay(_arrow4639))
1447
+
1448
+ return append(singleton_1(text_value_1), delay(_arrow4640))
1449
+
1450
+ return collect(_arrow4641, table_1.Values)
1451
+
1452
+ return collect(_arrow4642, a.Tables)
1453
+
1454
+ return append(singleton_1(((("" + assay_foldername) + "/") + "README.md") + ""), delay(_arrow4643))
1455
+
1456
+ return append(singleton_1(((("" + assay_foldername) + "/") + "isa.assay.xlsx") + ""), delay(_arrow4644))
1457
+
1458
+ class ObjectExpr4646:
1459
+ @property
1460
+ def Compare(self) -> Callable[[str, str], int]:
1461
+ return compare_primitives
1462
+
1463
+ return of_seq(to_list(delay(_arrow4645)), ObjectExpr4646())
1464
+
1465
+ class ObjectExpr4647:
1466
+ @property
1467
+ def Compare(self) -> Callable[[str, str], int]:
1468
+ return compare_primitives
1469
+
1470
+ class ObjectExpr4648:
1471
+ @property
1472
+ def Compare(self) -> Callable[[str, str], int]:
1473
+ return compare_primitives
1474
+
1475
+ include_files: Any = union_many(to_enumerable([of_seq(to_list(delay(_arrow4628)), ObjectExpr4629()), union_many(map(mapping_1, registered_studies, None), ObjectExpr4638()), union_many(map(mapping_2, registered_assays, None), ObjectExpr4647())]), ObjectExpr4648())
1476
+ ignore_hidden: bool = default_arg(IgnoreHidden, True)
1477
+ fs_copy: FileSystem = this._fs.Copy()
1478
+ def binder(tree_1: FileSystemTree) -> FileSystemTree | None:
1479
+ if ignore_hidden:
1480
+ def _arrow4649(n_1: str, tree_1: Any=tree_1) -> bool:
1481
+ return not starts_with_exact(n_1, ".")
1482
+
1483
+ return FileSystemTree.filter_folders(_arrow4649)(tree_1)
1484
+
1485
+ else:
1486
+ return tree_1
1487
+
1488
+
1489
+ def _arrow4651(__unit: None=None) -> FileSystemTree | None:
1490
+ tree: FileSystemTree
1491
+ def predicate(p: str) -> bool:
1492
+ if True if starts_with_exact(p, "workflows") else starts_with_exact(p, "runs"):
1493
+ return True
1494
+
1495
+ else:
1496
+ return FSharpSet__Contains(include_files, p)
1497
+
1498
+
1499
+ paths: Array[str] = filter(predicate, FileSystemTree.to_file_paths()(fs_copy.Tree))
1500
+ tree = FileSystemTree.from_file_paths(paths)
1501
+ def _arrow4650(n: str) -> bool:
1502
+ return not starts_with_exact(n, ".")
1503
+
1504
+ return FileSystemTree.filter_files(_arrow4650)(tree) if ignore_hidden else tree
1505
+
1506
+ return default_arg(bind(binder, _arrow4651()), FileSystemTree.from_file_paths([]))
1507
+
1508
+ def GetAdditionalPayload(self, IgnoreHidden: bool | None=None) -> FileSystemTree:
1509
+ this: ARC = self
1510
+ ignore_hidden: bool = default_arg(IgnoreHidden, True)
1511
+ class ObjectExpr4652:
1512
+ @property
1513
+ def Compare(self) -> Callable[[str, str], int]:
1514
+ return compare_primitives
1515
+
1516
+ registered_payload: Any = of_seq(FileSystemTree.to_file_paths()(this.GetRegisteredPayload()), ObjectExpr4652())
1517
+ def binder(tree_1: FileSystemTree) -> FileSystemTree | None:
1518
+ if ignore_hidden:
1519
+ def _arrow4653(n_1: str, tree_1: Any=tree_1) -> bool:
1520
+ return not starts_with_exact(n_1, ".")
1521
+
1522
+ return FileSystemTree.filter_folders(_arrow4653)(tree_1)
1523
+
1524
+ else:
1525
+ return tree_1
1526
+
1527
+
1528
+ def _arrow4655(__unit: None=None) -> FileSystemTree | None:
1529
+ tree: FileSystemTree
1530
+ def predicate(p: str) -> bool:
1531
+ return not FSharpSet__Contains(registered_payload, p)
1532
+
1533
+ paths: Array[str] = filter(predicate, FileSystemTree.to_file_paths()(this._fs.Copy().Tree))
1534
+ tree = FileSystemTree.from_file_paths(paths)
1535
+ def _arrow4654(n: str) -> bool:
1536
+ return not starts_with_exact(n, ".")
1537
+
1538
+ return FileSystemTree.filter_files(_arrow4654)(tree) if ignore_hidden else tree
1539
+
1540
+ return default_arg(bind(binder, _arrow4655()), FileSystemTree.from_file_paths([]))
1541
+
1542
+ @staticmethod
1543
+ def DefaultContracts() -> Any:
1544
+ class ObjectExpr4656:
1545
+ @property
1546
+ def Compare(self) -> Callable[[str, str], int]:
1547
+ return compare_primitives
1548
+
1549
+ return of_seq_1(to_enumerable([(".gitignore", gitignore_contract), (".gitattributes", gitattributes_contract)]), ObjectExpr4656())
1550
+
1551
+ @staticmethod
1552
+ def from_deprecated_rocrate_json_string(s: str) -> ARC:
1553
+ try:
1554
+ s_1: str = replace(s, "bio:additionalProperty", "sdo:additionalProperty")
1555
+ isa: ArcInvestigation
1556
+ match_value: FSharpResult_2[ArcInvestigation, str] = Decode_fromString(ROCrate_get_decoderDeprecated(), s_1)
1557
+ if match_value.tag == 1:
1558
+ raise Exception(to_text(printf("Error decoding string: %O"))(match_value.fields[0]))
1559
+
1560
+ else:
1561
+ isa = match_value.fields[0]
1562
+
1563
+ return ARC.from_arc_investigation(isa)
1564
+
1565
+ except Exception as ex:
1566
+ arg_1: str = str(ex)
1567
+ return to_fail(printf("Could not parse deprecated ARC-RO-Crate metadata: \n%s"))(arg_1)
1568
+
1569
+
1570
+ @staticmethod
1571
+ def from_rocrate_json_string(s: str) -> ARC:
1572
+ try:
1573
+ pattern_input: tuple[ArcInvestigation, Array[str], License | None]
1574
+ match_value: FSharpResult_2[tuple[ArcInvestigation, Array[str], License | None], str] = Decode_fromString(ROCrate_get_decoder(), s)
1575
+ if match_value.tag == 1:
1576
+ raise Exception(to_text(printf("Error decoding string: %O"))(match_value.fields[0]))
1577
+
1578
+ else:
1579
+ pattern_input = match_value.fields[0]
1580
+
1581
+ file_system: FileSystem
1582
+ paths: Array[str] = list(pattern_input[1])
1583
+ file_system = FileSystem.from_file_paths(paths)
1584
+ return ARC.from_arc_investigation(pattern_input[0], file_system, pattern_input[2])
1585
+
1586
+ except Exception as ex:
1587
+ arg_1: str = str(ex)
1588
+ return to_fail(printf("Could not parse ARC-RO-Crate metadata: \n%s"))(arg_1)
1589
+
1590
+
1591
+ def ToROCrateJsonString(self, spaces: int | None=None, ignore_broken_wr: bool | None=None) -> str:
1592
+ this: ARC = self
1593
+ this.MakeDataFilesAbsolute()
1594
+ value: IEncodable = ROCrate_encoder_Z7FE34C43(this, this._license, this._fs, ignore_broken_wr)
1595
+ return to_string(default_spaces(spaces), value)
1596
+
1597
+ @staticmethod
1598
+ def to_rocrate_json_string(spaces: int | None=None, ignore_broken_wr: bool | None=None) -> Callable[[ARC], str]:
1599
+ def _arrow4657(obj: ARC) -> str:
1600
+ return obj.ToROCrateJsonString(spaces, ignore_broken_wr)
1601
+
1602
+ return _arrow4657
1603
+
1604
+ def GetLicenseWriteContract(self, __unit: None=None) -> Contract:
1605
+ this: ARC = self
1606
+ def def_thunk(__unit: None=None) -> License:
1607
+ return License.GetDefaultLicense()
1608
+
1609
+ _arg: License = default_arg_with(this.License, def_thunk)
1610
+ return _arg.ToCreateContract()
1611
+
1612
+ def GetValidationPackagesConfigWriteContract(self, vpc: ValidationPackagesConfig) -> Contract:
1613
+ this: ARC = self
1614
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
1615
+ class ObjectExpr4659:
1616
+ @property
1617
+ def Equals(self) -> Callable[[str, str], bool]:
1618
+ def _arrow4658(x: str, y: str) -> bool:
1619
+ return x == y
1620
+
1621
+ return _arrow4658
1622
+
1623
+ @property
1624
+ def GetHashCode(self) -> Callable[[str], int]:
1625
+ return string_hash
1626
+
1627
+ if not contains_2(ValidationPackagesConfigHelper_ConfigFilePath, paths, ObjectExpr4659()):
1628
+ file_paths: Array[str] = append_1([ValidationPackagesConfigHelper_ConfigFilePath], paths, None)
1629
+ this.SetFilePaths(file_paths)
1630
+
1631
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toCreateContract_Static_724DAE55(vpc)
1632
+
1633
+ def GetValidationPackagesConfigDeleteContract(self, vpc: ValidationPackagesConfig) -> Contract:
1634
+ this: ARC = self
1635
+ paths: Array[str] = this.FileSystem.Tree.ToFilePaths()
1636
+ class ObjectExpr4661:
1637
+ @property
1638
+ def Equals(self) -> Callable[[str, str], bool]:
1639
+ def _arrow4660(x: str, y: str) -> bool:
1640
+ return x == y
1641
+
1642
+ return _arrow4660
1643
+
1644
+ @property
1645
+ def GetHashCode(self) -> Callable[[str], int]:
1646
+ return string_hash
1647
+
1648
+ if contains_2(ValidationPackagesConfigHelper_ConfigFilePath, paths, ObjectExpr4661()):
1649
+ def predicate(p: str) -> bool:
1650
+ return not (p == ValidationPackagesConfigHelper_ConfigFilePath)
1651
+
1652
+ file_paths: Array[str] = filter(predicate, paths)
1653
+ this.SetFilePaths(file_paths)
1654
+
1655
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toDeleteContract_Static_724DAE55(vpc)
1656
+
1657
+ def GetValidationPackagesConfigReadContract(self, __unit: None=None) -> Contract:
1658
+ return ValidationPackagesConfigHelper_ReadContract
1659
+
1660
+ def GetValidationPackagesConfigFromReadContract(self, contract: Contract) -> ValidationPackagesConfig | None:
1661
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_tryFromReadContract_Static_7570923F(contract)
1662
+
1663
+ def ToFilePaths(self, remove_root: bool | None=None, skip_update_fs: bool | None=None) -> Array[str]:
1664
+ this: ARC = self
1665
+ if not default_arg(skip_update_fs, False):
1666
+ this.UpdateFileSystem()
1667
+
1668
+ return this.FileSystem.Tree.ToFilePaths(remove_root)
1669
+
1670
+ def BuildWorkflowGraphs(self, __unit: None=None) -> Array[tuple[str, FSharpResult_2[WorkflowGraph, GraphBuildIssue]]]:
1671
+ this: ARC = self
1672
+ return of_investigation(this).WorkflowGraphs
1673
+
1674
+ def BuildRunGraphs(self, __unit: None=None) -> Array[tuple[str, FSharpResult_2[WorkflowGraph, GraphBuildIssue]]]:
1675
+ this: ARC = self
1676
+ return of_investigation(this).RunGraphs
1677
+
1678
+ def BuildAllProcessingUnitGraphs(self, __unit: None=None) -> WorkflowGraphIndex:
1679
+ this: ARC = self
1680
+ return of_investigation(this)
1681
+
1682
+
1683
+ ARC_reflection = _expr4663
1684
+
1685
+ def ARC__ctor_Z443FB9BF(identifier: str, title: str | None=None, description: str | None=None, submission_date: str | None=None, public_release_date: str | None=None, ontology_source_references: Array[OntologySourceReference] | None=None, publications: Array[Publication] | None=None, contacts: Array[Person] | None=None, assays: Array[ArcAssay] | None=None, studies: Array[ArcStudy] | None=None, workflows: Array[ArcWorkflow] | None=None, runs: Array[ArcRun] | None=None, registered_study_identifiers: Array[str] | None=None, comments: Array[Comment] | None=None, remarks: Array[Remark] | None=None, fs: FileSystem | None=None, license: License | None=None) -> ARC:
1686
+ return ARC(identifier, title, description, submission_date, public_release_date, ontology_source_references, publications, contacts, assays, studies, workflows, runs, registered_study_identifiers, comments, remarks, fs, license)
1687
+
1688
+
1689
+ def ARCAux_getArcAssaysFromContracts(contracts: Array[Contract]) -> Array[ArcAssay]:
1690
+ def chooser(c: Contract, contracts: Any=contracts) -> ArcAssay | None:
1691
+ return ARCtrl_ArcAssay__ArcAssay_tryFromReadContract_Static_7570923F(c)
1692
+
1693
+ return choose(chooser, contracts, None)
1694
+
1695
+
1696
+ def ARCAux_getArcStudiesFromContracts(contracts: Array[Contract]) -> Array[tuple[ArcStudy, FSharpList[ArcAssay]]]:
1697
+ def chooser(c: Contract, contracts: Any=contracts) -> tuple[ArcStudy, FSharpList[ArcAssay]] | None:
1698
+ return ARCtrl_ArcStudy__ArcStudy_tryFromReadContract_Static_7570923F(c)
1699
+
1700
+ return choose(chooser, contracts, None)
1701
+
1702
+
1703
+ def ARCAux_getArcWorkflowsFromContracts(contracts: Array[Contract]) -> Array[ArcWorkflow]:
1704
+ def chooser(c: Contract, contracts: Any=contracts) -> ArcWorkflow | None:
1705
+ return ARCtrl_ArcWorkflow__ArcWorkflow_tryFromReadContract_Static_7570923F(c)
1706
+
1707
+ return choose(chooser, contracts, None)
1708
+
1709
+
1710
+ def ARCAux_getArcRunsFromContracts(contracts: Array[Contract]) -> Array[ArcRun]:
1711
+ def chooser(c: Contract, contracts: Any=contracts) -> ArcRun | None:
1712
+ return ARCtrl_ArcRun__ArcRun_tryFromReadContract_Static_7570923F(c)
1713
+
1714
+ return choose(chooser, contracts, None)
1715
+
1716
+
1717
+ def ARCAux_getAssayDatamapFromContracts(assay_identifier: str, contracts: Array[Contract]) -> Datamap | None:
1718
+ def chooser(c: Contract, assay_identifier: Any=assay_identifier, contracts: Any=contracts) -> Datamap | None:
1719
+ return ARCtrl_Datamap__Datamap_tryFromReadContractForAssay_Static(assay_identifier, c)
1720
+
1721
+ return try_pick(chooser, contracts)
1722
+
1723
+
1724
+ def ARCAux_getStudyDatamapFromContracts(study_identifier: str, contracts: Array[Contract]) -> Datamap | None:
1725
+ def chooser(c: Contract, study_identifier: Any=study_identifier, contracts: Any=contracts) -> Datamap | None:
1726
+ return ARCtrl_Datamap__Datamap_tryFromReadContractForStudy_Static(study_identifier, c)
1727
+
1728
+ return try_pick(chooser, contracts)
1729
+
1730
+
1731
+ def ARCAux_getWorkflowDatamapFromContracts(workflow_identifier: str, contracts: Array[Contract]) -> Datamap | None:
1732
+ def chooser(c: Contract, workflow_identifier: Any=workflow_identifier, contracts: Any=contracts) -> Datamap | None:
1733
+ return ARCtrl_Datamap__Datamap_tryFromReadContractForWorkflow_Static(workflow_identifier, c)
1734
+
1735
+ return try_pick(chooser, contracts)
1736
+
1737
+
1738
+ def ARCAux_getRunDatamapFromContracts(run_identifier: str, contracts: Array[Contract]) -> Datamap | None:
1739
+ def chooser(c: Contract, run_identifier: Any=run_identifier, contracts: Any=contracts) -> Datamap | None:
1740
+ return ARCtrl_Datamap__Datamap_tryFromReadContractForRun_Static(run_identifier, c)
1741
+
1742
+ return try_pick(chooser, contracts)
1743
+
1744
+
1745
+ def ARCAux_getWorkflowCWLFromContracts(workflow_identifier: str, contracts: Array[Contract]) -> CWLProcessingUnit | None:
1746
+ def chooser(c: Contract, workflow_identifier: Any=workflow_identifier, contracts: Any=contracts) -> CWLProcessingUnit | None:
1747
+ return ARCtrl_ArcWorkflow__ArcWorkflow_tryCWLFromReadContract_Static(workflow_identifier, c)
1748
+
1749
+ return try_pick(chooser, contracts)
1750
+
1751
+
1752
+ def ARCAux_getRunCWLFromContracts(run_identifier: str, contracts: Array[Contract]) -> CWLProcessingUnit | None:
1753
+ def chooser(c: Contract, run_identifier: Any=run_identifier, contracts: Any=contracts) -> CWLProcessingUnit | None:
1754
+ return ARCtrl_ArcRun__ArcRun_tryCWLFromReadContract_Static(run_identifier, c)
1755
+
1756
+ return try_pick(chooser, contracts)
1757
+
1758
+
1759
+ def ARCAux_getRunYMLFromContracts(run_identifier: str, contracts: Array[Contract]) -> Array[CWLParameterReference] | None:
1760
+ def chooser(c: Contract, run_identifier: Any=run_identifier, contracts: Any=contracts) -> Array[CWLParameterReference] | None:
1761
+ return ARCtrl_ArcRun__ArcRun_tryYMLFromReadContract_Static(run_identifier, c)
1762
+
1763
+ return try_pick(chooser, contracts)
1764
+
1765
+
1766
+ def ARCAux_getCWLByPathFromContracts(contracts: Array[Contract]) -> Any:
1767
+ def chooser(c: Contract, contracts: Any=contracts) -> tuple[str, CWLProcessingUnit] | None:
1768
+ (pattern_matching_result, text) = (None, None)
1769
+ if c.Operation == "READ":
1770
+ if c.DTOType is not None:
1771
+ if c.DTOType.tag == 8:
1772
+ if c.DTO is not None:
1773
+ if c.DTO.tag == 1:
1774
+ pattern_matching_result = 0
1775
+ text = c.DTO.fields[0]
1776
+
1777
+ else:
1778
+ pattern_matching_result = 1
1779
+
1780
+
1781
+ else:
1782
+ pattern_matching_result = 1
1783
+
1784
+
1785
+ else:
1786
+ pattern_matching_result = 1
1787
+
1788
+
1789
+ else:
1790
+ pattern_matching_result = 1
1791
+
1792
+
1793
+ else:
1794
+ pattern_matching_result = 1
1795
+
1796
+ if pattern_matching_result == 0:
1797
+ cwl: CWLProcessingUnit = Decode_decodeCWLProcessingUnit(text)
1798
+ return (normalize_path_key(c.Path), cwl)
1799
+
1800
+ elif pattern_matching_result == 1:
1801
+ return None
1802
+
1803
+
1804
+ class ObjectExpr4664:
1805
+ @property
1806
+ def Compare(self) -> Callable[[str, str], int]:
1807
+ return compare_primitives
1808
+
1809
+ return of_array(choose(chooser, contracts, None), ObjectExpr4664())
1810
+
1811
+
1812
+ def ARCAux_tryGetCWLByPath(cwl_by_path: Any, path: str) -> CWLProcessingUnit | None:
1813
+ return try_find_1(normalize_path_key(path), cwl_by_path)
1814
+
1815
+
1816
+ def ARCAux_getArcInvestigationFromContracts(contracts: Array[Contract]) -> ArcInvestigation:
1817
+ def chooser(c: Contract, contracts: Any=contracts) -> ArcInvestigation | None:
1818
+ return ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F(c)
1819
+
1820
+ match_value: Array[ArcInvestigation] = choose(chooser, contracts, None)
1821
+ def _arrow4665(x: ArcInvestigation, y: ArcInvestigation, contracts: Any=contracts) -> bool:
1822
+ return equals(x, y)
1823
+
1824
+ if (len(match_value) == 1) if (not equals_with(_arrow4665, match_value, None)) else False:
1825
+ return match_value[0]
1826
+
1827
+ else:
1828
+ arg: int = len(match_value) or 0
1829
+ return to_fail(printf("Could not find investigation in contracts. Expected exactly one investigation, but found %d."))(arg)
1830
+
1831
+
1832
+
1833
+ def ARCAux_getLicenseFromContracts(contracts: Array[Contract]) -> License | None:
1834
+ def chooser(c: Contract, contracts: Any=contracts) -> License | None:
1835
+ return License.try_from_read_contract(c)
1836
+
1837
+ return try_pick(chooser, contracts)
1838
+
1839
+
1840
+ def ARCAux_updateFSByARC(isa: ArcInvestigation, license: License | None, fs: FileSystem) -> FileSystem:
1841
+ assays_folder: FileSystemTree
1842
+ def mapping(a: ArcAssay, isa: Any=isa, license: Any=license, fs: Any=fs) -> FileSystemTree:
1843
+ return FileSystemTree.create_assay_folder(a.Identifier, a.Datamap is not None)
1844
+
1845
+ assays: Array[FileSystemTree] = map(mapping, to_array(isa.Assays), None)
1846
+ assays_folder = FileSystemTree.create_assays_folder(assays)
1847
+ studies_folder: FileSystemTree
1848
+ def mapping_1(s: ArcStudy, isa: Any=isa, license: Any=license, fs: Any=fs) -> FileSystemTree:
1849
+ return FileSystemTree.create_study_folder(s.Identifier, s.Datamap is not None)
1850
+
1851
+ studies: Array[FileSystemTree] = map(mapping_1, to_array(isa.Studies), None)
1852
+ studies_folder = FileSystemTree.create_studies_folder(studies)
1853
+ workflows_folder: FileSystemTree
1854
+ def mapping_2(w: ArcWorkflow, isa: Any=isa, license: Any=license, fs: Any=fs) -> FileSystemTree:
1855
+ return FileSystemTree.create_workflow_folder(w.Identifier, w.CWLDescription is not None, w.Datamap is not None)
1856
+
1857
+ workflows: Array[FileSystemTree] = map(mapping_2, to_array(isa.Workflows), None)
1858
+ workflows_folder = FileSystemTree.create_workflows_folder(workflows)
1859
+ runs_folder: FileSystemTree
1860
+ def mapping_3(r: ArcRun, isa: Any=isa, license: Any=license, fs: Any=fs) -> FileSystemTree:
1861
+ return FileSystemTree.create_run_folder(r.Identifier, r.CWLDescription is not None, len(r.CWLInput) > 0, r.Datamap is not None)
1862
+
1863
+ runs: Array[FileSystemTree] = map(mapping_3, to_array(isa.Runs), None)
1864
+ runs_folder = FileSystemTree.create_runs_folder(runs)
1865
+ investigation: FileSystemTree = FileSystemTree.create_investigation_file()
1866
+ tree_1: FileSystem
1867
+ def _arrow4671(__unit: None=None, isa: Any=isa, license: Any=license, fs: Any=fs) -> IEnumerable_1[FileSystemTree]:
1868
+ def _arrow4670(__unit: None=None) -> IEnumerable_1[FileSystemTree]:
1869
+ def _arrow4669(__unit: None=None) -> IEnumerable_1[FileSystemTree]:
1870
+ def _arrow4668(__unit: None=None) -> IEnumerable_1[FileSystemTree]:
1871
+ def _arrow4667(__unit: None=None) -> IEnumerable_1[FileSystemTree]:
1872
+ def _arrow4666(__unit: None=None) -> IEnumerable_1[FileSystemTree]:
1873
+ return singleton_1(FileSystemTree(0, value_9(license).Path)) if (license is not None) else empty()
1874
+
1875
+ return append(singleton_1(runs_folder), delay(_arrow4666))
1876
+
1877
+ return append(singleton_1(workflows_folder), delay(_arrow4667))
1878
+
1879
+ return append(singleton_1(studies_folder), delay(_arrow4668))
1880
+
1881
+ return append(singleton_1(assays_folder), delay(_arrow4669))
1882
+
1883
+ return append(singleton_1(investigation), delay(_arrow4670))
1884
+
1885
+ tree: FileSystemTree = FileSystemTree.create_root_folder(to_array(delay(_arrow4671)))
1886
+ tree_1 = FileSystem.create(tree = tree)
1887
+ return fs.Union(tree_1)
1888
+
1889
+
1890
+ __all__ = ["ARC_reflection", "ARCAux_getArcAssaysFromContracts", "ARCAux_getArcStudiesFromContracts", "ARCAux_getArcWorkflowsFromContracts", "ARCAux_getArcRunsFromContracts", "ARCAux_getAssayDatamapFromContracts", "ARCAux_getStudyDatamapFromContracts", "ARCAux_getWorkflowDatamapFromContracts", "ARCAux_getRunDatamapFromContracts", "ARCAux_getWorkflowCWLFromContracts", "ARCAux_getRunCWLFromContracts", "ARCAux_getRunYMLFromContracts", "ARCAux_getCWLByPathFromContracts", "ARCAux_tryGetCWLByPath", "ARCAux_getArcInvestigationFromContracts", "ARCAux_getLicenseFromContracts", "ARCAux_updateFSByARC"]
1891
+