From d6d2d83b94b1dbb3ef3e881b1c85afa16c2a8888 Mon Sep 17 00:00:00 2001 From: JaGeo Date: Thu, 24 Apr 2025 12:38:53 +0200 Subject: [PATCH] remove data from datastore --- example_workflows/arithmetic/jobflow.ipynb | 75 ++++++++++++++----- example_workflows/nfdi/jobflow.ipynb | 4 +- .../quantum_espresso/jobflow.ipynb | 7 +- 3 files changed, 66 insertions(+), 20 deletions(-) diff --git a/example_workflows/arithmetic/jobflow.ipynb b/example_workflows/arithmetic/jobflow.ipynb index 81d1c09..79ff624 100644 --- a/example_workflows/arithmetic/jobflow.ipynb +++ b/example_workflows/arithmetic/jobflow.ipynb @@ -38,16 +38,26 @@ "cell_type": "code", "source": "from jobflow import job, Flow", "metadata": { - "trusted": true + "trusted": true, + "ExecuteTime": { + "end_time": "2025-04-24T10:30:16.328511Z", + "start_time": "2025-04-24T10:30:16.309562Z" + } }, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "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" + "ename": "ModuleNotFoundError", + "evalue": "No module named 'jobflow'", + "output_type": "error", + "traceback": [ + "\u001B[31m---------------------------------------------------------------------------\u001B[39m", + "\u001B[31mModuleNotFoundError\u001B[39m Traceback (most recent call last)", + "\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", + "\u001B[31mModuleNotFoundError\u001B[39m: No module named 'jobflow'" + ] } ], - "execution_count": 1 + "execution_count": 4 }, { "id": "06c2bd9e-b2ac-4b88-9158-fa37331c3418", @@ -60,35 +70,66 @@ "execution_count": 2 }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2025-04-24T10:30:04.618439Z", + "start_time": "2025-04-24T10:30:04.598701Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "from workflow import (\n", " get_sum as _get_sum,\n", " get_prod_and_div as _get_prod_and_div,\n", ")" ], - "id": "f9217ce7b093b5fc" + "id": "f9217ce7b093b5fc", + "outputs": [], + "execution_count": 1 }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2025-04-24T10:30:04.751088Z", + "start_time": "2025-04-24T10:30:04.748941Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": "workflow_json_filename = \"jobflow_simple.json\"", - "id": "1feba0898ee4e361" + "id": "1feba0898ee4e361", + "outputs": [], + "execution_count": 2 }, { "id": "07598344-0f75-433b-8902-bea21a42088c", "cell_type": "code", - "source": "get_sum = job(_get_sum)\nget_prod_and_div = job(_get_prod_and_div, data=[\"prod\", \"div\"])", + "source": [ + "get_sum = job(_get_sum)\n", + "# 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", + "# On the way from the general definition to the jobflow definition, we do this automatically to avoid overflow databases.\n", + "get_prod_and_div = job(_get_prod_and_div)" + ], "metadata": { - "trusted": true + "trusted": true, + "ExecuteTime": { + "end_time": "2025-04-24T10:30:05.169761Z", + "start_time": "2025-04-24T10:30:05.043635Z" + } }, - "outputs": [], - "execution_count": 5 + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'job' is not defined", + "output_type": "error", + "traceback": [ + "\u001B[31m---------------------------------------------------------------------------\u001B[39m", + "\u001B[31mNameError\u001B[39m Traceback (most recent call last)", + "\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", + "\u001B[31mNameError\u001B[39m: name 'job' is not defined" + ] + } + ], + "execution_count": 3 }, { "id": "ecef1ed5-a8d3-48c3-9e01-4a40e55c1153", diff --git a/example_workflows/nfdi/jobflow.ipynb b/example_workflows/nfdi/jobflow.ipynb index 0fda22f..d75635b 100644 --- a/example_workflows/nfdi/jobflow.ipynb +++ b/example_workflows/nfdi/jobflow.ipynb @@ -79,8 +79,8 @@ "execution_count": null, "source": [ "generate_mesh = job(_generate_mesh)\n", - "convert_to_xdmf = job(_convert_to_xdmf, data=[\"xdmf_file\", \"h5_file\"])\n", - "poisson = job(_poisson, data=[\"numdofs\", \"pvd_file\", \"vtu_file\"])\n", + "convert_to_xdmf = job(_convert_to_xdmf)\n", + "poisson = job(_poisson)\n", "plot_over_line = job(_plot_over_line)\n", "substitute_macros = job(_substitute_macros)\n", "compile_paper = job(_compile_paper)" diff --git a/example_workflows/quantum_espresso/jobflow.ipynb b/example_workflows/quantum_espresso/jobflow.ipynb index ac0983e..aee8f40 100644 --- a/example_workflows/quantum_espresso/jobflow.ipynb +++ b/example_workflows/quantum_espresso/jobflow.ipynb @@ -87,7 +87,12 @@ }, { "cell_type": "code", - "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)", + "source": [ + "calculate_qe = job(_calculate_qe)\n", + "generate_structures = job(_generate_structures)\n", + "plot_energy_volume_curve = job(_plot_energy_volume_curve)\n", + "get_bulk_structure = job(_get_bulk_structure)" + ], "metadata": { "trusted": true },