Skip to content

Commit b006ce3

Browse files
committed
cwl.load_workflow_json -> cwl.pwd_to_cwl
1 parent 3af91a5 commit b006ce3

File tree

4 files changed

+593
-154
lines changed

4 files changed

+593
-154
lines changed
Lines changed: 94 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,149 @@
11
{
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,
232
"cells": [
243
{
25-
"id": "377fef56-484d-491c-b19e-1be6931e44eb",
264
"cell_type": "code",
27-
"source": "import pickle",
5+
"execution_count": 1,
6+
"id": "377fef56-484d-491c-b19e-1be6931e44eb",
287
"metadata": {
298
"trusted": true
309
},
3110
"outputs": [],
32-
"execution_count": 1
11+
"source": [
12+
"import pickle"
13+
]
3314
},
3415
{
35-
"id": "92e3921b-2bb8-4333-8cfe-4bd27f785d24",
3616
"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",
3819
"metadata": {
3920
"trusted": true
4021
},
4122
"outputs": [],
42-
"execution_count": 2
23+
"source": [
24+
"from python_workflow_definition.cwl import pwd_to_cwl"
25+
]
4326
},
4427
{
45-
"id": "5303c059-8ae4-4557-858e-b4bd64eac711",
4628
"cell_type": "code",
47-
"source": "load_workflow_json(file_name=\"workflow.json\")",
29+
"execution_count": null,
30+
"id": "5303c059-8ae4-4557-858e-b4bd64eac711",
4831
"metadata": {
4932
"trusted": true
5033
},
5134
"outputs": [],
52-
"execution_count": 3
35+
"source": [
36+
"pwd_to_cwl(file_name=\"workflow.json\")"
37+
]
5338
},
5439
{
55-
"id": "df302bd2-e9b6-4595-979c-67c46414d986",
5640
"cell_type": "code",
57-
"source": "! cwltool workflow.cwl workflow.yml",
41+
"execution_count": 4,
42+
"id": "df302bd2-e9b6-4595-979c-67c46414d986",
5843
"metadata": {
5944
"trusted": true
6045
},
6146
"outputs": [
6247
{
6348
"name": "stdout",
6449
"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+
]
6690
}
6791
],
68-
"execution_count": 4
92+
"source": [
93+
"! cwltool workflow.cwl workflow.yml"
94+
]
6995
},
7096
{
71-
"id": "2942dbba-ea0a-4d20-be5c-ed9992d09ff8",
7297
"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",
74100
"metadata": {
75101
"trusted": true
76102
},
77103
"outputs": [
78104
{
79105
"name": "stdout",
80106
"output_type": "stream",
81-
"text": "2.5\n"
107+
"text": [
108+
"2.5\n"
109+
]
82110
}
83111
],
84-
"execution_count": 5
112+
"source": [
113+
"with open(\"result.pickle\", \"rb\") as f:\n",
114+
" print(pickle.load(f))"
115+
]
85116
},
86117
{
87-
"id": "60e909ee-d0d0-4bd1-81c8-dd5274ae5834",
88118
"cell_type": "code",
89-
"source": "",
119+
"execution_count": null,
120+
"id": "60e909ee-d0d0-4bd1-81c8-dd5274ae5834",
90121
"metadata": {
91122
"trusted": true
92123
},
93124
"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"
95145
}
96-
]
146+
},
147+
"nbformat": 4,
148+
"nbformat_minor": 5
97149
}

0 commit comments

Comments
 (0)