Skip to content

Commit 629abe3

Browse files
authored
remove data from datastore (#79)
1 parent 6ed9a5f commit 629abe3

File tree

3 files changed

+66
-20
lines changed

3 files changed

+66
-20
lines changed

example_workflows/arithmetic/jobflow.ipynb

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,26 @@
3838
"cell_type": "code",
3939
"source": "from jobflow import job, Flow",
4040
"metadata": {
41-
"trusted": true
41+
"trusted": true,
42+
"ExecuteTime": {
43+
"end_time": "2025-04-24T10:30:16.328511Z",
44+
"start_time": "2025-04-24T10:30:16.309562Z"
45+
}
4246
},
4347
"outputs": [
4448
{
45-
"name": "stderr",
46-
"output_type": "stream",
47-
"text": "/srv/conda/envs/notebook/lib/python3.12/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.\n \"cipher\": algorithms.TripleDES,\n/srv/conda/envs/notebook/lib/python3.12/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.\n \"class\": algorithms.TripleDES,\n"
49+
"ename": "ModuleNotFoundError",
50+
"evalue": "No module named 'jobflow'",
51+
"output_type": "error",
52+
"traceback": [
53+
"\u001B[31m---------------------------------------------------------------------------\u001B[39m",
54+
"\u001B[31mModuleNotFoundError\u001B[39m Traceback (most recent call last)",
55+
"\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[4]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mjobflow\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m job, Flow\n",
56+
"\u001B[31mModuleNotFoundError\u001B[39m: No module named 'jobflow'"
57+
]
4858
}
4959
],
50-
"execution_count": 1
60+
"execution_count": 4
5161
},
5262
{
5363
"id": "06c2bd9e-b2ac-4b88-9158-fa37331c3418",
@@ -60,35 +70,66 @@
6070
"execution_count": 2
6171
},
6272
{
63-
"metadata": {},
73+
"metadata": {
74+
"ExecuteTime": {
75+
"end_time": "2025-04-24T10:30:04.618439Z",
76+
"start_time": "2025-04-24T10:30:04.598701Z"
77+
}
78+
},
6479
"cell_type": "code",
65-
"outputs": [],
66-
"execution_count": null,
6780
"source": [
6881
"from workflow import (\n",
6982
" get_sum as _get_sum,\n",
7083
" get_prod_and_div as _get_prod_and_div,\n",
7184
")"
7285
],
73-
"id": "f9217ce7b093b5fc"
86+
"id": "f9217ce7b093b5fc",
87+
"outputs": [],
88+
"execution_count": 1
7489
},
7590
{
76-
"metadata": {},
91+
"metadata": {
92+
"ExecuteTime": {
93+
"end_time": "2025-04-24T10:30:04.751088Z",
94+
"start_time": "2025-04-24T10:30:04.748941Z"
95+
}
96+
},
7797
"cell_type": "code",
78-
"outputs": [],
79-
"execution_count": null,
8098
"source": "workflow_json_filename = \"jobflow_simple.json\"",
81-
"id": "1feba0898ee4e361"
99+
"id": "1feba0898ee4e361",
100+
"outputs": [],
101+
"execution_count": 2
82102
},
83103
{
84104
"id": "07598344-0f75-433b-8902-bea21a42088c",
85105
"cell_type": "code",
86-
"source": "get_sum = job(_get_sum)\nget_prod_and_div = job(_get_prod_and_div, data=[\"prod\", \"div\"])",
106+
"source": [
107+
"get_sum = job(_get_sum)\n",
108+
"# Note: one could also transfer the outputs to the datastore as well: get_prod_and_div = job(_get_prod_and_div, data=[\"prod\", \"div\"])\n",
109+
"# On the way from the general definition to the jobflow definition, we do this automatically to avoid overflow databases.\n",
110+
"get_prod_and_div = job(_get_prod_and_div)"
111+
],
87112
"metadata": {
88-
"trusted": true
113+
"trusted": true,
114+
"ExecuteTime": {
115+
"end_time": "2025-04-24T10:30:05.169761Z",
116+
"start_time": "2025-04-24T10:30:05.043635Z"
117+
}
89118
},
90-
"outputs": [],
91-
"execution_count": 5
119+
"outputs": [
120+
{
121+
"ename": "NameError",
122+
"evalue": "name 'job' is not defined",
123+
"output_type": "error",
124+
"traceback": [
125+
"\u001B[31m---------------------------------------------------------------------------\u001B[39m",
126+
"\u001B[31mNameError\u001B[39m Traceback (most recent call last)",
127+
"\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[3]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m get_sum = \u001B[43mjob\u001B[49m(_get_sum)\n\u001B[32m 2\u001B[39m get_prod_and_div = job(_get_prod_and_div, data=[\u001B[33m\"\u001B[39m\u001B[33mprod\u001B[39m\u001B[33m\"\u001B[39m, \u001B[33m\"\u001B[39m\u001B[33mdiv\u001B[39m\u001B[33m\"\u001B[39m])\n",
128+
"\u001B[31mNameError\u001B[39m: name 'job' is not defined"
129+
]
130+
}
131+
],
132+
"execution_count": 3
92133
},
93134
{
94135
"id": "ecef1ed5-a8d3-48c3-9e01-4a40e55c1153",

example_workflows/nfdi/jobflow.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
"execution_count": null,
8080
"source": [
8181
"generate_mesh = job(_generate_mesh)\n",
82-
"convert_to_xdmf = job(_convert_to_xdmf, data=[\"xdmf_file\", \"h5_file\"])\n",
83-
"poisson = job(_poisson, data=[\"numdofs\", \"pvd_file\", \"vtu_file\"])\n",
82+
"convert_to_xdmf = job(_convert_to_xdmf)\n",
83+
"poisson = job(_poisson)\n",
8484
"plot_over_line = job(_plot_over_line)\n",
8585
"substitute_macros = job(_substitute_macros)\n",
8686
"compile_paper = job(_compile_paper)"

example_workflows/quantum_espresso/jobflow.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@
8787
},
8888
{
8989
"cell_type": "code",
90-
"source": "calculate_qe = job(_calculate_qe, data=[\"energy\", \"volume\", \"structure\"])\ngenerate_structures = job(_generate_structures, data=[f\"s_{i}\" for i in range(100)])\nplot_energy_volume_curve = job(_plot_energy_volume_curve)\nget_bulk_structure = job(_get_bulk_structure)",
90+
"source": [
91+
"calculate_qe = job(_calculate_qe)\n",
92+
"generate_structures = job(_generate_structures)\n",
93+
"plot_energy_volume_curve = job(_plot_energy_volume_curve)\n",
94+
"get_bulk_structure = job(_get_bulk_structure)"
95+
],
9196
"metadata": {
9297
"trusted": true
9398
},

0 commit comments

Comments
 (0)