|
1 | 1 | { |
2 | | - "metadata": { |
3 | | - "kernelspec": { |
4 | | - "display_name": "Python 3 (ipykernel)", |
5 | | - "language": "python", |
6 | | - "name": "python3" |
7 | | - }, |
8 | | - "language_info": { |
9 | | - "name": "python", |
10 | | - "version": "3.12.8", |
11 | | - "mimetype": "text/x-python", |
12 | | - "codemirror_mode": { |
13 | | - "name": "ipython", |
14 | | - "version": 3 |
15 | | - }, |
16 | | - "pygments_lexer": "ipython3", |
17 | | - "nbconvert_exporter": "python", |
18 | | - "file_extension": ".py" |
19 | | - } |
20 | | - }, |
21 | | - "nbformat_minor": 5, |
22 | | - "nbformat": 4, |
23 | 2 | "cells": [ |
24 | 3 | { |
25 | | - "id": "377fef56-484d-491c-b19e-1be6931e44eb", |
26 | 4 | "cell_type": "code", |
27 | | - "source": "import pickle", |
| 5 | + "execution_count": 1, |
| 6 | + "id": "377fef56-484d-491c-b19e-1be6931e44eb", |
28 | 7 | "metadata": { |
29 | 8 | "trusted": true |
30 | 9 | }, |
31 | 10 | "outputs": [], |
32 | | - "execution_count": 1 |
| 11 | + "source": [ |
| 12 | + "import pickle" |
| 13 | + ] |
33 | 14 | }, |
34 | 15 | { |
35 | | - "id": "92e3921b-2bb8-4333-8cfe-4bd27f785d24", |
36 | 16 | "cell_type": "code", |
37 | | - "source": "from python_workflow_definition.cwl import load_workflow_json", |
| 17 | + "execution_count": null, |
| 18 | + "id": "92e3921b-2bb8-4333-8cfe-4bd27f785d24", |
38 | 19 | "metadata": { |
39 | 20 | "trusted": true |
40 | 21 | }, |
41 | 22 | "outputs": [], |
42 | | - "execution_count": 2 |
| 23 | + "source": [ |
| 24 | + "from python_workflow_definition.cwl import pwd_to_cwl" |
| 25 | + ] |
43 | 26 | }, |
44 | 27 | { |
45 | | - "id": "5303c059-8ae4-4557-858e-b4bd64eac711", |
46 | 28 | "cell_type": "code", |
47 | | - "source": "load_workflow_json(file_name=\"workflow.json\")", |
| 29 | + "execution_count": null, |
| 30 | + "id": "5303c059-8ae4-4557-858e-b4bd64eac711", |
48 | 31 | "metadata": { |
49 | 32 | "trusted": true |
50 | 33 | }, |
51 | 34 | "outputs": [], |
52 | | - "execution_count": 3 |
| 35 | + "source": [ |
| 36 | + "pwd_to_cwl(file_name=\"workflow.json\")" |
| 37 | + ] |
53 | 38 | }, |
54 | 39 | { |
55 | | - "id": "df302bd2-e9b6-4595-979c-67c46414d986", |
56 | 40 | "cell_type": "code", |
57 | | - "source": "! cwltool workflow.cwl workflow.yml", |
| 41 | + "execution_count": 4, |
| 42 | + "id": "df302bd2-e9b6-4595-979c-67c46414d986", |
58 | 43 | "metadata": { |
59 | 44 | "trusted": true |
60 | 45 | }, |
61 | 46 | "outputs": [ |
62 | 47 | { |
63 | 48 | "name": "stdout", |
64 | 49 | "output_type": "stream", |
65 | | - "text": "/srv/conda/envs/notebook/bin/cwltool:11: DeprecationWarning: Nesting argument groups is deprecated.\n sys.exit(run())\n\u001B[1;30mINFO\u001B[0m /srv/conda/envs/notebook/bin/cwltool 3.1.20250110105449\n\u001B[1;30mINFO\u001B[0m Resolved 'workflow.cwl' to 'file:///home/jovyan/example_workflows/arithmetic/workflow.cwl'\n\u001B[1;30mINFO\u001B[0m [workflow ] start\n\u001B[1;30mINFO\u001B[0m [workflow ] starting step get_prod_and_div_0\n\u001B[1;30mINFO\u001B[0m [step get_prod_and_div_0] start\n\u001B[1;30mINFO\u001B[0m [job get_prod_and_div_0] /tmp/hig0p5dd$ python \\\n -m \\\n python_workflow_definition.cwl \\\n --workflowfile=/tmp/0xeme5n4/stgba321752-0a06-41dd-95c0-f5890f1dfaae/workflow.py \\\n --function=workflow.get_prod_and_div \\\n --arg_y=/tmp/0xeme5n4/stg9f21530f-2f98-44e6-80b6-afa2aac5a083/y.pickle \\\n --arg_x=/tmp/0xeme5n4/stg2e35a78a-a776-48de-b82f-8075d3284a3c/x.pickle\n\u001B[1;30mINFO\u001B[0m [job get_prod_and_div_0] completed success\n\u001B[1;30mINFO\u001B[0m [step get_prod_and_div_0] completed success\n\u001B[1;30mINFO\u001B[0m [workflow ] starting step get_sum_1\n\u001B[1;30mINFO\u001B[0m [step get_sum_1] start\n\u001B[1;30mINFO\u001B[0m [job get_sum_1] /tmp/u07nctrs$ python \\\n -m \\\n python_workflow_definition.cwl \\\n --workflowfile=/tmp/sa53wz5h/stg686b1324-0030-4bfd-bdab-64fc9ee4d491/workflow.py \\\n --function=workflow.get_sum \\\n --arg_y=/tmp/sa53wz5h/stg1679a702-ac89-4c84-8cb5-7a57ae9e1834/div.pickle \\\n --arg_x=/tmp/sa53wz5h/stg6ab588fe-2723-416e-a7b8-648b1a63406e/prod.pickle\n\u001B[1;30mINFO\u001B[0m [job get_sum_1] completed success\n\u001B[1;30mINFO\u001B[0m [step get_sum_1] completed success\n\u001B[1;30mINFO\u001B[0m [workflow ] completed success\n{\n \"result_file\": {\n \"location\": \"file:///home/jovyan/example_workflows/arithmetic/result.pickle\",\n \"basename\": \"result.pickle\",\n \"class\": \"File\",\n \"checksum\": \"sha1$3dfd802cefb317cc7138af1e3a299f565c74ddec\",\n \"size\": 21,\n \"path\": \"/home/jovyan/example_workflows/arithmetic/result.pickle\"\n }\n}\u001B[1;30mINFO\u001B[0m Final process status is success\n" |
| 50 | + "text": [ |
| 51 | + "/srv/conda/envs/notebook/bin/cwltool:11: DeprecationWarning: Nesting argument groups is deprecated.\n", |
| 52 | + " sys.exit(run())\n", |
| 53 | + "\u001b[1;30mINFO\u001b[0m /srv/conda/envs/notebook/bin/cwltool 3.1.20250110105449\n", |
| 54 | + "\u001b[1;30mINFO\u001b[0m Resolved 'workflow.cwl' to 'file:///home/jovyan/example_workflows/arithmetic/workflow.cwl'\n", |
| 55 | + "\u001b[1;30mINFO\u001b[0m [workflow ] start\n", |
| 56 | + "\u001b[1;30mINFO\u001b[0m [workflow ] starting step get_prod_and_div_0\n", |
| 57 | + "\u001b[1;30mINFO\u001b[0m [step get_prod_and_div_0] start\n", |
| 58 | + "\u001b[1;30mINFO\u001b[0m [job get_prod_and_div_0] /tmp/hig0p5dd$ python \\\n", |
| 59 | + " -m \\\n", |
| 60 | + " python_workflow_definition.cwl \\\n", |
| 61 | + " --workflowfile=/tmp/0xeme5n4/stgba321752-0a06-41dd-95c0-f5890f1dfaae/workflow.py \\\n", |
| 62 | + " --function=workflow.get_prod_and_div \\\n", |
| 63 | + " --arg_y=/tmp/0xeme5n4/stg9f21530f-2f98-44e6-80b6-afa2aac5a083/y.pickle \\\n", |
| 64 | + " --arg_x=/tmp/0xeme5n4/stg2e35a78a-a776-48de-b82f-8075d3284a3c/x.pickle\n", |
| 65 | + "\u001b[1;30mINFO\u001b[0m [job get_prod_and_div_0] completed success\n", |
| 66 | + "\u001b[1;30mINFO\u001b[0m [step get_prod_and_div_0] completed success\n", |
| 67 | + "\u001b[1;30mINFO\u001b[0m [workflow ] starting step get_sum_1\n", |
| 68 | + "\u001b[1;30mINFO\u001b[0m [step get_sum_1] start\n", |
| 69 | + "\u001b[1;30mINFO\u001b[0m [job get_sum_1] /tmp/u07nctrs$ python \\\n", |
| 70 | + " -m \\\n", |
| 71 | + " python_workflow_definition.cwl \\\n", |
| 72 | + " --workflowfile=/tmp/sa53wz5h/stg686b1324-0030-4bfd-bdab-64fc9ee4d491/workflow.py \\\n", |
| 73 | + " --function=workflow.get_sum \\\n", |
| 74 | + " --arg_y=/tmp/sa53wz5h/stg1679a702-ac89-4c84-8cb5-7a57ae9e1834/div.pickle \\\n", |
| 75 | + " --arg_x=/tmp/sa53wz5h/stg6ab588fe-2723-416e-a7b8-648b1a63406e/prod.pickle\n", |
| 76 | + "\u001b[1;30mINFO\u001b[0m [job get_sum_1] completed success\n", |
| 77 | + "\u001b[1;30mINFO\u001b[0m [step get_sum_1] completed success\n", |
| 78 | + "\u001b[1;30mINFO\u001b[0m [workflow ] completed success\n", |
| 79 | + "{\n", |
| 80 | + " \"result_file\": {\n", |
| 81 | + " \"location\": \"file:///home/jovyan/example_workflows/arithmetic/result.pickle\",\n", |
| 82 | + " \"basename\": \"result.pickle\",\n", |
| 83 | + " \"class\": \"File\",\n", |
| 84 | + " \"checksum\": \"sha1$3dfd802cefb317cc7138af1e3a299f565c74ddec\",\n", |
| 85 | + " \"size\": 21,\n", |
| 86 | + " \"path\": \"/home/jovyan/example_workflows/arithmetic/result.pickle\"\n", |
| 87 | + " }\n", |
| 88 | + "}\u001b[1;30mINFO\u001b[0m Final process status is success\n" |
| 89 | + ] |
66 | 90 | } |
67 | 91 | ], |
68 | | - "execution_count": 4 |
| 92 | + "source": [ |
| 93 | + "! cwltool workflow.cwl workflow.yml" |
| 94 | + ] |
69 | 95 | }, |
70 | 96 | { |
71 | | - "id": "2942dbba-ea0a-4d20-be5c-ed9992d09ff8", |
72 | 97 | "cell_type": "code", |
73 | | - "source": "with open(\"result.pickle\", \"rb\") as f:\n print(pickle.load(f))", |
| 98 | + "execution_count": 5, |
| 99 | + "id": "2942dbba-ea0a-4d20-be5c-ed9992d09ff8", |
74 | 100 | "metadata": { |
75 | 101 | "trusted": true |
76 | 102 | }, |
77 | 103 | "outputs": [ |
78 | 104 | { |
79 | 105 | "name": "stdout", |
80 | 106 | "output_type": "stream", |
81 | | - "text": "2.5\n" |
| 107 | + "text": [ |
| 108 | + "2.5\n" |
| 109 | + ] |
82 | 110 | } |
83 | 111 | ], |
84 | | - "execution_count": 5 |
| 112 | + "source": [ |
| 113 | + "with open(\"result.pickle\", \"rb\") as f:\n", |
| 114 | + " print(pickle.load(f))" |
| 115 | + ] |
85 | 116 | }, |
86 | 117 | { |
87 | | - "id": "60e909ee-d0d0-4bd1-81c8-dd5274ae5834", |
88 | 118 | "cell_type": "code", |
89 | | - "source": "", |
| 119 | + "execution_count": null, |
| 120 | + "id": "60e909ee-d0d0-4bd1-81c8-dd5274ae5834", |
90 | 121 | "metadata": { |
91 | 122 | "trusted": true |
92 | 123 | }, |
93 | 124 | "outputs": [], |
94 | | - "execution_count": null |
| 125 | + "source": [] |
| 126 | + } |
| 127 | + ], |
| 128 | + "metadata": { |
| 129 | + "kernelspec": { |
| 130 | + "display_name": "Python 3 (ipykernel)", |
| 131 | + "language": "python", |
| 132 | + "name": "python3" |
| 133 | + }, |
| 134 | + "language_info": { |
| 135 | + "codemirror_mode": { |
| 136 | + "name": "ipython", |
| 137 | + "version": 3 |
| 138 | + }, |
| 139 | + "file_extension": ".py", |
| 140 | + "mimetype": "text/x-python", |
| 141 | + "name": "python", |
| 142 | + "nbconvert_exporter": "python", |
| 143 | + "pygments_lexer": "ipython3", |
| 144 | + "version": "3.12.8" |
95 | 145 | } |
96 | | - ] |
| 146 | + }, |
| 147 | + "nbformat": 4, |
| 148 | + "nbformat_minor": 5 |
97 | 149 | } |
0 commit comments