diff --git a/aiida_nfdi.ipynb b/aiida_nfdi.ipynb index 0d73c32..ea8d880 100644 --- a/aiida_nfdi.ipynb +++ b/aiida_nfdi.ipynb @@ -1,903 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "106ded66-d202-46ac-82b0-2755ca309bdd", - "metadata": {}, - "source": [ - "https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "6d86e804-245a-4d96-a1a3-1bc3216c3646", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "# conda environments:\n", - "#\n", - "base * /home/janssen/mambaforge\n", - "postprocessing /home/janssen/mambaforge/envs/postprocessing\n", - "preprocessing /home/janssen/mambaforge/envs/preprocessing\n", - "processing /home/janssen/mambaforge/envs/processing\n", - "\n" - ] - } - ], - "source": [ - "!conda env list" - ] - }, - { - "cell_type": "markdown", - "id": "11e09b78-cb72-465f-9c8b-5b77f0aa729c", - "metadata": {}, - "source": [ - "# Preprocessing " - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "a76e6c0a-98f2-4436-af10-8097da183341", - "metadata": {}, - "outputs": [], - "source": [ - "from nfdi_ing_workflow import (\n", - " generate_mesh,\n", - " convert_to_xdmf as _convert_to_xdmf,\n", - " poisson as _poisson,\n", - " plot_over_line,\n", - " substitute_macros,\n", - " compile_paper,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "89c02460-b543-442c-a27e-f1757dc2262e", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import write_workflow_json\n", - "\n", - "from aiida_workgraph import WorkGraph, task\n", - "from aiida import orm, load_profile\n", - "load_profile()" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "549ecf27-88ef-4e77-8bd4-b616cfdda2e4", - "metadata": {}, - "outputs": [], - "source": [ - "convert_to_xdmf = task(outputs=[\"xdmf_file\", \"h5_file\"])(_convert_to_xdmf)\n", - "poisson = task(outputs=[\"numdofs\", \"pvd_file\", \"vtu_file\"])(_poisson)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "8d911f98-3b80-457f-a0f4-3cb37ebf1691", - "metadata": {}, - "outputs": [], - "source": [ - "domain_size = orm.Float(2.0)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1e7e14ba-c4a7-485f-9bd8-44625830cca0", - "metadata": {}, - "outputs": [], - "source": [ - "wg = WorkGraph(\"wg-nfdi\")" - ] - }, - { - "cell_type": "markdown", - "id": "cf1e22d2-9ce5-488f-8048-308d7d5d4966", - "metadata": {}, - "source": [ - "## generate mesh" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "71d411b6-cbec-489e-99e3-ba71680bcb5b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "gmsh_output_file = wg.add_task(\n", - " generate_mesh,\n", - " name=\"generate_mesh\",\n", - " domain_size=domain_size,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "019938e7-8b41-47a9-b226-00e05dabc193", - "metadata": {}, - "source": [ - "## convert to xdmf" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "1d0d9804-f250-48b3-a5d0-a546d520f79b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "meshio_output_dict = wg.add_task(\n", - " convert_to_xdmf,\n", - " name=\"convert_to_xdmf\",\n", - " gmsh_output_file=gmsh_output_file.outputs.result,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "ceb0b643-caaa-426c-9781-28703440e647", - "metadata": {}, - "source": [ - "# Processing" - ] - }, - { - "cell_type": "markdown", - "id": "11815a8b-319c-4ff3-8eae-330bf6e58eee", - "metadata": {}, - "source": [ - "## poisson" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "7b69bcff-e2b1-4d4a-b62c-6a1c86eeb590", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "poisson_dict = wg.add_task(\n", - " poisson,\n", - " name=\"poisson\",\n", - " meshio_output_xdmf=meshio_output_dict.outputs.xdmf_file, \n", - " meshio_output_h5=meshio_output_dict.outputs.h5_file,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "bc8a8634-029e-4337-96a2-a1f284cb4c38", - "metadata": {}, - "source": [ - "# Postprocessing" - ] - }, - { - "cell_type": "markdown", - "id": "157c5386-91a3-4e21-ac65-8f947f2d62fa", - "metadata": {}, - "source": [ - "## plot over line" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "3c4a29b0-eb1e-490a-8be0-e03cfff15e0a", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "pvbatch_output_file = wg.add_task(\n", - " plot_over_line,\n", - " name=\"plot_over_line\",\n", - " poisson_output_pvd_file=poisson_dict.outputs.pvd_file, \n", - " poisson_output_vtu_file=poisson_dict.outputs.vtu_file,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "54f1d4bd-b944-470f-9cf8-30e64a24eb6d", - "metadata": {}, - "source": [ - "## substitute macros" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "a0a4c233-322d-4723-9627-62ca2487bfa9", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "macros_tex_file = wg.add_task(\n", - " substitute_macros,\n", - " name=\"substitute_macros\",\n", - " pvbatch_output_file=pvbatch_output_file.outputs.result, \n", - " ndofs=poisson_dict.outputs.numdofs, \n", - " domain_size=domain_size,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "2031b693-acf3-48bd-bb00-e33f669381e9", - "metadata": {}, - "source": [ - "## compile paper" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "c281408f-e63d-4380-a7e6-c595d49fbb8f", - "metadata": {}, - "outputs": [], - "source": [ - "paper_output = wg.add_task(\n", - " compile_paper,\n", - " name=\"compile_paper\",\n", - " macros_tex=macros_tex_file.outputs.result, \n", - " plot_file=pvbatch_output_file.outputs.result,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "a384d70a-8ef5-4fdd-880c-56ac7eaf87b9", - "metadata": {}, - "outputs": [], - "source": [ - "wg" - ] - }, - { - "cell_type": "markdown", - "id": "5c1b0200-bba3-484d-ac49-f582898e974f", - "metadata": {}, - "source": [ - "# Convert " - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "196faf18-c46b-4f42-a652-698d2c580221", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import write_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "fb23ad9c-76fd-4c0b-b546-e305d6c49796", - "metadata": {}, - "outputs": [], - "source": [ - "workflow_json_filename = \"aiida_nfdi.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "4139547a-9717-4708-b1a5-8202a0382d77", - "metadata": {}, - "outputs": [], - "source": [ - "write_workflow_json(wg=wg, file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "490df6a3-e402-4620-acf2-dbcfa0c5d537", - "metadata": {}, - "outputs": [], - "source": [ - "!cat {workflow_json_filename}" - ] - }, - { - "cell_type": "markdown", - "id": "11a829e2-face-469f-b343-2c95763b1f13", - "metadata": {}, - "source": [ - "# Load Workflow with jobflow" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4f3acabe-55df-479a-af4d-a23a80c4660d", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.jobflow import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b6ba9444-a2c8-451b-b74c-19b0f69ba369", - "metadata": {}, - "outputs": [], - "source": [ - "from jobflow.managers.local import run_locally" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c3528d55-6bf7-47ed-a110-65c47446ba92", - "metadata": {}, - "outputs": [], - "source": [ - "flow = load_workflow_json(file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5ef48778-4209-425f-8c6b-85a4cd2f92ec", - "metadata": {}, - "outputs": [], - "source": [ - "result = run_locally(flow)\n", - "result" - ] - }, - { - "cell_type": "markdown", - "id": "397b16a2-e1ec-4eec-8562-1c84f585c347", - "metadata": {}, - "source": [ - "# Load Workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "fdde6b82-b51d-434a-a9a8-5a8c31bbb429", - "metadata": {}, - "outputs": [], - "source": [ - "from pyiron_base import Project" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "be4d5d93-e9f6-4072-a6be-0ee5dc93590f", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "4db75587-5f4c-416d-a1f6-c949077fa2ca", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "b5c4c082a18b4d5391aac8dd470570d5", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "0it [00:00, ?it/s]" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "pr = Project(\"test\")\n", - "pr.remove_jobs(recursive=True, silently=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "4452a648-d4c3-4f5f-8678-ffb54bef17dc", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "create_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4ab70>\n", - "\n", - "\n", - "\n", - "macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "macros_tex=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a8d0>\n", - "\n", - "\n", - "\n", - "macros_tex_f8e7c70add5a6917362eaba96348676f->create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "pvbatch_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a570>\n", - "\n", - "\n", - "\n", - "pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "poisson_output_pvd_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a1e0>\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973->pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "plot_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a570>\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973->plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "plot_file_a227e82a0cabcaa4ff69b537232c3daf->create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d\n", - "\n", - "meshio_output_xdmf=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49dc0>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "poisson_output_vtu_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a090>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "ndofs=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a600>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3->pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3->plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "ndofs_af456a32dc17ccd053cef8f83b61802e->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3\n", - "\n", - "gmsh_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49af0>\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3->meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081\n", - "\n", - "meshio_output_h5=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49a30>\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3->meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20\n", - "\n", - "domain_size=2.0\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20->gmsh_output_file_b41125ac47f34334493d860607ee71a3\n", - "\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\n", - "delayed_object.draw()" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "1c2760b6-96b4-4f44-ac49-a229d4a0cf67", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The job generate_mesh_0b48cf5155cd6802c17d20bb58104132 was saved and received the ID: 2005\n", - "The job convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae was saved and received the ID: 2006\n", - "The job poisson_2d98621ac2c8e43a266693cf65647173 was saved and received the ID: 2007\n", - "The job plot_over_line_004790462b53a54f512cc7e1a2a10519 was saved and received the ID: 2008\n", - "The job substitute_macros_52130ff9ec1931ec82532a7119df653f was saved and received the ID: 2009\n", - "The job compile_paper_b65627cdc212fc76a216689a26379fae was saved and received the ID: 2010\n" - ] - }, - { - "data": { - "text/plain": [ - "'/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/postprocessing/paper.pdf'" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "delayed_object.pull()" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "b3bba27e-ece9-4c02-834c-53e69844b140", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idstatuschemicalformulajobsubjobprojectpathprojecttimestarttimestoptotalcputimecomputerhamiltonhamversionparentidmasterid
02005finishedNonegenerate_mesh_0b48cf5155cd6802c17d20bb58104132/generate_mesh_0b48cf5155cd6802c17d20bb58104132None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:38.490191NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
12006finishedNoneconvert_to_xdmf_9ded0361e4866afe4962398287e4f6ae/convert_to_xdmf_9ded0361e4866afe4962398287e4f6aeNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:45.247485NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
22007finishedNonepoisson_2d98621ac2c8e43a266693cf65647173/poisson_2d98621ac2c8e43a266693cf65647173None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:52.878817NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
32008finishedNoneplot_over_line_004790462b53a54f512cc7e1a2a10519/plot_over_line_004790462b53a54f512cc7e1a2a10519None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:02.977300NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
42009finishedNonesubstitute_macros_52130ff9ec1931ec82532a7119df653f/substitute_macros_52130ff9ec1931ec82532a7119df653fNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:10.674995NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
52010finishedNonecompile_paper_b65627cdc212fc76a216689a26379fae/compile_paper_b65627cdc212fc76a216689a26379faeNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:16.820860NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
\n", - "
" - ], - "text/plain": [ - " id status chemicalformula \\\n", - "0 2005 finished None \n", - "1 2006 finished None \n", - "2 2007 finished None \n", - "3 2008 finished None \n", - "4 2009 finished None \n", - "5 2010 finished None \n", - "\n", - " job \\\n", - "0 generate_mesh_0b48cf5155cd6802c17d20bb58104132 \n", - "1 convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae \n", - "2 poisson_2d98621ac2c8e43a266693cf65647173 \n", - "3 plot_over_line_004790462b53a54f512cc7e1a2a10519 \n", - "4 substitute_macros_52130ff9ec1931ec82532a7119df653f \n", - "5 compile_paper_b65627cdc212fc76a216689a26379fae \n", - "\n", - " subjob projectpath \\\n", - "0 /generate_mesh_0b48cf5155cd6802c17d20bb58104132 None \n", - "1 /convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae None \n", - "2 /poisson_2d98621ac2c8e43a266693cf65647173 None \n", - "3 /plot_over_line_004790462b53a54f512cc7e1a2a10519 None \n", - "4 /substitute_macros_52130ff9ec1931ec82532a7119df653f None \n", - "5 /compile_paper_b65627cdc212fc76a216689a26379fae None \n", - "\n", - " project \\\n", - "0 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "1 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "2 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "3 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "4 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "5 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "\n", - " timestart timestop totalcputime computer \\\n", - "0 2025-04-02 15:02:38.490191 None None pyiron@cmpc06#1 \n", - "1 2025-04-02 15:02:45.247485 None None pyiron@cmpc06#1 \n", - "2 2025-04-02 15:02:52.878817 None None pyiron@cmpc06#1 \n", - "3 2025-04-02 15:03:02.977300 None None pyiron@cmpc06#1 \n", - "4 2025-04-02 15:03:10.674995 None None pyiron@cmpc06#1 \n", - "5 2025-04-02 15:03:16.820860 None None pyiron@cmpc06#1 \n", - "\n", - " hamilton hamversion parentid masterid \n", - "0 PythonFunctionContainerJob 0.4 None None \n", - "1 PythonFunctionContainerJob 0.4 None None \n", - "2 PythonFunctionContainerJob 0.4 None None \n", - "3 PythonFunctionContainerJob 0.4 None None \n", - "4 PythonFunctionContainerJob 0.4 None None \n", - "5 PythonFunctionContainerJob 0.4 None None " - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pr.job_table()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":5,"nbformat":4,"cells":[{"id":"106ded66-d202-46ac-82b0-2755ca309bdd","cell_type":"markdown","source":"https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements","metadata":{}},{"id":"6d86e804-245a-4d96-a1a3-1bc3216c3646","cell_type":"code","source":"!conda env list","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"\n# conda environments:\n#\nbase /srv/conda\nnotebook * /srv/conda/envs/notebook\npostprocessing /srv/conda/envs/postprocessing\npreprocessing /srv/conda/envs/preprocessing\nprocessing /srv/conda/envs/processing\n\n"}],"execution_count":1},{"id":"11e09b78-cb72-465f-9c8b-5b77f0aa729c","cell_type":"markdown","source":"# Preprocessing ","metadata":{}},{"id":"a76e6c0a-98f2-4436-af10-8097da183341","cell_type":"code","source":"from nfdi_ing_workflow import (\n generate_mesh,\n convert_to_xdmf as _convert_to_xdmf,\n poisson as _poisson,\n plot_over_line,\n substitute_macros,\n compile_paper,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"id":"89c02460-b543-442c-a27e-f1757dc2262e","cell_type":"code","source":"from python_workflow_definition.aiida import write_workflow_json\n\nfrom aiida_workgraph import WorkGraph, task\nfrom aiida import orm, load_profile\nload_profile()","metadata":{"trusted":true},"outputs":[{"execution_count":3,"output_type":"execute_result","data":{"text/plain":"Profile"},"metadata":{}}],"execution_count":3},{"id":"549ecf27-88ef-4e77-8bd4-b616cfdda2e4","cell_type":"code","source":"convert_to_xdmf = task(outputs=[\"xdmf_file\", \"h5_file\"])(_convert_to_xdmf)\npoisson = task(outputs=[\"numdofs\", \"pvd_file\", \"vtu_file\"])(_poisson)","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"id":"8d911f98-3b80-457f-a0f4-3cb37ebf1691","cell_type":"code","source":"domain_size = orm.Float(2.0)","metadata":{"trusted":true},"outputs":[],"execution_count":5},{"id":"1e7e14ba-c4a7-485f-9bd8-44625830cca0","cell_type":"code","source":"wg = WorkGraph(\"wg-nfdi\")","metadata":{"trusted":true},"outputs":[],"execution_count":6},{"id":"cf1e22d2-9ce5-488f-8048-308d7d5d4966","cell_type":"markdown","source":"## generate mesh","metadata":{}},{"id":"71d411b6-cbec-489e-99e3-ba71680bcb5b","cell_type":"code","source":"gmsh_output_file = wg.add_task(\n generate_mesh,\n name=\"generate_mesh\",\n domain_size=domain_size,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":7},{"id":"019938e7-8b41-47a9-b226-00e05dabc193","cell_type":"markdown","source":"## convert to xdmf","metadata":{}},{"id":"1d0d9804-f250-48b3-a5d0-a546d520f79b","cell_type":"code","source":"meshio_output_dict = wg.add_task(\n convert_to_xdmf,\n name=\"convert_to_xdmf\",\n gmsh_output_file=gmsh_output_file.outputs.result,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":8},{"id":"ceb0b643-caaa-426c-9781-28703440e647","cell_type":"markdown","source":"# Processing","metadata":{}},{"id":"11815a8b-319c-4ff3-8eae-330bf6e58eee","cell_type":"markdown","source":"## poisson","metadata":{}},{"id":"7b69bcff-e2b1-4d4a-b62c-6a1c86eeb590","cell_type":"code","source":"poisson_dict = wg.add_task(\n poisson,\n name=\"poisson\",\n meshio_output_xdmf=meshio_output_dict.outputs.xdmf_file, \n meshio_output_h5=meshio_output_dict.outputs.h5_file,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":9},{"id":"bc8a8634-029e-4337-96a2-a1f284cb4c38","cell_type":"markdown","source":"# Postprocessing","metadata":{}},{"id":"157c5386-91a3-4e21-ac65-8f947f2d62fa","cell_type":"markdown","source":"## plot over line","metadata":{}},{"id":"3c4a29b0-eb1e-490a-8be0-e03cfff15e0a","cell_type":"code","source":"pvbatch_output_file = wg.add_task(\n plot_over_line,\n name=\"plot_over_line\",\n poisson_output_pvd_file=poisson_dict.outputs.pvd_file, \n poisson_output_vtu_file=poisson_dict.outputs.vtu_file,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":10},{"id":"54f1d4bd-b944-470f-9cf8-30e64a24eb6d","cell_type":"markdown","source":"## substitute macros","metadata":{}},{"id":"a0a4c233-322d-4723-9627-62ca2487bfa9","cell_type":"code","source":"macros_tex_file = wg.add_task(\n substitute_macros,\n name=\"substitute_macros\",\n pvbatch_output_file=pvbatch_output_file.outputs.result, \n ndofs=poisson_dict.outputs.numdofs, \n domain_size=domain_size,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":11},{"id":"2031b693-acf3-48bd-bb00-e33f669381e9","cell_type":"markdown","source":"## compile paper","metadata":{}},{"id":"c281408f-e63d-4380-a7e6-c595d49fbb8f","cell_type":"code","source":"paper_output = wg.add_task(\n compile_paper,\n name=\"compile_paper\",\n macros_tex=macros_tex_file.outputs.result, \n plot_file=pvbatch_output_file.outputs.result,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":12},{"id":"a384d70a-8ef5-4fdd-880c-56ac7eaf87b9","cell_type":"code","source":"wg","metadata":{"trusted":true},"outputs":[{"execution_count":13,"output_type":"execute_result","data":{"text/plain":"NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'wg-nfdi…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":1,"model_id":"9109dbf365a6472fb6b3fa575a12a986"}},"metadata":{}}],"execution_count":13},{"id":"5c1b0200-bba3-484d-ac49-f582898e974f","cell_type":"markdown","source":"# Convert ","metadata":{}},{"id":"196faf18-c46b-4f42-a652-698d2c580221","cell_type":"code","source":"from python_workflow_definition.aiida import write_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":14},{"id":"fb23ad9c-76fd-4c0b-b546-e305d6c49796","cell_type":"code","source":"workflow_json_filename = \"aiida_nfdi.json\"","metadata":{"trusted":true},"outputs":[],"execution_count":15},{"id":"4139547a-9717-4708-b1a5-8202a0382d77","cell_type":"code","source":"write_workflow_json(wg=wg, file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[{"execution_count":16,"output_type":"execute_result","data":{"text/plain":"{'nodes': {'0': 'nfdi_ing_workflow.generate_mesh',\n '1': 'nfdi_ing_workflow.convert_to_xdmf',\n '2': 'nfdi_ing_workflow.poisson',\n '3': 'nfdi_ing_workflow.plot_over_line',\n '4': 'nfdi_ing_workflow.substitute_macros',\n '5': 'nfdi_ing_workflow.compile_paper',\n '6': 2.0},\n 'edges': [{'tn': 1, 'th': 'gmsh_output_file', 'sn': 0, 'sh': None},\n {'tn': 2, 'th': 'meshio_output_xdmf', 'sn': 1, 'sh': 'xdmf_file'},\n {'tn': 2, 'th': 'meshio_output_h5', 'sn': 1, 'sh': 'h5_file'},\n {'tn': 3, 'th': 'poisson_output_pvd_file', 'sn': 2, 'sh': 'pvd_file'},\n {'tn': 3, 'th': 'poisson_output_vtu_file', 'sn': 2, 'sh': 'vtu_file'},\n {'tn': 4, 'th': 'pvbatch_output_file', 'sn': 3, 'sh': None},\n {'tn': 4, 'th': 'ndofs', 'sn': 2, 'sh': 'numdofs'},\n {'tn': 5, 'th': 'macros_tex', 'sn': 4, 'sh': None},\n {'tn': 5, 'th': 'plot_file', 'sn': 3, 'sh': None},\n {'tn': 0, 'th': 'domain_size', 'sn': 6, 'sh': None},\n {'tn': 4, 'th': 'domain_size', 'sn': 6, 'sh': None}]}"},"metadata":{}}],"execution_count":16},{"id":"490df6a3-e402-4620-acf2-dbcfa0c5d537","cell_type":"code","source":"!cat {workflow_json_filename}","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"{\n \"nodes\": {\n \"0\": \"nfdi_ing_workflow.generate_mesh\",\n \"1\": \"nfdi_ing_workflow.convert_to_xdmf\",\n \"2\": \"nfdi_ing_workflow.poisson\",\n \"3\": \"nfdi_ing_workflow.plot_over_line\",\n \"4\": \"nfdi_ing_workflow.substitute_macros\",\n \"5\": \"nfdi_ing_workflow.compile_paper\",\n \"6\": 2.0\n },\n \"edges\": [\n {\n \"tn\": 1,\n \"th\": \"gmsh_output_file\",\n \"sn\": 0,\n \"sh\": null\n },\n {\n \"tn\": 2,\n \"th\": \"meshio_output_xdmf\",\n \"sn\": 1,\n \"sh\": \"xdmf_file\"\n },\n {\n \"tn\": 2,\n \"th\": \"meshio_output_h5\",\n \"sn\": 1,\n \"sh\": \"h5_file\"\n },\n {\n \"tn\": 3,\n \"th\": \"poisson_output_pvd_file\",\n \"sn\": 2,\n \"sh\": \"pvd_file\"\n },\n {\n \"tn\": 3,\n \"th\": \"poisson_output_vtu_file\",\n \"sn\": 2,\n \"sh\": \"vtu_file\"\n },\n {\n \"tn\": 4,\n \"th\": \"pvbatch_output_file\",\n \"sn\": 3,\n \"sh\": null\n },\n {\n \"tn\": 4,\n \"th\": \"ndofs\",\n \"sn\": 2,\n \"sh\": \"numdofs\"\n },\n {\n \"tn\": 5,\n \"th\": \"macros_tex\",\n \"sn\": 4,\n \"sh\": null\n },\n {\n \"tn\": 5,\n \"th\": \"plot_file\",\n \"sn\": 3,\n \"sh\": null\n },\n {\n \"tn\": 0,\n \"th\": \"domain_size\",\n \"sn\": 6,\n \"sh\": null\n },\n {\n \"tn\": 4,\n \"th\": \"domain_size\",\n \"sn\": 6,\n \"sh\": null\n }\n ]\n}"}],"execution_count":17},{"id":"11a829e2-face-469f-b343-2c95763b1f13","cell_type":"markdown","source":"# Load Workflow with jobflow","metadata":{}},{"id":"4f3acabe-55df-479a-af4d-a23a80c4660d","cell_type":"code","source":"from python_workflow_definition.jobflow import load_workflow_json","metadata":{"trusted":true},"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"}],"execution_count":18},{"id":"b6ba9444-a2c8-451b-b74c-19b0f69ba369","cell_type":"code","source":"from jobflow.managers.local import run_locally","metadata":{"trusted":true},"outputs":[],"execution_count":19},{"id":"c3528d55-6bf7-47ed-a110-65c47446ba92","cell_type":"code","source":"flow = load_workflow_json(file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":20},{"id":"5ef48778-4209-425f-8c6b-85a4cd2f92ec","cell_type":"code","source":"result = run_locally(flow)\nresult","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"2025-04-02 14:39:41,684 INFO Started executing jobs locally\n2025-04-02 14:39:42,066 INFO Starting job - generate_mesh (9d3cd286-d36b-4c4b-ab41-5ea2aaf94454)\n2025-04-02 14:39:44,129 INFO Finished job - generate_mesh (9d3cd286-d36b-4c4b-ab41-5ea2aaf94454)\n2025-04-02 14:39:44,129 INFO Starting job - convert_to_xdmf (f8a7da94-38c6-4858-a415-511dfe1d1ebd)\n2025-04-02 14:39:46,031 INFO Finished job - convert_to_xdmf (f8a7da94-38c6-4858-a415-511dfe1d1ebd)\n2025-04-02 14:39:46,032 INFO Starting job - poisson (7a7ff51b-7640-4d27-9c61-c7f782071105)\n2025-04-02 14:39:56,507 INFO Finished job - poisson (7a7ff51b-7640-4d27-9c61-c7f782071105)\n2025-04-02 14:39:56,508 INFO Starting job - plot_over_line (db30575b-8415-49e0-9574-5c067584e4b3)\n2025-04-02 14:39:59,332 INFO Finished job - plot_over_line (db30575b-8415-49e0-9574-5c067584e4b3)\n2025-04-02 14:39:59,333 INFO Starting job - substitute_macros (4dda58c4-a9e4-4ebf-ab9e-7be37f384162)\n2025-04-02 14:40:00,659 INFO Finished job - substitute_macros (4dda58c4-a9e4-4ebf-ab9e-7be37f384162)\n2025-04-02 14:40:00,660 INFO Starting job - compile_paper (8bb76f99-2c92-4bd9-9a04-722632354b82)\n2025-04-02 14:41:18,392 INFO Finished job - compile_paper (8bb76f99-2c92-4bd9-9a04-722632354b82)\n2025-04-02 14:41:18,393 INFO Finished executing jobs locally\n"},{"execution_count":21,"output_type":"execute_result","data":{"text/plain":"{'9d3cd286-d36b-4c4b-ab41-5ea2aaf94454': {1: Response(output='/home/jovyan/preprocessing/square.msh', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n 'f8a7da94-38c6-4858-a415-511dfe1d1ebd': {1: Response(output={'xdmf_file': '/home/jovyan/preprocessing/square.xdmf', 'h5_file': '/home/jovyan/preprocessing/square.h5'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '7a7ff51b-7640-4d27-9c61-c7f782071105': {1: Response(output={'numdofs': 357, 'pvd_file': '/home/jovyan/processing/poisson.pvd', 'vtu_file': '/home/jovyan/processing/poisson000000.vtu'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n 'db30575b-8415-49e0-9574-5c067584e4b3': {1: Response(output='/home/jovyan/postprocessing/plotoverline.csv', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '4dda58c4-a9e4-4ebf-ab9e-7be37f384162': {1: Response(output='/home/jovyan/postprocessing/macros.tex', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '8bb76f99-2c92-4bd9-9a04-722632354b82': {1: Response(output='/home/jovyan/postprocessing/paper.pdf', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))}}"},"metadata":{}}],"execution_count":21},{"id":"397b16a2-e1ec-4eec-8562-1c84f585c347","cell_type":"markdown","source":"# Load Workflow with pyiron_base","metadata":{}},{"id":"fdde6b82-b51d-434a-a9a8-5a8c31bbb429","cell_type":"code","source":"from pyiron_base import Project","metadata":{"trusted":true},"outputs":[],"execution_count":22},{"id":"be4d5d93-e9f6-4072-a6be-0ee5dc93590f","cell_type":"code","source":"from python_workflow_definition.pyiron_base import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":23},{"id":"4db75587-5f4c-416d-a1f6-c949077fa2ca","cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":" 0%| | 0/2 [00:00","image/svg+xml":"\n\n\n\n\ncreate_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\ncreate_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7900d70>\n\n\n\nmacros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\nmacros_tex=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7900b00>\n\n\n\nmacros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2->create_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\n\n\n\n\npvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\npvbatch_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7900800>\n\n\n\npvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\npoisson_output_pvd_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f79004d0>\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a->pvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nplot_file_9d1a9b87944774e4e78d9da968ff99fe\n\nplot_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7900800>\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a->plot_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nplot_file_9d1a9b87944774e4e78d9da968ff99fe->create_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\n\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21\n\nmeshio_output_xdmf=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7ae3e00>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->poisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\npoisson_output_vtu_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f79004a0>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->poisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\n\n\n\n\nndofs_94e80d99bd65f182606d914bcfc69587\n\nndofs=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7900890>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->ndofs_94e80d99bd65f182606d914bcfc69587\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a->pvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a->plot_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nndofs_94e80d99bd65f182606d914bcfc69587->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b\n\ngmsh_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7ae3f80>\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b->meshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da\n\nmeshio_output_h5=<pyiron_base.project.delayed.DelayedObject object at 0x7de7f7ae3ef0>\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b->meshio_output_h5_421c94788b005f01f21c9dff066602da\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->poisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->poisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->ndofs_94e80d99bd65f182606d914bcfc69587\n\n\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20\n\ndomain_size=2.0\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20->gmsh_output_file_27004aae404cc419dd3dc1389fc88f0b\n\n\n\n\n"},"metadata":{}}],"execution_count":25},{"id":"1c2760b6-96b4-4f44-ac49-a229d4a0cf67","cell_type":"code","source":"delayed_object.pull()","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"The job generate_mesh_0b48cf5155cd6802c17d20bb58104132 was saved and received the ID: 1\nThe job convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 was saved and received the ID: 2\nThe job poisson_a0224b23ceb2119d105a5d98ef37f93e was saved and received the ID: 3\nThe job plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b was saved and received the ID: 4\nThe job substitute_macros_874fc185ecec04b4cb9537c58b7efb7b was saved and received the ID: 5\nThe job compile_paper_3cee534ffe692833d37faf1fd2170cb6 was saved and received the ID: 6\n"},{"execution_count":26,"output_type":"execute_result","data":{"text/plain":"'/home/jovyan/postprocessing/paper.pdf'"},"metadata":{}}],"execution_count":26},{"id":"b3bba27e-ece9-4c02-834c-53e69844b140","cell_type":"code","source":"pr.job_table()","metadata":{"trusted":true},"outputs":[{"execution_count":27,"output_type":"execute_result","data":{"text/plain":" id status chemicalformula \\\n0 1 finished None \n1 2 finished None \n2 3 finished None \n3 4 finished None \n4 5 finished None \n5 6 finished None \n\n job \\\n0 generate_mesh_0b48cf5155cd6802c17d20bb58104132 \n1 convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 \n2 poisson_a0224b23ceb2119d105a5d98ef37f93e \n3 plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b \n4 substitute_macros_874fc185ecec04b4cb9537c58b7efb7b \n5 compile_paper_3cee534ffe692833d37faf1fd2170cb6 \n\n subjob projectpath \\\n0 /generate_mesh_0b48cf5155cd6802c17d20bb58104132 None \n1 /convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 None \n2 /poisson_a0224b23ceb2119d105a5d98ef37f93e None \n3 /plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b None \n4 /substitute_macros_874fc185ecec04b4cb9537c58b7efb7b None \n5 /compile_paper_3cee534ffe692833d37faf1fd2170cb6 None \n\n project timestart timestop totalcputime \\\n0 /home/jovyan/test/ 2025-04-02 14:41:18.840654 None None \n1 /home/jovyan/test/ 2025-04-02 14:41:20.508928 None None \n2 /home/jovyan/test/ 2025-04-02 14:41:22.282919 None None \n3 /home/jovyan/test/ 2025-04-02 14:41:25.138286 None None \n4 /home/jovyan/test/ 2025-04-02 14:41:27.295204 None None \n5 /home/jovyan/test/ 2025-04-02 14:41:28.640361 None None \n\n computer \\\n0 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n1 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n2 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n3 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n4 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n5 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n\n hamilton hamversion parentid masterid \n0 PythonFunctionContainerJob 0.4 None None \n1 PythonFunctionContainerJob 0.4 None None \n2 PythonFunctionContainerJob 0.4 None None \n3 PythonFunctionContainerJob 0.4 None None \n4 PythonFunctionContainerJob 0.4 None None \n5 PythonFunctionContainerJob 0.4 None None ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
idstatuschemicalformulajobsubjobprojectpathprojecttimestarttimestoptotalcputimecomputerhamiltonhamversionparentidmasterid
01finishedNonegenerate_mesh_0b48cf5155cd6802c17d20bb58104132/generate_mesh_0b48cf5155cd6802c17d20bb58104132None/home/jovyan/test/2025-04-02 14:41:18.840654NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
12finishedNoneconvert_to_xdmf_29ad6ec6927268429dc9aef8166fde43/convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43None/home/jovyan/test/2025-04-02 14:41:20.508928NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
23finishedNonepoisson_a0224b23ceb2119d105a5d98ef37f93e/poisson_a0224b23ceb2119d105a5d98ef37f93eNone/home/jovyan/test/2025-04-02 14:41:22.282919NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
34finishedNoneplot_over_line_82b37a42e0747f11d9a7f6318f63ac6b/plot_over_line_82b37a42e0747f11d9a7f6318f63ac6bNone/home/jovyan/test/2025-04-02 14:41:25.138286NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
45finishedNonesubstitute_macros_874fc185ecec04b4cb9537c58b7efb7b/substitute_macros_874fc185ecec04b4cb9537c58b7efb7bNone/home/jovyan/test/2025-04-02 14:41:27.295204NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
56finishedNonecompile_paper_3cee534ffe692833d37faf1fd2170cb6/compile_paper_3cee534ffe692833d37faf1fd2170cb6None/home/jovyan/test/2025-04-02 14:41:28.640361NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
\n
"},"metadata":{}}],"execution_count":27}]} \ No newline at end of file diff --git a/aiida_simple.ipynb b/aiida_simple.ipynb index a3d4c8f..740f066 100644 --- a/aiida_simple.ipynb +++ b/aiida_simple.ipynb @@ -1,503 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Simple Workflow with aiida" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Define workflow with aiida" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import write_workflow_json\n", - "\n", - "from aiida_workgraph import WorkGraph, task\n", - "from aiida import orm, load_profile\n", - "load_profile()\n", - "\n", - "workflow_json_filename = \"aiida_simple.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "from simple_workflow import add_x_and_y as _add_x_and_y\n", - "from simple_workflow import add_x_and_y_and_z" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "add_x_and_y = task(outputs=['x', 'y', 'z'])(_add_x_and_y)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "wg = WorkGraph(\"wg-simple\")" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "add_x_and_y_task = wg.add_task(\n", - " add_x_and_y,\n", - " name=\"add_x_and_y\",\n", - " x=orm.Int(1),\n", - " y=orm.Int(2),\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "add_x_and_y_and_z_task = wg.add_task(\n", - " add_x_and_y_and_z,\n", - " name=\"add_x_and_y_and_z\",\n", - " x=add_x_and_y_task.outputs.x,\n", - " y=add_x_and_y_task.outputs.y,\n", - " z=add_x_and_y_task.outputs.z,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "data": { - "text/plain": [ - "{'nodes': {'0': 'simple_workflow.add_x_and_y',\n", - " '1': 'simple_workflow.add_x_and_y_and_z',\n", - " '2': 1,\n", - " '3': 2},\n", - " 'edges': [{'tn': 1, 'th': 'x', 'sn': 0, 'sh': 'x'},\n", - " {'tn': 1, 'th': 'y', 'sn': 0, 'sh': 'y'},\n", - " {'tn': 1, 'th': 'z', 'sn': 0, 'sh': 'z'},\n", - " {'tn': 0, 'th': 'x', 'sn': 2, 'sh': None},\n", - " {'tn': 0, 'th': 'y', 'sn': 3, 'sh': None}]}" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "write_workflow_json(wg=wg, file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[38;5;238m───────┬────────────────────────────────────────────────────────────────────────\u001b[0m\n", - " \u001b[38;5;238m│ \u001b[0mFile: \u001b[1maiida_to_jobflow_simple.json\u001b[0m\n", - "\u001b[38;5;238m───────┼────────────────────────────────────────────────────────────────────────\u001b[0m\n", - "\u001b[38;5;238m 1\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 2\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mnodes\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 3\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m0\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186msimple_workflow.add_x_and_y\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 4\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m1\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186msimple_workflow.add_x_and_y_and_z\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 5\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m2\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m1\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 6\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m3\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m2\u001b[0m\n", - "\u001b[38;5;238m 7\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 8\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208medges\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;231m[\u001b[0m\n", - "\u001b[38;5;238m 9\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 10\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mtn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m1\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 11\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mth\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mx\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 12\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m0\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 13\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msh\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mx\u001b[0m\u001b[38;5;186m\"\u001b[0m\n", - "\u001b[38;5;238m 14\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 15\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 16\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mtn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m1\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 17\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mth\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186my\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 18\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m0\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 19\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msh\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186my\u001b[0m\u001b[38;5;186m\"\u001b[0m\n", - "\u001b[38;5;238m 20\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 21\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 22\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mtn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m1\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 23\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mth\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mz\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 24\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m0\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 25\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msh\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mz\u001b[0m\u001b[38;5;186m\"\u001b[0m\n", - "\u001b[38;5;238m 26\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 27\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 28\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mtn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m0\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 29\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mth\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mx\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 30\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m2\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 31\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msh\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141mnull\u001b[0m\n", - "\u001b[38;5;238m 32\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 33\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\n", - "\u001b[38;5;238m 34\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mtn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m0\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 35\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mth\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186my\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 36\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msn\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141m3\u001b[0m\u001b[38;5;231m,\u001b[0m\n", - "\u001b[38;5;238m 37\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208msh\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;141mnull\u001b[0m\n", - "\u001b[38;5;238m 38\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m}\u001b[0m\n", - "\u001b[38;5;238m 39\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m \u001b[0m\u001b[38;5;231m]\u001b[0m\n", - "\u001b[38;5;238m 40\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m}\u001b[0m\n", - "\u001b[38;5;238m───────┴────────────────────────────────────────────────────────────────────────\u001b[0m\n" - ] - } - ], - "source": [ - "!cat {workflow_json_filename}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load Workflow with jobflow" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.\n", - " \"cipher\": algorithms.TripleDES,\n", - "/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.\n", - " \"class\": algorithms.TripleDES,\n" - ] - } - ], - "source": [ - "from python_workflow_definition.jobflow import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "from jobflow.managers.local import run_locally" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "flow = load_workflow_json(file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2025-04-02 14:22:25,312 INFO Started executing jobs locally\n", - "2025-04-02 14:22:25,474 INFO Starting job - add_x_and_y (064f2b60-33e7-4cee-b5cd-c35156989e6f)\n", - "2025-04-02 14:22:25,476 INFO Finished job - add_x_and_y (064f2b60-33e7-4cee-b5cd-c35156989e6f)\n", - "2025-04-02 14:22:25,477 INFO Starting job - add_x_and_y_and_z (287a5309-63df-4256-ba6b-4bd56ee20881)\n", - "2025-04-02 14:22:25,479 INFO Finished job - add_x_and_y_and_z (287a5309-63df-4256-ba6b-4bd56ee20881)\n", - "2025-04-02 14:22:25,479 INFO Finished executing jobs locally\n" - ] - }, - { - "data": { - "text/plain": [ - "{'064f2b60-33e7-4cee-b5cd-c35156989e6f': {1: Response(output={'x': 1, 'y': 2, 'z': 3}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/geiger_j/aiida_projects/adis/git-repos/python-workflow-definition'))},\n", - " '287a5309-63df-4256-ba6b-4bd56ee20881': {1: Response(output=6, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/geiger_j/aiida_projects/adis/git-repos/python-workflow-definition'))}}" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result = run_locally(flow)\n", - "result" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load Workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "from pyiron_base import Project" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "trusted": true - }, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "1621d094918943178c0a712c147c25af", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - " 0%| | 0/2 [00:00\n", - "\n", - "\n", - "\n", - "\n", - "create_function_job_c7d5a2eaf006faed5e048478186e5006\n", - "\n", - "create_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x71a5dafa0790>\n", - "\n", - "\n", - "\n", - "x_72c4a551025d57f72dca17727aef044e\n", - "\n", - "x=<pyiron_base.project.delayed.DelayedObject object at 0x71a5dafa0100>\n", - "\n", - "\n", - "\n", - "x_72c4a551025d57f72dca17727aef044e->create_function_job_c7d5a2eaf006faed5e048478186e5006\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce\n", - "\n", - "x=1\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->x_72c4a551025d57f72dca17727aef044e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_454d7f4e4b54021d3386dcdafb7344ee\n", - "\n", - "y=<pyiron_base.project.delayed.DelayedObject object at 0x71a5dafa0130>\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->y_454d7f4e4b54021d3386dcdafb7344ee\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "z_7b1d0ad3687984f980950fa9864be0fd\n", - "\n", - "z=<pyiron_base.project.delayed.DelayedObject object at 0x71a5dafa00a0>\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->z_7b1d0ad3687984f980950fa9864be0fd\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_454d7f4e4b54021d3386dcdafb7344ee->create_function_job_c7d5a2eaf006faed5e048478186e5006\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "z_7b1d0ad3687984f980950fa9864be0fd->create_function_job_c7d5a2eaf006faed5e048478186e5006\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6\n", - "\n", - "y=2\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->x_72c4a551025d57f72dca17727aef044e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->y_454d7f4e4b54021d3386dcdafb7344ee\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->z_7b1d0ad3687984f980950fa9864be0fd\n", - "\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\n", - "delayed_object.draw()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "trusted": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The job add_x_and_y_68901482a2c5221cc845f828aabebd27 was saved and received the ID: 2\n", - "The job add_x_and_y_and_z_b671e81aaa4670d81d7eee509650af8d was saved and received the ID: 3\n" - ] - }, - { - "data": { - "text/plain": [ - "6" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "delayed_object.pull()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.8" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.12.8"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Simple Workflow with aiida","metadata":{}},{"cell_type":"markdown","source":"## Define workflow with aiida","metadata":{}},{"cell_type":"code","source":"from python_workflow_definition.aiida import write_workflow_json\n\nfrom aiida_workgraph import WorkGraph, task\nfrom aiida import orm, load_profile\nload_profile()\n\nworkflow_json_filename = \"aiida_simple.json\"","metadata":{"trusted":true},"outputs":[],"execution_count":1},{"cell_type":"code","source":"from simple_workflow import add_x_and_y as _add_x_and_y\nfrom simple_workflow import add_x_and_y_and_z","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"cell_type":"code","source":"add_x_and_y = task(outputs=['x', 'y', 'z'])(_add_x_and_y)","metadata":{"trusted":true},"outputs":[],"execution_count":3},{"cell_type":"code","source":"wg = WorkGraph(\"wg-simple\")","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"cell_type":"code","source":"add_x_and_y_task = wg.add_task(\n add_x_and_y,\n name=\"add_x_and_y\",\n x=orm.Int(1),\n y=orm.Int(2),\n)","metadata":{"trusted":true},"outputs":[],"execution_count":5},{"cell_type":"code","source":"add_x_and_y_and_z_task = wg.add_task(\n add_x_and_y_and_z,\n name=\"add_x_and_y_and_z\",\n x=add_x_and_y_task.outputs.x,\n y=add_x_and_y_task.outputs.y,\n z=add_x_and_y_task.outputs.z,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":6},{"cell_type":"code","source":"write_workflow_json(wg=wg, file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[{"data":{"text/plain":"{'nodes': {'0': 'simple_workflow.add_x_and_y',\n '1': 'simple_workflow.add_x_and_y_and_z',\n '2': 1,\n '3': 2},\n 'edges': [{'tn': 1, 'th': 'x', 'sn': 0, 'sh': 'x'},\n {'tn': 1, 'th': 'y', 'sn': 0, 'sh': 'y'},\n {'tn': 1, 'th': 'z', 'sn': 0, 'sh': 'z'},\n {'tn': 0, 'th': 'x', 'sn': 2, 'sh': None},\n {'tn': 0, 'th': 'y', 'sn': 3, 'sh': None}]}"},"execution_count":7,"metadata":{},"output_type":"execute_result"}],"execution_count":7},{"cell_type":"code","source":"!cat {workflow_json_filename}","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"{\n \"nodes\": {\n \"0\": \"simple_workflow.add_x_and_y\",\n \"1\": \"simple_workflow.add_x_and_y_and_z\",\n \"2\": 1,\n \"3\": 2\n },\n \"edges\": [\n {\n \"tn\": 1,\n \"th\": \"x\",\n \"sn\": 0,\n \"sh\": \"x\"\n },\n {\n \"tn\": 1,\n \"th\": \"y\",\n \"sn\": 0,\n \"sh\": \"y\"\n },\n {\n \"tn\": 1,\n \"th\": \"z\",\n \"sn\": 0,\n \"sh\": \"z\"\n },\n {\n \"tn\": 0,\n \"th\": \"x\",\n \"sn\": 2,\n \"sh\": null\n },\n {\n \"tn\": 0,\n \"th\": \"y\",\n \"sn\": 3,\n \"sh\": null\n }\n ]\n}"}],"execution_count":8},{"cell_type":"markdown","source":"## Load Workflow with jobflow","metadata":{}},{"cell_type":"code","source":"from python_workflow_definition.jobflow import load_workflow_json","metadata":{"trusted":true},"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"}],"execution_count":9},{"cell_type":"code","source":"from jobflow.managers.local import run_locally","metadata":{"trusted":true},"outputs":[],"execution_count":10},{"cell_type":"code","source":"flow = load_workflow_json(file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":11},{"cell_type":"code","source":"result = run_locally(flow)\nresult","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"2025-04-02 14:36:37,425 INFO Started executing jobs locally\n2025-04-02 14:36:37,751 INFO Starting job - add_x_and_y (4bcb90c8-2c19-4981-a88e-56d5d24b5df9)\n2025-04-02 14:36:37,754 INFO Finished job - add_x_and_y (4bcb90c8-2c19-4981-a88e-56d5d24b5df9)\n2025-04-02 14:36:37,755 INFO Starting job - add_x_and_y_and_z (88bc90e5-09a0-443d-b24e-673cc6bc0819)\n2025-04-02 14:36:37,756 INFO Finished job - add_x_and_y_and_z (88bc90e5-09a0-443d-b24e-673cc6bc0819)\n2025-04-02 14:36:37,756 INFO Finished executing jobs locally\n"},{"data":{"text/plain":"{'4bcb90c8-2c19-4981-a88e-56d5d24b5df9': {1: Response(output={'x': 1, 'y': 2, 'z': 3}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '88bc90e5-09a0-443d-b24e-673cc6bc0819': {1: Response(output=6, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))}}"},"execution_count":12,"metadata":{},"output_type":"execute_result"}],"execution_count":12},{"cell_type":"markdown","source":"## Load Workflow with pyiron_base","metadata":{}},{"cell_type":"code","source":"from pyiron_base import Project","metadata":{"trusted":true},"outputs":[],"execution_count":13},{"cell_type":"code","source":"from python_workflow_definition.pyiron_base import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":14},{"cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"278f490ab20c4eaf9d39a75a7ee5231d","version_major":2,"version_minor":0},"text/plain":"0it [00:00, ?it/s]"},"metadata":{},"output_type":"display_data"}],"execution_count":15},{"cell_type":"code","source":"delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\ndelayed_object.draw()","metadata":{"trusted":true},"outputs":[{"data":{"image/svg+xml":"\n\n\n\n\ncreate_function_job_988efa8422518ba29903b66c63607fb8\n\ncreate_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x71606f71f740>\n\n\n\nx_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\nx=<pyiron_base.project.delayed.DelayedObject object at 0x71606f6efa70>\n\n\n\nx_b8003ea81f8e4a9bdbfd3b4eb1e68e2b->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce\n\nx=1\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->x_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\n\n\n\n\ny_f60ae41b1c92823db71999ac596241ab\n\ny=<pyiron_base.project.delayed.DelayedObject object at 0x71606f71f6e0>\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->y_f60ae41b1c92823db71999ac596241ab\n\n\n\n\n\nz_a926da40ec18154feb3f3bb147af8220\n\nz=<pyiron_base.project.delayed.DelayedObject object at 0x71606f71f2f0>\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->z_a926da40ec18154feb3f3bb147af8220\n\n\n\n\n\ny_f60ae41b1c92823db71999ac596241ab->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\nz_a926da40ec18154feb3f3bb147af8220->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6\n\ny=2\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->x_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->y_f60ae41b1c92823db71999ac596241ab\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->z_a926da40ec18154feb3f3bb147af8220\n\n\n\n\n","text/plain":""},"metadata":{},"output_type":"display_data"}],"execution_count":16},{"cell_type":"code","source":"delayed_object.pull()","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"The job add_x_and_y_68901482a2c5221cc845f828aabebd27 was saved and received the ID: 1\nThe job add_x_and_y_and_z_b671e81aaa4670d81d7eee509650af8d was saved and received the ID: 2\n"},{"data":{"text/plain":"6"},"execution_count":17,"metadata":{},"output_type":"execute_result"}],"execution_count":17}]} \ No newline at end of file diff --git a/jobflow_nfdi.ipynb b/jobflow_nfdi.ipynb index b36be26..200a365 100644 --- a/jobflow_nfdi.ipynb +++ b/jobflow_nfdi.ipynb @@ -1,873 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "106ded66-d202-46ac-82b0-2755ca309bdd", - "metadata": {}, - "source": [ - "https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "6d86e804-245a-4d96-a1a3-1bc3216c3646", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "# conda environments:\n", - "#\n", - "base * /home/janssen/mambaforge\n", - "postprocessing /home/janssen/mambaforge/envs/postprocessing\n", - "preprocessing /home/janssen/mambaforge/envs/preprocessing\n", - "processing /home/janssen/mambaforge/envs/processing\n", - "\n" - ] - } - ], - "source": [ - "!conda env list" - ] - }, - { - "cell_type": "markdown", - "id": "11e09b78-cb72-465f-9c8b-5b77f0aa729c", - "metadata": {}, - "source": [ - "# Preprocessing " - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "a76e6c0a-98f2-4436-af10-8097da183341", - "metadata": {}, - "outputs": [], - "source": [ - "from nfdi_ing_workflow import (\n", - " generate_mesh as _generate_mesh, \n", - " convert_to_xdmf as _convert_to_xdmf,\n", - " poisson as _poisson,\n", - " plot_over_line as _plot_over_line,\n", - " substitute_macros as _substitute_macros,\n", - " compile_paper as _compile_paper,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "89c02460-b543-442c-a27e-f1757dc2262e", - "metadata": {}, - "outputs": [], - "source": [ - "from jobflow import job, Flow" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "549ecf27-88ef-4e77-8bd4-b616cfdda2e4", - "metadata": {}, - "outputs": [], - "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", - "plot_over_line = job(_plot_over_line)\n", - "substitute_macros = job(_substitute_macros)\n", - "compile_paper = job(_compile_paper)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "8d911f98-3b80-457f-a0f4-3cb37ebf1691", - "metadata": {}, - "outputs": [], - "source": [ - "domain_size = 2.0" - ] - }, - { - "cell_type": "markdown", - "id": "cf1e22d2-9ce5-488f-8048-308d7d5d4966", - "metadata": {}, - "source": [ - "## generate mesh" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "71d411b6-cbec-489e-99e3-ba71680bcb5b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "gmsh_output_file = generate_mesh(\n", - " domain_size=domain_size,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "019938e7-8b41-47a9-b226-00e05dabc193", - "metadata": {}, - "source": [ - "## convert to xdmf" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "1d0d9804-f250-48b3-a5d0-a546d520f79b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "meshio_output_dict = convert_to_xdmf(\n", - " gmsh_output_file=gmsh_output_file.output,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "ceb0b643-caaa-426c-9781-28703440e647", - "metadata": {}, - "source": [ - "# Processing" - ] - }, - { - "cell_type": "markdown", - "id": "11815a8b-319c-4ff3-8eae-330bf6e58eee", - "metadata": {}, - "source": [ - "## poisson" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "7b69bcff-e2b1-4d4a-b62c-6a1c86eeb590", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "poisson_dict = poisson(\n", - " meshio_output_xdmf=meshio_output_dict.output.xdmf_file, \n", - " meshio_output_h5=meshio_output_dict.output.h5_file,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "bc8a8634-029e-4337-96a2-a1f284cb4c38", - "metadata": {}, - "source": [ - "# Postprocessing" - ] - }, - { - "cell_type": "markdown", - "id": "157c5386-91a3-4e21-ac65-8f947f2d62fa", - "metadata": {}, - "source": [ - "## plot over line" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "3c4a29b0-eb1e-490a-8be0-e03cfff15e0a", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "pvbatch_output_file = plot_over_line(\n", - " poisson_output_pvd_file=poisson_dict.output.pvd_file, \n", - " poisson_output_vtu_file=poisson_dict.output.vtu_file,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "54f1d4bd-b944-470f-9cf8-30e64a24eb6d", - "metadata": {}, - "source": [ - "## substitute macros" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "a0a4c233-322d-4723-9627-62ca2487bfa9", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "macros_tex_file = substitute_macros( \n", - " pvbatch_output_file=pvbatch_output_file.output, \n", - " ndofs=poisson_dict.output.numdofs, \n", - " domain_size=domain_size,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "2031b693-acf3-48bd-bb00-e33f669381e9", - "metadata": {}, - "source": [ - "## compile paper" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "c281408f-e63d-4380-a7e6-c595d49fbb8f", - "metadata": {}, - "outputs": [], - "source": [ - "paper_output = compile_paper(\n", - " macros_tex=macros_tex_file.output, \n", - " plot_file=pvbatch_output_file.output,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "a384d70a-8ef5-4fdd-880c-56ac7eaf87b9", - "metadata": {}, - "outputs": [], - "source": [ - "flow = Flow([gmsh_output_file, meshio_output_dict, poisson_dict, pvbatch_output_file, macros_tex_file, paper_output])" - ] - }, - { - "cell_type": "markdown", - "id": "5c1b0200-bba3-484d-ac49-f582898e974f", - "metadata": {}, - "source": [ - "# Convert " - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "196faf18-c46b-4f42-a652-698d2c580221", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.jobflow import write_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "fb23ad9c-76fd-4c0b-b546-e305d6c49796", - "metadata": {}, - "outputs": [], - "source": [ - "workflow_json_filename = \"jobflow_nfdi.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "4139547a-9717-4708-b1a5-8202a0382d77", - "metadata": {}, - "outputs": [], - "source": [ - "write_workflow_json(flow=flow, file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "markdown", - "id": "11a829e2-face-469f-b343-2c95763b1f13", - "metadata": {}, - "source": [ - "# Load Workflow with aiida" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4f3acabe-55df-479a-af4d-a23a80c4660d", - "metadata": {}, - "outputs": [], - "source": [ - "from aiida import load_profile\n", - "\n", - "load_profile()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b6ba9444-a2c8-451b-b74c-19b0f69ba369", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c3528d55-6bf7-47ed-a110-65c47446ba92", - "metadata": {}, - "outputs": [], - "source": [ - "wg = load_workflow_json(file_name=workflow_json_filename)\n", - "wg" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5ef48778-4209-425f-8c6b-85a4cd2f92ec", - "metadata": {}, - "outputs": [], - "source": [ - "wg.run()" - ] - }, - { - "cell_type": "markdown", - "id": "397b16a2-e1ec-4eec-8562-1c84f585c347", - "metadata": {}, - "source": [ - "# Load Workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "fdde6b82-b51d-434a-a9a8-5a8c31bbb429", - "metadata": {}, - "outputs": [], - "source": [ - "from pyiron_base import Project" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "be4d5d93-e9f6-4072-a6be-0ee5dc93590f", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "4db75587-5f4c-416d-a1f6-c949077fa2ca", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "b5c4c082a18b4d5391aac8dd470570d5", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "0it [00:00, ?it/s]" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "pr = Project(\"test\")\n", - "pr.remove_jobs(recursive=True, silently=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "4452a648-d4c3-4f5f-8678-ffb54bef17dc", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "create_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4ab70>\n", - "\n", - "\n", - "\n", - "macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "macros_tex=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a8d0>\n", - "\n", - "\n", - "\n", - "macros_tex_f8e7c70add5a6917362eaba96348676f->create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "pvbatch_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a570>\n", - "\n", - "\n", - "\n", - "pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "poisson_output_pvd_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a1e0>\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973->pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "plot_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a570>\n", - "\n", - "\n", - "\n", - "poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973->plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "plot_file_a227e82a0cabcaa4ff69b537232c3daf->create_function_job_19ee2cba4a6ec0c97eab519834ce2c6b\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d\n", - "\n", - "meshio_output_xdmf=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49dc0>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "poisson_output_vtu_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a090>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "ndofs=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d4a600>\n", - "\n", - "\n", - "\n", - "meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d->ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3->pvbatch_output_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3->plot_file_a227e82a0cabcaa4ff69b537232c3daf\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "ndofs_af456a32dc17ccd053cef8f83b61802e->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3\n", - "\n", - "gmsh_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49af0>\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3->meshio_output_xdmf_5f6efd392b1691367349ce93caf0169d\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081\n", - "\n", - "meshio_output_h5=<pyiron_base.project.delayed.DelayedObject object at 0x7de8d9d49a30>\n", - "\n", - "\n", - "\n", - "gmsh_output_file_b41125ac47f34334493d860607ee71a3->meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->poisson_output_pvd_file_3d7237a32c9c37d58bcde272202eb973\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->poisson_output_vtu_file_6970a46dfc05b1a19e5634d8c18059e3\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "meshio_output_h5_d7fa661d88a4ddaa49c65aba59c05081->ndofs_af456a32dc17ccd053cef8f83b61802e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20\n", - "\n", - "domain_size=2.0\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20->macros_tex_f8e7c70add5a6917362eaba96348676f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "domain_size_f12a7f1986b9dd058dfc666dbe230b20->gmsh_output_file_b41125ac47f34334493d860607ee71a3\n", - "\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\n", - "delayed_object.draw()" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "1c2760b6-96b4-4f44-ac49-a229d4a0cf67", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The job generate_mesh_0b48cf5155cd6802c17d20bb58104132 was saved and received the ID: 2005\n", - "The job convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae was saved and received the ID: 2006\n", - "The job poisson_2d98621ac2c8e43a266693cf65647173 was saved and received the ID: 2007\n", - "The job plot_over_line_004790462b53a54f512cc7e1a2a10519 was saved and received the ID: 2008\n", - "The job substitute_macros_52130ff9ec1931ec82532a7119df653f was saved and received the ID: 2009\n", - "The job compile_paper_b65627cdc212fc76a216689a26379fae was saved and received the ID: 2010\n" - ] - }, - { - "data": { - "text/plain": [ - "'/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/postprocessing/paper.pdf'" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "delayed_object.pull()" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "b3bba27e-ece9-4c02-834c-53e69844b140", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idstatuschemicalformulajobsubjobprojectpathprojecttimestarttimestoptotalcputimecomputerhamiltonhamversionparentidmasterid
02005finishedNonegenerate_mesh_0b48cf5155cd6802c17d20bb58104132/generate_mesh_0b48cf5155cd6802c17d20bb58104132None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:38.490191NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
12006finishedNoneconvert_to_xdmf_9ded0361e4866afe4962398287e4f6ae/convert_to_xdmf_9ded0361e4866afe4962398287e4f6aeNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:45.247485NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
22007finishedNonepoisson_2d98621ac2c8e43a266693cf65647173/poisson_2d98621ac2c8e43a266693cf65647173None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:02:52.878817NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
32008finishedNoneplot_over_line_004790462b53a54f512cc7e1a2a10519/plot_over_line_004790462b53a54f512cc7e1a2a10519None/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:02.977300NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
42009finishedNonesubstitute_macros_52130ff9ec1931ec82532a7119df653f/substitute_macros_52130ff9ec1931ec82532a7119df653fNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:10.674995NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
52010finishedNonecompile_paper_b65627cdc212fc76a216689a26379fae/compile_paper_b65627cdc212fc76a216689a26379faeNone/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/2025-04-02 15:03:16.820860NoneNonepyiron@cmpc06#1PythonFunctionContainerJob0.4NoneNone
\n", - "
" - ], - "text/plain": [ - " id status chemicalformula \\\n", - "0 2005 finished None \n", - "1 2006 finished None \n", - "2 2007 finished None \n", - "3 2008 finished None \n", - "4 2009 finished None \n", - "5 2010 finished None \n", - "\n", - " job \\\n", - "0 generate_mesh_0b48cf5155cd6802c17d20bb58104132 \n", - "1 convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae \n", - "2 poisson_2d98621ac2c8e43a266693cf65647173 \n", - "3 plot_over_line_004790462b53a54f512cc7e1a2a10519 \n", - "4 substitute_macros_52130ff9ec1931ec82532a7119df653f \n", - "5 compile_paper_b65627cdc212fc76a216689a26379fae \n", - "\n", - " subjob projectpath \\\n", - "0 /generate_mesh_0b48cf5155cd6802c17d20bb58104132 None \n", - "1 /convert_to_xdmf_9ded0361e4866afe4962398287e4f6ae None \n", - "2 /poisson_2d98621ac2c8e43a266693cf65647173 None \n", - "3 /plot_over_line_004790462b53a54f512cc7e1a2a10519 None \n", - "4 /substitute_macros_52130ff9ec1931ec82532a7119df653f None \n", - "5 /compile_paper_b65627cdc212fc76a216689a26379fae None \n", - "\n", - " project \\\n", - "0 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "1 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "2 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "3 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "4 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "5 /home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/test/ \n", - "\n", - " timestart timestop totalcputime computer \\\n", - "0 2025-04-02 15:02:38.490191 None None pyiron@cmpc06#1 \n", - "1 2025-04-02 15:02:45.247485 None None pyiron@cmpc06#1 \n", - "2 2025-04-02 15:02:52.878817 None None pyiron@cmpc06#1 \n", - "3 2025-04-02 15:03:02.977300 None None pyiron@cmpc06#1 \n", - "4 2025-04-02 15:03:10.674995 None None pyiron@cmpc06#1 \n", - "5 2025-04-02 15:03:16.820860 None None pyiron@cmpc06#1 \n", - "\n", - " hamilton hamversion parentid masterid \n", - "0 PythonFunctionContainerJob 0.4 None None \n", - "1 PythonFunctionContainerJob 0.4 None None \n", - "2 PythonFunctionContainerJob 0.4 None None \n", - "3 PythonFunctionContainerJob 0.4 None None \n", - "4 PythonFunctionContainerJob 0.4 None None \n", - "5 PythonFunctionContainerJob 0.4 None None " - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pr.job_table()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":5,"nbformat":4,"cells":[{"id":"106ded66-d202-46ac-82b0-2755ca309bdd","cell_type":"markdown","source":"https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements","metadata":{}},{"id":"6d86e804-245a-4d96-a1a3-1bc3216c3646","cell_type":"code","source":"!conda env list","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"\n# conda environments:\n#\nbase /srv/conda\nnotebook * /srv/conda/envs/notebook\npostprocessing /srv/conda/envs/postprocessing\npreprocessing /srv/conda/envs/preprocessing\nprocessing /srv/conda/envs/processing\n\n"}],"execution_count":1},{"id":"11e09b78-cb72-465f-9c8b-5b77f0aa729c","cell_type":"markdown","source":"# Preprocessing ","metadata":{}},{"id":"a76e6c0a-98f2-4436-af10-8097da183341","cell_type":"code","source":"from nfdi_ing_workflow import (\n generate_mesh as _generate_mesh, \n convert_to_xdmf as _convert_to_xdmf,\n poisson as _poisson,\n plot_over_line as _plot_over_line,\n substitute_macros as _substitute_macros,\n compile_paper as _compile_paper,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"id":"89c02460-b543-442c-a27e-f1757dc2262e","cell_type":"code","source":"from jobflow import job, Flow","metadata":{"trusted":true},"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"}],"execution_count":3},{"id":"549ecf27-88ef-4e77-8bd4-b616cfdda2e4","cell_type":"code","source":"generate_mesh = job(_generate_mesh)\nconvert_to_xdmf = job(_convert_to_xdmf, data=[\"xdmf_file\", \"h5_file\"])\npoisson = job(_poisson, data=[\"numdofs\", \"pvd_file\", \"vtu_file\"])\nplot_over_line = job(_plot_over_line)\nsubstitute_macros = job(_substitute_macros)\ncompile_paper = job(_compile_paper)","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"id":"8d911f98-3b80-457f-a0f4-3cb37ebf1691","cell_type":"code","source":"domain_size = 2.0","metadata":{"trusted":true},"outputs":[],"execution_count":5},{"id":"cf1e22d2-9ce5-488f-8048-308d7d5d4966","cell_type":"markdown","source":"## generate mesh","metadata":{}},{"id":"71d411b6-cbec-489e-99e3-ba71680bcb5b","cell_type":"code","source":"gmsh_output_file = generate_mesh(\n domain_size=domain_size,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":6},{"id":"019938e7-8b41-47a9-b226-00e05dabc193","cell_type":"markdown","source":"## convert to xdmf","metadata":{}},{"id":"1d0d9804-f250-48b3-a5d0-a546d520f79b","cell_type":"code","source":"meshio_output_dict = convert_to_xdmf(\n gmsh_output_file=gmsh_output_file.output,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":7},{"id":"ceb0b643-caaa-426c-9781-28703440e647","cell_type":"markdown","source":"# Processing","metadata":{}},{"id":"11815a8b-319c-4ff3-8eae-330bf6e58eee","cell_type":"markdown","source":"## poisson","metadata":{}},{"id":"7b69bcff-e2b1-4d4a-b62c-6a1c86eeb590","cell_type":"code","source":"poisson_dict = poisson(\n meshio_output_xdmf=meshio_output_dict.output.xdmf_file, \n meshio_output_h5=meshio_output_dict.output.h5_file,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":8},{"id":"bc8a8634-029e-4337-96a2-a1f284cb4c38","cell_type":"markdown","source":"# Postprocessing","metadata":{}},{"id":"157c5386-91a3-4e21-ac65-8f947f2d62fa","cell_type":"markdown","source":"## plot over line","metadata":{}},{"id":"3c4a29b0-eb1e-490a-8be0-e03cfff15e0a","cell_type":"code","source":"pvbatch_output_file = plot_over_line(\n poisson_output_pvd_file=poisson_dict.output.pvd_file, \n poisson_output_vtu_file=poisson_dict.output.vtu_file,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":9},{"id":"54f1d4bd-b944-470f-9cf8-30e64a24eb6d","cell_type":"markdown","source":"## substitute macros","metadata":{}},{"id":"a0a4c233-322d-4723-9627-62ca2487bfa9","cell_type":"code","source":"macros_tex_file = substitute_macros( \n pvbatch_output_file=pvbatch_output_file.output, \n ndofs=poisson_dict.output.numdofs, \n domain_size=domain_size,\n)","metadata":{"tags":[],"trusted":true},"outputs":[],"execution_count":10},{"id":"2031b693-acf3-48bd-bb00-e33f669381e9","cell_type":"markdown","source":"## compile paper","metadata":{}},{"id":"c281408f-e63d-4380-a7e6-c595d49fbb8f","cell_type":"code","source":"paper_output = compile_paper(\n macros_tex=macros_tex_file.output, \n plot_file=pvbatch_output_file.output,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":11},{"id":"a384d70a-8ef5-4fdd-880c-56ac7eaf87b9","cell_type":"code","source":"flow = Flow([gmsh_output_file, meshio_output_dict, poisson_dict, pvbatch_output_file, macros_tex_file, paper_output])","metadata":{"trusted":true},"outputs":[],"execution_count":12},{"id":"5c1b0200-bba3-484d-ac49-f582898e974f","cell_type":"markdown","source":"# Convert ","metadata":{}},{"id":"196faf18-c46b-4f42-a652-698d2c580221","cell_type":"code","source":"from python_workflow_definition.jobflow import write_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":13},{"id":"fb23ad9c-76fd-4c0b-b546-e305d6c49796","cell_type":"code","source":"workflow_json_filename = \"jobflow_nfdi.json\"","metadata":{"trusted":true},"outputs":[],"execution_count":14},{"id":"4139547a-9717-4708-b1a5-8202a0382d77","cell_type":"code","source":"write_workflow_json(flow=flow, file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":15},{"id":"11a829e2-face-469f-b343-2c95763b1f13","cell_type":"markdown","source":"# Load Workflow with aiida","metadata":{}},{"id":"4f3acabe-55df-479a-af4d-a23a80c4660d","cell_type":"code","source":"from aiida import load_profile\n\nload_profile()","metadata":{"trusted":true},"outputs":[{"execution_count":16,"output_type":"execute_result","data":{"text/plain":"Profile"},"metadata":{}}],"execution_count":16},{"id":"b6ba9444-a2c8-451b-b74c-19b0f69ba369","cell_type":"code","source":"from python_workflow_definition.aiida import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":17},{"id":"c3528d55-6bf7-47ed-a110-65c47446ba92","cell_type":"code","source":"wg = load_workflow_json(file_name=workflow_json_filename)\nwg","metadata":{"trusted":true},"outputs":[{"execution_count":18,"output_type":"execute_result","data":{"text/plain":"NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":1,"model_id":"db4b999e32234a12aa20455fa046dea5"}},"metadata":{}}],"execution_count":18},{"id":"5ef48778-4209-425f-8c6b-85a4cd2f92ec","cell_type":"code","source":"wg.run()","metadata":{"trusted":true},"outputs":[{"name":"stderr","output_type":"stream","text":"04/02/2025 02:41:56 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: generate_mesh1\n04/02/2025 02:41:58 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: generate_mesh1, type: PyFunction, finished.\n04/02/2025 02:41:58 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: convert_to_xdmf2\n04/02/2025 02:42:01 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: convert_to_xdmf2, type: PyFunction, finished.\n04/02/2025 02:42:01 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: poisson3\n04/02/2025 02:42:05 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: poisson3, type: PyFunction, finished.\n04/02/2025 02:42:05 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: plot_over_line4\n04/02/2025 02:42:07 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: plot_over_line4, type: PyFunction, finished.\n04/02/2025 02:42:07 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: substitute_macros5\n04/02/2025 02:42:09 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: substitute_macros5, type: PyFunction, finished.\n04/02/2025 02:42:09 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: compile_paper6\n04/02/2025 02:42:12 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|update_task_state]: Task: compile_paper6, type: PyFunction, finished.\n04/02/2025 02:42:12 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n04/02/2025 02:42:12 PM <2016> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [28|WorkGraphEngine|finalize]: Finalize workgraph.\n"}],"execution_count":19},{"id":"397b16a2-e1ec-4eec-8562-1c84f585c347","cell_type":"markdown","source":"# Load Workflow with pyiron_base","metadata":{}},{"id":"fdde6b82-b51d-434a-a9a8-5a8c31bbb429","cell_type":"code","source":"from pyiron_base import Project","metadata":{"trusted":true},"outputs":[],"execution_count":20},{"id":"be4d5d93-e9f6-4072-a6be-0ee5dc93590f","cell_type":"code","source":"from python_workflow_definition.pyiron_base import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":21},{"id":"4db75587-5f4c-416d-a1f6-c949077fa2ca","cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":" 0%| | 0/6 [00:00","image/svg+xml":"\n\n\n\n\ncreate_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\ncreate_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b0b0>\n\n\n\nmacros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\nmacros_tex=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b170>\n\n\n\nmacros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2->create_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\n\n\n\n\npvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\npvbatch_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b470>\n\n\n\npvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\npoisson_output_pvd_file=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b0e0>\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a->pvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nplot_file_9d1a9b87944774e4e78d9da968ff99fe\n\nplot_file=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b470>\n\n\n\npoisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a->plot_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nplot_file_9d1a9b87944774e4e78d9da968ff99fe->create_function_job_53eb85d6d82fecfbbf97af61436a1e20\n\n\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21\n\nmeshio_output_xdmf=<pyiron_base.project.delayed.DelayedObject object at 0x77a40e9f97c0>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->poisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\npoisson_output_vtu_file=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32b5f0>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->poisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\n\n\n\n\nndofs_94e80d99bd65f182606d914bcfc69587\n\nndofs=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32adb0>\n\n\n\nmeshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21->ndofs_94e80d99bd65f182606d914bcfc69587\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a->pvbatch_output_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\npoisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a->plot_file_9d1a9b87944774e4e78d9da968ff99fe\n\n\n\n\n\nndofs_94e80d99bd65f182606d914bcfc69587->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b\n\ngmsh_output_file=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32bf80>\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b->meshio_output_xdmf_f3f38cfe734b2fac03503bf1b0b2dc21\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da\n\nmeshio_output_h5=<pyiron_base.project.delayed.DelayedObject object at 0x77a40a32bbf0>\n\n\n\ngmsh_output_file_27004aae404cc419dd3dc1389fc88f0b->meshio_output_h5_421c94788b005f01f21c9dff066602da\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->poisson_output_pvd_file_f104bb201447b192cc5a74afeb96949a\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->poisson_output_vtu_file_5b31ff1f467eec7a35e7bd11c650b27a\n\n\n\n\n\nmeshio_output_h5_421c94788b005f01f21c9dff066602da->ndofs_94e80d99bd65f182606d914bcfc69587\n\n\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20\n\ndomain_size=2.0\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20->macros_tex_fb028f57f3c3f54ac7ee35bd4c8bdfb2\n\n\n\n\n\ndomain_size_f12a7f1986b9dd058dfc666dbe230b20->gmsh_output_file_27004aae404cc419dd3dc1389fc88f0b\n\n\n\n\n"},"metadata":{}}],"execution_count":23},{"id":"1c2760b6-96b4-4f44-ac49-a229d4a0cf67","cell_type":"code","source":"delayed_object.pull()","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"The job generate_mesh_0b48cf5155cd6802c17d20bb58104132 was saved and received the ID: 1\nThe job convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 was saved and received the ID: 2\nThe job poisson_a0224b23ceb2119d105a5d98ef37f93e was saved and received the ID: 3\nThe job plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b was saved and received the ID: 4\nThe job substitute_macros_874fc185ecec04b4cb9537c58b7efb7b was saved and received the ID: 5\nThe job compile_paper_3cee534ffe692833d37faf1fd2170cb6 was saved and received the ID: 6\n"},{"execution_count":24,"output_type":"execute_result","data":{"text/plain":"'/home/jovyan/postprocessing/paper.pdf'"},"metadata":{}}],"execution_count":24},{"id":"b3bba27e-ece9-4c02-834c-53e69844b140","cell_type":"code","source":"pr.job_table()","metadata":{"trusted":true},"outputs":[{"execution_count":25,"output_type":"execute_result","data":{"text/plain":" id status chemicalformula \\\n0 1 finished None \n1 2 finished None \n2 3 finished None \n3 4 finished None \n4 5 finished None \n5 6 finished None \n\n job \\\n0 generate_mesh_0b48cf5155cd6802c17d20bb58104132 \n1 convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 \n2 poisson_a0224b23ceb2119d105a5d98ef37f93e \n3 plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b \n4 substitute_macros_874fc185ecec04b4cb9537c58b7efb7b \n5 compile_paper_3cee534ffe692833d37faf1fd2170cb6 \n\n subjob projectpath \\\n0 /generate_mesh_0b48cf5155cd6802c17d20bb58104132 None \n1 /convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43 None \n2 /poisson_a0224b23ceb2119d105a5d98ef37f93e None \n3 /plot_over_line_82b37a42e0747f11d9a7f6318f63ac6b None \n4 /substitute_macros_874fc185ecec04b4cb9537c58b7efb7b None \n5 /compile_paper_3cee534ffe692833d37faf1fd2170cb6 None \n\n project timestart timestop totalcputime \\\n0 /home/jovyan/test/ 2025-04-02 14:42:14.018185 None None \n1 /home/jovyan/test/ 2025-04-02 14:42:15.692862 None None \n2 /home/jovyan/test/ 2025-04-02 14:42:17.404579 None None \n3 /home/jovyan/test/ 2025-04-02 14:42:20.491822 None None \n4 /home/jovyan/test/ 2025-04-02 14:42:22.530320 None None \n5 /home/jovyan/test/ 2025-04-02 14:42:23.760472 None None \n\n computer \\\n0 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n1 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n2 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n3 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n4 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n5 pyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1 \n\n hamilton hamversion parentid masterid \n0 PythonFunctionContainerJob 0.4 None None \n1 PythonFunctionContainerJob 0.4 None None \n2 PythonFunctionContainerJob 0.4 None None \n3 PythonFunctionContainerJob 0.4 None None \n4 PythonFunctionContainerJob 0.4 None None \n5 PythonFunctionContainerJob 0.4 None None ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
idstatuschemicalformulajobsubjobprojectpathprojecttimestarttimestoptotalcputimecomputerhamiltonhamversionparentidmasterid
01finishedNonegenerate_mesh_0b48cf5155cd6802c17d20bb58104132/generate_mesh_0b48cf5155cd6802c17d20bb58104132None/home/jovyan/test/2025-04-02 14:42:14.018185NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
12finishedNoneconvert_to_xdmf_29ad6ec6927268429dc9aef8166fde43/convert_to_xdmf_29ad6ec6927268429dc9aef8166fde43None/home/jovyan/test/2025-04-02 14:42:15.692862NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
23finishedNonepoisson_a0224b23ceb2119d105a5d98ef37f93e/poisson_a0224b23ceb2119d105a5d98ef37f93eNone/home/jovyan/test/2025-04-02 14:42:17.404579NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
34finishedNoneplot_over_line_82b37a42e0747f11d9a7f6318f63ac6b/plot_over_line_82b37a42e0747f11d9a7f6318f63ac6bNone/home/jovyan/test/2025-04-02 14:42:20.491822NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
45finishedNonesubstitute_macros_874fc185ecec04b4cb9537c58b7efb7b/substitute_macros_874fc185ecec04b4cb9537c58b7efb7bNone/home/jovyan/test/2025-04-02 14:42:22.530320NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
56finishedNonecompile_paper_3cee534ffe692833d37faf1fd2170cb6/compile_paper_3cee534ffe692833d37faf1fd2170cb6None/home/jovyan/test/2025-04-02 14:42:23.760472NoneNonepyiron@jupyter-pyiron-dev-pyth-flow-definition-boxlhbwf#1PythonFunctionContainerJob0.4NoneNone
\n
"},"metadata":{}}],"execution_count":25}]} \ No newline at end of file diff --git a/jobflow_simple.ipynb b/jobflow_simple.ipynb index 222e64b..f455734 100644 --- a/jobflow_simple.ipynb +++ b/jobflow_simple.ipynb @@ -1,483 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "982a4fbe-7cf9-45dd-84ae-9854149db0b9", - "metadata": {}, - "source": [ - "# Simple Workflow with jobflow" - ] - }, - { - "cell_type": "markdown", - "id": "e6180712-d081-45c7-ba41-fc5191f10427", - "metadata": {}, - "source": [ - "## Define workflow with jobflow" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "000bbd4a-f53c-4eea-9d85-76f0aa2ca10b", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/jan/mambaforge/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", - "/home/jan/mambaforge/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" - ] - } - ], - "source": [ - "from jobflow import job, Flow" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "06c2bd9e-b2ac-4b88-9158-fa37331c3418", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.jobflow import write_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "fb847d49-7bf9-4839-9b99-c116d1b0e9ee", - "metadata": {}, - "outputs": [], - "source": [ - "from simple_workflow import (\n", - " add_x_and_y as _add_x_and_y, \n", - " add_x_and_y_and_z as _add_x_and_y_and_z,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "8f95244e", - "metadata": {}, - "outputs": [], - "source": [ - "workflow_json_filename = \"jobflow_simple.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "07598344-0f75-433b-8902-bea21a42088c", - "metadata": {}, - "outputs": [], - "source": [ - "add_x_and_y = job(_add_x_and_y, data=[\"x\", \"y\", \"z\"])\n", - "add_x_and_y_and_z = job(_add_x_and_y_and_z)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "ecef1ed5-a8d3-48c3-9e01-4a40e55c1153", - "metadata": {}, - "outputs": [], - "source": [ - "obj = add_x_and_y(x=1, y=2)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "2b88a30a-e26b-4802-89b7-79ca08cc0af9", - "metadata": {}, - "outputs": [], - "source": [ - "w = add_x_and_y_and_z(x=obj.output.x, y=obj.output.y, z=obj.output.z)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "a5e5ca63-2906-47c9-bac6-adebf8643cba", - "metadata": {}, - "outputs": [], - "source": [ - "flow = Flow([obj, w])" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "e464da97-16a1-4772-9a07-0a47f152781d", - "metadata": {}, - "outputs": [], - "source": [ - "write_workflow_json(flow=flow, file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "bca646b2-0a9a-4271-966a-e5903a8c9031", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\"nodes\": {\"0\": \"simple_workflow.add_x_and_y\", \"1\": \"simple_workflow.add_x_and_y_and_z\", \"2\": 1, \"3\": 2}, \"edges\": [{\"target\": 0, \"targetHandle\": \"x\", \"source\": 2, \"sourceHandle\": null}, {\"target\": 0, \"targetHandle\": \"y\", \"source\": 3, \"sourceHandle\": null}, {\"target\": 1, \"targetHandle\": \"x\", \"source\": 0, \"sourceHandle\": \"x\"}, {\"target\": 1, \"targetHandle\": \"y\", \"source\": 0, \"sourceHandle\": \"y\"}, {\"target\": 1, \"targetHandle\": \"z\", \"source\": 0, \"sourceHandle\": \"z\"}]}" - ] - } - ], - "source": [ - "!cat {workflow_json_filename}" - ] - }, - { - "cell_type": "markdown", - "id": "87a27540-c390-4d34-ae75-4739bfc4c1b7", - "metadata": {}, - "source": [ - "## Load Workflow with aiida" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "66a1b3a6-3d3b-4caa-b58f-d8bc089b1074", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Profile" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from aiida import load_profile\n", - "\n", - "load_profile()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "4679693b-039b-45cf-8c67-5b2b3d705a83", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "68c41a61-d185-47e8-ba31-eeff71d8b2c6", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "8e477ea52ce842b2be61f889452c9ab5", - "version_major": 2, - "version_minor": 1 - }, - "text/plain": [ - "NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "wg = load_workflow_json(file_name=workflow_json_filename)\n", - "wg" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "05228ece-643c-420c-8df8-4ce3df379515", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "03/22/2025 05:13:01 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: pickle_node3,pickle_node4\n", - "03/22/2025 05:13:04 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 11, 18\n", - "03/22/2025 05:13:15 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: pickle_node3, type: PYTHONJOB, finished.\n", - "03/22/2025 05:13:15 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: pickle_node4, type: PYTHONJOB, finished.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "invalid state\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "03/22/2025 05:13:16 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y1\n", - "03/22/2025 05:13:16 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 33\n", - "03/22/2025 05:13:23 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: add_x_and_y1, type: PYTHONJOB, finished.\n", - "03/22/2025 05:13:24 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y_and_z2\n", - "03/22/2025 05:13:25 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 46\n", - "03/22/2025 05:13:32 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: add_x_and_y_and_z2, type: PYTHONJOB, finished.\n", - "03/22/2025 05:13:32 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n", - "03/22/2025 05:13:32 PM <12689> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|finalize]: Finalize workgraph.\n" - ] - } - ], - "source": [ - "wg.run()" - ] - }, - { - "cell_type": "markdown", - "id": "2c942094-61b4-4e94-859a-64f87b5bec64", - "metadata": {}, - "source": [ - "## Load Workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "40672826-23bf-4c24-84e2-a6b9d87e2a3f", - "metadata": {}, - "outputs": [], - "source": [ - "from pyiron_base import Project" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "ea102341-84f7-4156-a7d1-c3ab1ea613a5", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "f45684a8-2613-415a-ab0a-5cb2bafaffea", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "0a8547ce309a493fb1c5c1d102006e82", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "0it [00:00, ?it/s]" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "pr = Project(\"test\")\n", - "pr.remove_jobs(recursive=True, silently=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "8f2a621d-b533-4ddd-8bcd-c22db2f922ec", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "create_function_job_5ba8ef37736a543dc29291038078c77e\n", - "\n", - "create_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x7f0b7e9b5b50>\n", - "\n", - "\n", - "\n", - "x_8b6e6a40c48b5cbc9bb2330ca1d55a57\n", - "\n", - "x=<pyiron_base.project.delayed.DelayedObject object at 0x7f0b89d22540>\n", - "\n", - "\n", - "\n", - "x_8b6e6a40c48b5cbc9bb2330ca1d55a57->create_function_job_5ba8ef37736a543dc29291038078c77e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce\n", - "\n", - "x=1\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->x_8b6e6a40c48b5cbc9bb2330ca1d55a57\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_53c8cca1c3b0ea88b12cb36e9f0231a2\n", - "\n", - "y=<pyiron_base.project.delayed.DelayedObject object at 0x7f0b7e9b56d0>\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->y_53c8cca1c3b0ea88b12cb36e9f0231a2\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "z_d75e7302821c66349ff25722ebcca91f\n", - "\n", - "z=<pyiron_base.project.delayed.DelayedObject object at 0x7f0b7e9b4ce0>\n", - "\n", - "\n", - "\n", - "x_1d847da32ecaabf6731c38f798c3d4ce->z_d75e7302821c66349ff25722ebcca91f\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_53c8cca1c3b0ea88b12cb36e9f0231a2->create_function_job_5ba8ef37736a543dc29291038078c77e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "z_d75e7302821c66349ff25722ebcca91f->create_function_job_5ba8ef37736a543dc29291038078c77e\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6\n", - "\n", - "y=2\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->x_8b6e6a40c48b5cbc9bb2330ca1d55a57\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->y_53c8cca1c3b0ea88b12cb36e9f0231a2\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "y_a9ec4f5f33f0d64e74ed5d9900bceac6->z_d75e7302821c66349ff25722ebcca91f\n", - "\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\n", - "delayed_object.draw()" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "cf80267d-c2b0-4236-bf1d-a57596985fc1", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The job add_x_and_y_68901482a2c5221cc845f828aabebd27 was saved and received the ID: 8\n", - "The job add_x_and_y_and_z_b671e81aaa4670d81d7eee509650af8d was saved and received the ID: 9\n" - ] - }, - { - "data": { - "text/plain": [ - "6" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "delayed_object.pull()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "9d819ed0-689c-46a7-9eff-0afb5ed66efc", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":5,"nbformat":4,"cells":[{"id":"982a4fbe-7cf9-45dd-84ae-9854149db0b9","cell_type":"markdown","source":"# Simple Workflow with jobflow","metadata":{}},{"id":"e6180712-d081-45c7-ba41-fc5191f10427","cell_type":"markdown","source":"## Define workflow with jobflow","metadata":{}},{"id":"000bbd4a-f53c-4eea-9d85-76f0aa2ca10b","cell_type":"code","source":"from jobflow import job, Flow","metadata":{"trusted":true},"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"}],"execution_count":1},{"id":"06c2bd9e-b2ac-4b88-9158-fa37331c3418","cell_type":"code","source":"from python_workflow_definition.jobflow import write_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"id":"fb847d49-7bf9-4839-9b99-c116d1b0e9ee","cell_type":"code","source":"from simple_workflow import (\n add_x_and_y as _add_x_and_y, \n add_x_and_y_and_z as _add_x_and_y_and_z,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":3},{"id":"8f95244e","cell_type":"code","source":"workflow_json_filename = \"jobflow_simple.json\"","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"id":"07598344-0f75-433b-8902-bea21a42088c","cell_type":"code","source":"add_x_and_y = job(_add_x_and_y, data=[\"x\", \"y\", \"z\"])\nadd_x_and_y_and_z = job(_add_x_and_y_and_z)","metadata":{"trusted":true},"outputs":[],"execution_count":5},{"id":"ecef1ed5-a8d3-48c3-9e01-4a40e55c1153","cell_type":"code","source":"obj = add_x_and_y(x=1, y=2)","metadata":{"trusted":true},"outputs":[],"execution_count":6},{"id":"2b88a30a-e26b-4802-89b7-79ca08cc0af9","cell_type":"code","source":"w = add_x_and_y_and_z(x=obj.output.x, y=obj.output.y, z=obj.output.z)","metadata":{"trusted":true},"outputs":[],"execution_count":7},{"id":"a5e5ca63-2906-47c9-bac6-adebf8643cba","cell_type":"code","source":"flow = Flow([obj, w])","metadata":{"trusted":true},"outputs":[],"execution_count":8},{"id":"e464da97-16a1-4772-9a07-0a47f152781d","cell_type":"code","source":"write_workflow_json(flow=flow, file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":9},{"id":"bca646b2-0a9a-4271-966a-e5903a8c9031","cell_type":"code","source":"!cat {workflow_json_filename}","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"{\"nodes\": {\"0\": \"simple_workflow.add_x_and_y\", \"1\": \"simple_workflow.add_x_and_y_and_z\", \"2\": 1, \"3\": 2}, \"edges\": [{\"tn\": 0, \"th\": \"x\", \"sn\": 2, \"sh\": null}, {\"tn\": 0, \"th\": \"y\", \"sn\": 3, \"sh\": null}, {\"tn\": 1, \"th\": \"x\", \"sn\": 0, \"sh\": \"x\"}, {\"tn\": 1, \"th\": \"y\", \"sn\": 0, \"sh\": \"y\"}, {\"tn\": 1, \"th\": \"z\", \"sn\": 0, \"sh\": \"z\"}]}"}],"execution_count":10},{"id":"87a27540-c390-4d34-ae75-4739bfc4c1b7","cell_type":"markdown","source":"## Load Workflow with aiida","metadata":{}},{"id":"66a1b3a6-3d3b-4caa-b58f-d8bc089b1074","cell_type":"code","source":"from aiida import load_profile\n\nload_profile()","metadata":{"trusted":true},"outputs":[{"execution_count":11,"output_type":"execute_result","data":{"text/plain":"Profile"},"metadata":{}}],"execution_count":11},{"id":"4679693b-039b-45cf-8c67-5b2b3d705a83","cell_type":"code","source":"from python_workflow_definition.aiida import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":12},{"id":"68c41a61-d185-47e8-ba31-eeff71d8b2c6","cell_type":"code","source":"wg = load_workflow_json(file_name=workflow_json_filename)\nwg","metadata":{"trusted":true},"outputs":[{"execution_count":13,"output_type":"execute_result","data":{"text/plain":"NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":1,"model_id":"14e9a03e426b468dbfe338d7f734a41a"}},"metadata":{}}],"execution_count":13},{"id":"05228ece-643c-420c-8df8-4ce3df379515","cell_type":"code","source":"wg.run()","metadata":{"trusted":true},"outputs":[{"name":"stderr","output_type":"stream","text":"04/02/2025 02:37:38 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y1\n04/02/2025 02:37:38 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|update_task_state]: Task: add_x_and_y1, type: PyFunction, finished.\n04/02/2025 02:37:38 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y_and_z2\n04/02/2025 02:37:39 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|update_task_state]: Task: add_x_and_y_and_z2, type: PyFunction, finished.\n04/02/2025 02:37:39 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n04/02/2025 02:37:39 PM <422> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [16|WorkGraphEngine|finalize]: Finalize workgraph.\n"}],"execution_count":14},{"id":"2c942094-61b4-4e94-859a-64f87b5bec64","cell_type":"markdown","source":"## Load Workflow with pyiron_base","metadata":{}},{"id":"40672826-23bf-4c24-84e2-a6b9d87e2a3f","cell_type":"code","source":"from pyiron_base import Project","metadata":{"trusted":true},"outputs":[],"execution_count":15},{"id":"ea102341-84f7-4156-a7d1-c3ab1ea613a5","cell_type":"code","source":"from python_workflow_definition.pyiron_base import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":16},{"id":"f45684a8-2613-415a-ab0a-5cb2bafaffea","cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":"0it [00:00, ?it/s]","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"f4514974ee9546f788ea311ec80db1c9"}},"metadata":{}}],"execution_count":17},{"id":"8f2a621d-b533-4ddd-8bcd-c22db2f922ec","cell_type":"code","source":"delayed_object = load_workflow_json(project=pr, file_name=workflow_json_filename)\ndelayed_object.draw()","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":"","image/svg+xml":"\n\n\n\n\ncreate_function_job_988efa8422518ba29903b66c63607fb8\n\ncreate_function_job=<pyiron_base.project.delayed.DelayedObject object at 0x75516fcff020>\n\n\n\nx_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\nx=<pyiron_base.project.delayed.DelayedObject object at 0x75516fcfebd0>\n\n\n\nx_b8003ea81f8e4a9bdbfd3b4eb1e68e2b->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce\n\nx=1\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->x_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\n\n\n\n\ny_f60ae41b1c92823db71999ac596241ab\n\ny=<pyiron_base.project.delayed.DelayedObject object at 0x75516fcfeba0>\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->y_f60ae41b1c92823db71999ac596241ab\n\n\n\n\n\nz_a926da40ec18154feb3f3bb147af8220\n\nz=<pyiron_base.project.delayed.DelayedObject object at 0x75516fcfe810>\n\n\n\nx_1d847da32ecaabf6731c38f798c3d4ce->z_a926da40ec18154feb3f3bb147af8220\n\n\n\n\n\ny_f60ae41b1c92823db71999ac596241ab->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\nz_a926da40ec18154feb3f3bb147af8220->create_function_job_988efa8422518ba29903b66c63607fb8\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6\n\ny=2\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->x_b8003ea81f8e4a9bdbfd3b4eb1e68e2b\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->y_f60ae41b1c92823db71999ac596241ab\n\n\n\n\n\ny_a9ec4f5f33f0d64e74ed5d9900bceac6->z_a926da40ec18154feb3f3bb147af8220\n\n\n\n\n"},"metadata":{}}],"execution_count":18},{"id":"cf80267d-c2b0-4236-bf1d-a57596985fc1","cell_type":"code","source":"delayed_object.pull()","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"The job add_x_and_y_68901482a2c5221cc845f828aabebd27 was saved and received the ID: 1\nThe job add_x_and_y_and_z_b671e81aaa4670d81d7eee509650af8d was saved and received the ID: 2\n"},{"execution_count":19,"output_type":"execute_result","data":{"text/plain":"6"},"metadata":{}}],"execution_count":19},{"id":"9d819ed0-689c-46a7-9eff-0afb5ed66efc","cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]} \ No newline at end of file diff --git a/pyiron_base_nfdi.ipynb b/pyiron_base_nfdi.ipynb index 92f3c22..9bda9eb 100644 --- a/pyiron_base_nfdi.ipynb +++ b/pyiron_base_nfdi.ipynb @@ -1,475 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "106ded66-d202-46ac-82b0-2755ca309bdd", - "metadata": {}, - "source": [ - "https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "6d86e804-245a-4d96-a1a3-1bc3216c3646", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "# conda environments:\n", - "#\n", - "base * /home/janssen/mambaforge\n", - "postprocessing /home/janssen/mambaforge/envs/postprocessing\n", - "preprocessing /home/janssen/mambaforge/envs/preprocessing\n", - "processing /home/janssen/mambaforge/envs/processing\n", - "\n" - ] - } - ], - "source": [ - "!conda env list" - ] - }, - { - "cell_type": "markdown", - "id": "11e09b78-cb72-465f-9c8b-5b77f0aa729c", - "metadata": {}, - "source": [ - "# Preprocessing " - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "a76e6c0a-98f2-4436-af10-8097da183341", - "metadata": {}, - "outputs": [], - "source": [ - "from nfdi_ing_workflow import (\n", - " generate_mesh as _generate_mesh, \n", - " convert_to_xdmf as _convert_to_xdmf,\n", - " poisson as _poisson,\n", - " plot_over_line as _plot_over_line,\n", - " substitute_macros as _substitute_macros,\n", - " compile_paper as _compile_paper,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "89c02460-b543-442c-a27e-f1757dc2262e", - "metadata": {}, - "outputs": [], - "source": [ - "from pyiron_base import Project, job" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "549ecf27-88ef-4e77-8bd4-b616cfdda2e4", - "metadata": {}, - "outputs": [], - "source": [ - "generate_mesh = job(_generate_mesh)\n", - "convert_to_xdmf = job(_convert_to_xdmf, output_key_lst=[\"xdmf_file\", \"h5_file\"])\n", - "poisson = job(_poisson, output_key_lst=[\"numdofs\", \"pvd_file\", \"vtu_file\"])\n", - "plot_over_line = job(_plot_over_line)\n", - "substitute_macros = job(_substitute_macros)\n", - "compile_paper = job(_compile_paper)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "508e6549-f7b8-492b-8c88-9e46c08ffca9", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "be42f1e956da4894a40ff667564b7f53", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "0it [00:00, ?it/s]" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "pr = Project(\"test\")\n", - "pr.remove_jobs(recursive=True, silently=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "8d911f98-3b80-457f-a0f4-3cb37ebf1691", - "metadata": {}, - "outputs": [], - "source": [ - "domain_size = 2.0" - ] - }, - { - "cell_type": "markdown", - "id": "cf1e22d2-9ce5-488f-8048-308d7d5d4966", - "metadata": {}, - "source": [ - "## generate mesh" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "71d411b6-cbec-489e-99e3-ba71680bcb5b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "gmsh_output_file = generate_mesh(\n", - " domain_size=domain_size,\n", - " pyiron_project=pr\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "019938e7-8b41-47a9-b226-00e05dabc193", - "metadata": {}, - "source": [ - "## convert to xdmf" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "1d0d9804-f250-48b3-a5d0-a546d520f79b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "meshio_output_dict = convert_to_xdmf(\n", - " gmsh_output_file=gmsh_output_file,\n", - " pyiron_project=pr,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "ceb0b643-caaa-426c-9781-28703440e647", - "metadata": {}, - "source": [ - "# Processing" - ] - }, - { - "cell_type": "markdown", - "id": "11815a8b-319c-4ff3-8eae-330bf6e58eee", - "metadata": {}, - "source": [ - "## poisson" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "7b69bcff-e2b1-4d4a-b62c-6a1c86eeb590", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "poisson_dict = poisson(\n", - " meshio_output_xdmf=meshio_output_dict.output.xdmf_file, \n", - " meshio_output_h5=meshio_output_dict.output.h5_file,\n", - " pyiron_project=pr,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "bc8a8634-029e-4337-96a2-a1f284cb4c38", - "metadata": {}, - "source": [ - "# Postprocessing" - ] - }, - { - "cell_type": "markdown", - "id": "157c5386-91a3-4e21-ac65-8f947f2d62fa", - "metadata": {}, - "source": [ - "## plot over line" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "3c4a29b0-eb1e-490a-8be0-e03cfff15e0a", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "pvbatch_output_file = plot_over_line(\n", - " poisson_output_pvd_file=poisson_dict.output.pvd_file, \n", - " poisson_output_vtu_file=poisson_dict.output.vtu_file,\n", - " pyiron_project=pr,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "54f1d4bd-b944-470f-9cf8-30e64a24eb6d", - "metadata": {}, - "source": [ - "## substitute macros" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "a0a4c233-322d-4723-9627-62ca2487bfa9", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "macros_tex_file = substitute_macros( \n", - " pvbatch_output_file=pvbatch_output_file, \n", - " ndofs=poisson_dict.output.numdofs, \n", - " domain_size=domain_size,\n", - " pyiron_project=pr,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "2031b693-acf3-48bd-bb00-e33f669381e9", - "metadata": {}, - "source": [ - "## compile paper" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "c281408f-e63d-4380-a7e6-c595d49fbb8f", - "metadata": {}, - "outputs": [], - "source": [ - "paper_output = compile_paper(\n", - " macros_tex=macros_tex_file, \n", - " plot_file=pvbatch_output_file,\n", - " pyiron_project=pr,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "7b079060-0646-490e-9f1a-19376a1ebc6c", - "metadata": {}, - "source": [ - "# Convert " - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "65bdc51a-895e-421c-bf20-0f793a397f67", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import write_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "63f29646-3846-4a97-a033-20e9df0ac214", - "metadata": {}, - "outputs": [], - "source": [ - "workflow_json_filename = \"pyiron_base_nfdi.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "f62111ba-9271-4987-9c7e-3b1c9f9eae7a", - "metadata": {}, - "outputs": [], - "source": [ - "write_workflow_json(delayed_object=paper_output, file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "markdown", - "id": "d789971e-8f41-45fa-832a-11fd72dea96e", - "metadata": {}, - "source": [ - "# Load Workflow with aiida" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a6e85e89-5d7a-40eb-809c-ac44974e3fd7", - "metadata": {}, - "outputs": [], - "source": [ - "from aiida import load_profile\n", - "\n", - "load_profile()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3de84fb7-b01b-4541-868a-92e881eb6e77", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b33f5528-10cd-47c8-8723-622902978859", - "metadata": {}, - "outputs": [], - "source": [ - "wg = load_workflow_json(file_name=workflow_json_filename)\n", - "wg" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "15282ca1-d339-40e7-ad68-8a7613ed08da", - "metadata": {}, - "outputs": [], - "source": [ - "wg.run()" - ] - }, - { - "cell_type": "markdown", - "id": "55dc8d12-dfe6-4465-a368-b7e590ae6800", - "metadata": {}, - "source": [ - "# Load Workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "dff46eb8-e0e7-49bb-8c40-0db2df133124", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.jobflow import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "6a189459-84e4-4738-ada1-37ee8c65b2ab", - "metadata": {}, - "outputs": [], - "source": [ - "from jobflow.managers.local import run_locally" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "6e7f3614-c971-4e2d-83f0-96f0d0fc04de", - "metadata": {}, - "outputs": [], - "source": [ - "flow = load_workflow_json(file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "2d87ed45-f5d9-403f-a03a-26be4a47a3ef", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2025-04-02 14:59:47,651 INFO Started executing jobs locally\n", - "2025-04-02 14:59:49,002 INFO Starting job - generate_mesh (c116d67e-4d2a-4e50-82af-faee6ee474ef)\n", - "2025-04-02 14:59:54,666 INFO Finished job - generate_mesh (c116d67e-4d2a-4e50-82af-faee6ee474ef)\n", - "2025-04-02 14:59:54,666 INFO Starting job - convert_to_xdmf (5283e8af-6407-4a02-8bb7-0057df7ec6fe)\n", - "2025-04-02 15:00:01,183 INFO Finished job - convert_to_xdmf (5283e8af-6407-4a02-8bb7-0057df7ec6fe)\n", - "2025-04-02 15:00:01,184 INFO Starting job - poisson (ce03af6b-866c-41ba-b17c-9bdf1e965e58)\n", - "2025-04-02 15:00:10,982 INFO Finished job - poisson (ce03af6b-866c-41ba-b17c-9bdf1e965e58)\n", - "2025-04-02 15:00:10,983 INFO Starting job - plot_over_line (582b8920-93f3-4a9e-b216-e3b30a22f1dd)\n", - "2025-04-02 15:00:21,672 INFO Finished job - plot_over_line (582b8920-93f3-4a9e-b216-e3b30a22f1dd)\n", - "2025-04-02 15:00:21,673 INFO Starting job - substitute_macros (596ecf51-bc63-4770-8f0f-802662bb46df)\n", - "2025-04-02 15:00:27,059 INFO Finished job - substitute_macros (596ecf51-bc63-4770-8f0f-802662bb46df)\n", - "2025-04-02 15:00:27,059 INFO Starting job - compile_paper (a99bafcf-b306-418e-8383-576e3926bcbf)\n", - "2025-04-02 15:00:35,854 INFO Finished job - compile_paper (a99bafcf-b306-418e-8383-576e3926bcbf)\n", - "2025-04-02 15:00:35,855 INFO Finished executing jobs locally\n" - ] - }, - { - "data": { - "text/plain": [ - "{'c116d67e-4d2a-4e50-82af-faee6ee474ef': {1: Response(output='/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/preprocessing/square.msh', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))},\n", - " '5283e8af-6407-4a02-8bb7-0057df7ec6fe': {1: Response(output={'xdmf_file': '/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/preprocessing/square.xdmf', 'h5_file': '/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/preprocessing/square.h5'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))},\n", - " 'ce03af6b-866c-41ba-b17c-9bdf1e965e58': {1: Response(output={'numdofs': 357, 'pvd_file': '/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/processing/poisson.pvd', 'vtu_file': '/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/processing/poisson000000.vtu'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))},\n", - " '582b8920-93f3-4a9e-b216-e3b30a22f1dd': {1: Response(output='/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/postprocessing/plotoverline.csv', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))},\n", - " '596ecf51-bc63-4770-8f0f-802662bb46df': {1: Response(output='/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/postprocessing/macros.tex', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))},\n", - " 'a99bafcf-b306-418e-8383-576e3926bcbf': {1: Response(output='/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd/postprocessing/paper.pdf', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/janssen/notebooks/2025/2025-04-02-nfdi-pwd'))}}" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result = run_locally(flow)\n", - "result" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":5,"nbformat":4,"cells":[{"id":"106ded66-d202-46ac-82b0-2755ca309bdd","cell_type":"markdown","source":"https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements","metadata":{}},{"id":"6d86e804-245a-4d96-a1a3-1bc3216c3646","cell_type":"code","source":"!conda env list","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"\n# conda environments:\n#\nbase /srv/conda\nnotebook * /srv/conda/envs/notebook\npostprocessing /srv/conda/envs/postprocessing\npreprocessing /srv/conda/envs/preprocessing\nprocessing /srv/conda/envs/processing\n\n"}],"execution_count":1},{"id":"11e09b78-cb72-465f-9c8b-5b77f0aa729c","cell_type":"markdown","source":"# Preprocessing ","metadata":{}},{"id":"a76e6c0a-98f2-4436-af10-8097da183341","cell_type":"code","source":"from nfdi_ing_workflow import (\n generate_mesh as _generate_mesh, \n convert_to_xdmf as _convert_to_xdmf,\n poisson as _poisson,\n plot_over_line as _plot_over_line,\n substitute_macros as _substitute_macros,\n compile_paper as _compile_paper,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"id":"89c02460-b543-442c-a27e-f1757dc2262e","cell_type":"code","source":"from pyiron_base import Project, job","metadata":{"trusted":true},"outputs":[],"execution_count":3},{"id":"549ecf27-88ef-4e77-8bd4-b616cfdda2e4","cell_type":"code","source":"generate_mesh = job(_generate_mesh)\nconvert_to_xdmf = job(_convert_to_xdmf, output_key_lst=[\"xdmf_file\", \"h5_file\"])\npoisson = job(_poisson, output_key_lst=[\"numdofs\", \"pvd_file\", \"vtu_file\"])\nplot_over_line = job(_plot_over_line)\nsubstitute_macros = job(_substitute_macros)\ncompile_paper = job(_compile_paper)","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"id":"508e6549-f7b8-492b-8c88-9e46c08ffca9","cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":" 0%| | 0/6 [00:00"},"metadata":{}}],"execution_count":16},{"id":"3de84fb7-b01b-4541-868a-92e881eb6e77","cell_type":"code","source":"from python_workflow_definition.aiida import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":17},{"id":"b33f5528-10cd-47c8-8723-622902978859","cell_type":"code","source":"wg = load_workflow_json(file_name=workflow_json_filename)\nwg","metadata":{"trusted":true},"outputs":[{"execution_count":18,"output_type":"execute_result","data":{"text/plain":"NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":1,"model_id":"5fc1dd2af29a487f91a742dc61513583"}},"metadata":{}}],"execution_count":18},{"id":"15282ca1-d339-40e7-ad68-8a7613ed08da","cell_type":"code","source":"wg.run()","metadata":{"trusted":true},"outputs":[{"name":"stderr","output_type":"stream","text":"04/02/2025 02:42:49 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: generate_mesh6\n04/02/2025 02:42:52 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: generate_mesh6, type: PyFunction, finished.\n04/02/2025 02:42:52 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: convert_to_xdmf5\n04/02/2025 02:42:54 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: convert_to_xdmf5, type: PyFunction, finished.\n04/02/2025 02:42:54 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: poisson4\n04/02/2025 02:42:58 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: poisson4, type: PyFunction, finished.\n04/02/2025 02:42:58 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: plot_over_line3\n04/02/2025 02:43:00 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: plot_over_line3, type: PyFunction, finished.\n04/02/2025 02:43:00 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: substitute_macros2\n04/02/2025 02:43:02 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: substitute_macros2, type: PyFunction, finished.\n04/02/2025 02:43:02 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: compile_paper1\n04/02/2025 02:43:06 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|update_task_state]: Task: compile_paper1, type: PyFunction, finished.\n04/02/2025 02:43:06 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n04/02/2025 02:43:06 PM <3366> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [57|WorkGraphEngine|finalize]: Finalize workgraph.\n"}],"execution_count":19},{"id":"55dc8d12-dfe6-4465-a368-b7e590ae6800","cell_type":"markdown","source":"# Load Workflow with pyiron_base","metadata":{}},{"id":"dff46eb8-e0e7-49bb-8c40-0db2df133124","cell_type":"code","source":"from python_workflow_definition.jobflow import load_workflow_json","metadata":{"trusted":true},"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"}],"execution_count":20},{"id":"6a189459-84e4-4738-ada1-37ee8c65b2ab","cell_type":"code","source":"from jobflow.managers.local import run_locally","metadata":{"trusted":true},"outputs":[],"execution_count":21},{"id":"6e7f3614-c971-4e2d-83f0-96f0d0fc04de","cell_type":"code","source":"flow = load_workflow_json(file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":22},{"id":"2d87ed45-f5d9-403f-a03a-26be4a47a3ef","cell_type":"code","source":"result = run_locally(flow)\nresult","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"2025-04-02 14:43:07,042 INFO Started executing jobs locally\n2025-04-02 14:43:07,362 INFO Starting job - generate_mesh (43b2c093-4d23-4dff-9faa-91515c28b29b)\n2025-04-02 14:43:08,924 INFO Finished job - generate_mesh (43b2c093-4d23-4dff-9faa-91515c28b29b)\n2025-04-02 14:43:08,925 INFO Starting job - convert_to_xdmf (54030101-696f-4d65-939f-fc0d1caa8503)\n2025-04-02 14:43:10,661 INFO Finished job - convert_to_xdmf (54030101-696f-4d65-939f-fc0d1caa8503)\n2025-04-02 14:43:10,663 INFO Starting job - poisson (5a5d4720-da41-44c9-a3f0-52995c086dee)\n2025-04-02 14:43:13,799 INFO Finished job - poisson (5a5d4720-da41-44c9-a3f0-52995c086dee)\n2025-04-02 14:43:13,801 INFO Starting job - plot_over_line (ef4ff511-cac6-4f0f-a0f6-36e049bbf9fe)\n2025-04-02 14:43:15,798 INFO Finished job - plot_over_line (ef4ff511-cac6-4f0f-a0f6-36e049bbf9fe)\n2025-04-02 14:43:15,799 INFO Starting job - substitute_macros (2a2432f2-612b-4598-a4a9-1ec1eeb194bf)\n2025-04-02 14:43:17,144 INFO Finished job - substitute_macros (2a2432f2-612b-4598-a4a9-1ec1eeb194bf)\n2025-04-02 14:43:17,145 INFO Starting job - compile_paper (1db56d00-9f04-4482-aae9-6cad8720fb06)\n2025-04-02 14:43:19,774 INFO Finished job - compile_paper (1db56d00-9f04-4482-aae9-6cad8720fb06)\n2025-04-02 14:43:19,775 INFO Finished executing jobs locally\n"},{"execution_count":23,"output_type":"execute_result","data":{"text/plain":"{'43b2c093-4d23-4dff-9faa-91515c28b29b': {1: Response(output='/home/jovyan/preprocessing/square.msh', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '54030101-696f-4d65-939f-fc0d1caa8503': {1: Response(output={'xdmf_file': '/home/jovyan/preprocessing/square.xdmf', 'h5_file': '/home/jovyan/preprocessing/square.h5'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '5a5d4720-da41-44c9-a3f0-52995c086dee': {1: Response(output={'numdofs': 357, 'pvd_file': '/home/jovyan/processing/poisson.pvd', 'vtu_file': '/home/jovyan/processing/poisson000000.vtu'}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n 'ef4ff511-cac6-4f0f-a0f6-36e049bbf9fe': {1: Response(output='/home/jovyan/postprocessing/plotoverline.csv', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '2a2432f2-612b-4598-a4a9-1ec1eeb194bf': {1: Response(output='/home/jovyan/postprocessing/macros.tex', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n '1db56d00-9f04-4482-aae9-6cad8720fb06': {1: Response(output='/home/jovyan/postprocessing/paper.pdf', detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))}}"},"metadata":{}}],"execution_count":23}]} \ No newline at end of file diff --git a/pyiron_base_simple.ipynb b/pyiron_base_simple.ipynb index e0f9ce0..60246da 100644 --- a/pyiron_base_simple.ipynb +++ b/pyiron_base_simple.ipynb @@ -1,372 +1 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "c39b76fb-259f-4e16-a44d-02a295c82386", - "metadata": {}, - "source": [ - "# Simple Workflow with pyiron_base" - ] - }, - { - "cell_type": "markdown", - "id": "3638419b-a0cb-49e2-b157-7fbb1acde90f", - "metadata": {}, - "source": [ - "## Define workflow with pyiron_base" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "b4a78447-e87c-4fb4-8d17-d9a280eb7254", - "metadata": {}, - "outputs": [], - "source": [ - "from pyiron_base import Project, job" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "06c2bd9e-b2ac-4b88-9158-fa37331c3418", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.pyiron_base import write_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "fb847d49-7bf9-4839-9b99-c116d1b0e9ee", - "metadata": {}, - "outputs": [], - "source": [ - "from simple_workflow import (\n", - " add_x_and_y as _add_x_and_y, \n", - " add_x_and_y_and_z as _add_x_and_y_and_z,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "8f95244e", - "metadata": {}, - "outputs": [], - "source": [ - "workflow_json_filename = \"pyiron_base_simple.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "07598344-0f75-433b-8902-bea21a42088c", - "metadata": {}, - "outputs": [], - "source": [ - "add_x_and_y = job(_add_x_and_y, output_key_lst=[\"x\", \"y\", \"z\"])\n", - "add_x_and_y_and_z = job(_add_x_and_y_and_z)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "ecef1ed5-a8d3-48c3-9e01-4a40e55c1153", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "eef958d12626414fb2eb17cb6d1e378a", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - " 0%| | 0/2 [00:00" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from aiida import load_profile\n", - "\n", - "load_profile()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "68a56b32-9f99-43d7-aaee-0c1cd9522681", - "metadata": {}, - "outputs": [], - "source": [ - "from python_workflow_definition.aiida import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "8f2a621d-b533-4ddd-8bcd-c22db2f922ec", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "a2bef88370ca4a7da692020d2828d425", - "version_major": 2, - "version_minor": 1 - }, - "text/plain": [ - "NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "wg = load_workflow_json(file_name=workflow_json_filename)\n", - "wg" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "cf80267d-c2b0-4236-bf1d-a57596985fc1", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "03/22/2025 05:14:45 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|continue_workgraph]: tasks ready to run: pickle_node3,pickle_node4\n", - "03/22/2025 05:14:47 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 60, 67\n", - "03/22/2025 05:14:58 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|update_task_state]: Task: pickle_node3, type: PYTHONJOB, finished.\n", - "03/22/2025 05:14:58 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|update_task_state]: Task: pickle_node4, type: PYTHONJOB, finished.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "invalid state\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "03/22/2025 05:14:59 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y2\n", - "03/22/2025 05:14:59 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 82\n", - "03/22/2025 05:15:06 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|update_task_state]: Task: add_x_and_y2, type: PYTHONJOB, finished.\n", - "03/22/2025 05:15:07 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y_and_z1\n", - "03/22/2025 05:15:07 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 95\n", - "03/22/2025 05:15:15 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|update_task_state]: Task: add_x_and_y_and_z1, type: PYTHONJOB, finished.\n", - "03/22/2025 05:15:15 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n", - "03/22/2025 05:15:15 PM <24142> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [53|WorkGraphEngine|finalize]: Finalize workgraph.\n" - ] - } - ], - "source": [ - "\n", - "wg.run()" - ] - }, - { - "cell_type": "markdown", - "id": "0c3503e1-0a32-40e1-845d-3fd9ec3c4c19", - "metadata": {}, - "source": [ - "## Load Workflow with jobflow" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "4abb0481-8e38-479d-ae61-6c46d091653e", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/jan/mambaforge/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", - "/home/jan/mambaforge/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" - ] - } - ], - "source": [ - "from python_workflow_definition.jobflow import load_workflow_json" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "8253dd7c283bf3f7", - "metadata": {}, - "outputs": [], - "source": [ - "from jobflow.managers.local import run_locally" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "4b45e83b-945f-48c5-8e20-9df0ce0a14a1", - "metadata": {}, - "outputs": [], - "source": [ - "flow = load_workflow_json(file_name=workflow_json_filename)" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "8665c39c-220c-4982-b738-c31f6460530f", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2025-03-22 17:15:17,020 INFO Started executing jobs locally\n", - "2025-03-22 17:15:17,608 INFO Starting job - add_x_and_y (0ff79865-353c-4e5c-9e0c-6d9ed576e001)\n", - "2025-03-22 17:15:17,610 INFO Finished job - add_x_and_y (0ff79865-353c-4e5c-9e0c-6d9ed576e001)\n", - "2025-03-22 17:15:17,612 INFO Starting job - add_x_and_y_and_z (1d6e359b-898d-4784-a86d-ca858fc2fcfd)\n", - "2025-03-22 17:15:17,615 INFO Finished job - add_x_and_y_and_z (1d6e359b-898d-4784-a86d-ca858fc2fcfd)\n", - "2025-03-22 17:15:17,615 INFO Finished executing jobs locally\n" - ] - }, - { - "data": { - "text/plain": [ - "{'0ff79865-353c-4e5c-9e0c-6d9ed576e001': {1: Response(output={'x': 1, 'y': 2, 'z': 3}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jan/notebooks/2025/2025-03-22-compare-workflows'))},\n", - " '1d6e359b-898d-4784-a86d-ca858fc2fcfd': {1: Response(output=6, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jan/notebooks/2025/2025-03-22-compare-workflows'))}}" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result = run_locally(flow)\n", - "result" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cf76f305-24de-45a7-be8e-cfe45cd6458e", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} +{"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":5,"nbformat":4,"cells":[{"id":"c39b76fb-259f-4e16-a44d-02a295c82386","cell_type":"markdown","source":"# Simple Workflow with pyiron_base","metadata":{}},{"id":"3638419b-a0cb-49e2-b157-7fbb1acde90f","cell_type":"markdown","source":"## Define workflow with pyiron_base","metadata":{}},{"id":"b4a78447-e87c-4fb4-8d17-d9a280eb7254","cell_type":"code","source":"from pyiron_base import Project, job","metadata":{"trusted":true},"outputs":[],"execution_count":1},{"id":"06c2bd9e-b2ac-4b88-9158-fa37331c3418","cell_type":"code","source":"from python_workflow_definition.pyiron_base import write_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":2},{"id":"fb847d49-7bf9-4839-9b99-c116d1b0e9ee","cell_type":"code","source":"from simple_workflow import (\n add_x_and_y as _add_x_and_y, \n add_x_and_y_and_z as _add_x_and_y_and_z,\n)","metadata":{"trusted":true},"outputs":[],"execution_count":3},{"id":"8f95244e","cell_type":"code","source":"workflow_json_filename = \"pyiron_base_simple.json\"","metadata":{"trusted":true},"outputs":[],"execution_count":4},{"id":"07598344-0f75-433b-8902-bea21a42088c","cell_type":"code","source":"add_x_and_y = job(_add_x_and_y, output_key_lst=[\"x\", \"y\", \"z\"])\nadd_x_and_y_and_z = job(_add_x_and_y_and_z)","metadata":{"trusted":true},"outputs":[],"execution_count":5},{"id":"ecef1ed5-a8d3-48c3-9e01-4a40e55c1153","cell_type":"code","source":"pr = Project(\"test\")\npr.remove_jobs(recursive=True, silently=True)","metadata":{"trusted":true},"outputs":[{"output_type":"display_data","data":{"text/plain":" 0%| | 0/2 [00:00"},"metadata":{}}],"execution_count":11},{"id":"68a56b32-9f99-43d7-aaee-0c1cd9522681","cell_type":"code","source":"from python_workflow_definition.aiida import load_workflow_json","metadata":{"trusted":true},"outputs":[],"execution_count":12},{"id":"8f2a621d-b533-4ddd-8bcd-c22db2f922ec","cell_type":"code","source":"wg = load_workflow_json(file_name=workflow_json_filename)\nwg","metadata":{"trusted":true},"outputs":[{"execution_count":13,"output_type":"execute_result","data":{"text/plain":"NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":1,"model_id":"dcfa2451385b4eb2b9204f7e196eeda4"}},"metadata":{}}],"execution_count":13},{"id":"cf80267d-c2b0-4236-bf1d-a57596985fc1","cell_type":"code","source":"\nwg.run()","metadata":{"trusted":true},"outputs":[{"name":"stderr","output_type":"stream","text":"04/02/2025 02:36:58 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y2\n04/02/2025 02:36:59 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: add_x_and_y2, type: PyFunction, finished.\n04/02/2025 02:36:59 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y_and_z1\n04/02/2025 02:37:00 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|update_task_state]: Task: add_x_and_y_and_z1, type: PyFunction, finished.\n04/02/2025 02:37:00 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n04/02/2025 02:37:00 PM <248> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [3|WorkGraphEngine|finalize]: Finalize workgraph.\n"}],"execution_count":14},{"id":"0c3503e1-0a32-40e1-845d-3fd9ec3c4c19","cell_type":"markdown","source":"## Load Workflow with jobflow","metadata":{}},{"id":"4abb0481-8e38-479d-ae61-6c46d091653e","cell_type":"code","source":"from python_workflow_definition.jobflow import load_workflow_json","metadata":{"trusted":true},"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"}],"execution_count":15},{"id":"8253dd7c283bf3f7","cell_type":"code","source":"from jobflow.managers.local import run_locally","metadata":{"trusted":true},"outputs":[],"execution_count":16},{"id":"4b45e83b-945f-48c5-8e20-9df0ce0a14a1","cell_type":"code","source":"flow = load_workflow_json(file_name=workflow_json_filename)","metadata":{"trusted":true},"outputs":[],"execution_count":17},{"id":"8665c39c-220c-4982-b738-c31f6460530f","cell_type":"code","source":"result = run_locally(flow)\nresult","metadata":{"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"2025-04-02 14:37:00,813 INFO Started executing jobs locally\n2025-04-02 14:37:01,234 INFO Starting job - add_x_and_y (3cb63b3e-289b-4c08-a9e4-0ba051181adb)\n2025-04-02 14:37:01,238 INFO Finished job - add_x_and_y (3cb63b3e-289b-4c08-a9e4-0ba051181adb)\n2025-04-02 14:37:01,239 INFO Starting job - add_x_and_y_and_z (bff452ed-d3b3-4d6c-8162-feaa188b5660)\n2025-04-02 14:37:01,242 INFO Finished job - add_x_and_y_and_z (bff452ed-d3b3-4d6c-8162-feaa188b5660)\n2025-04-02 14:37:01,243 INFO Finished executing jobs locally\n"},{"execution_count":18,"output_type":"execute_result","data":{"text/plain":"{'3cb63b3e-289b-4c08-a9e4-0ba051181adb': {1: Response(output={'x': 1, 'y': 2, 'z': 3}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))},\n 'bff452ed-d3b3-4d6c-8162-feaa188b5660': {1: Response(output=6, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/jovyan'))}}"},"metadata":{}}],"execution_count":18},{"id":"cf76f305-24de-45a7-be8e-cfe45cd6458e","cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]} \ No newline at end of file