diff --git a/docs/source/howto/html/test_use_calcjob.html b/docs/source/howto/html/test_use_calcjob.html index cc9eac76..7f8fea45 100644 --- a/docs/source/howto/html/test_use_calcjob.html +++ b/docs/source/howto/html/test_use_calcjob.html @@ -61,7 +61,7 @@ const { RenderUtils } = ReteRenderUtils; const styled = window.styled; - const nodegraphData = {"name": "test_use_calcjob", "uuid": "58a1dc38-b2f7-11ef-ad43-906584de3e5b", "state": "CREATED", "nodes": {"add1": {"label": "add1", "node_type": "CALCJOB", "inputs": [{"name": "x", "identifier": "workgraph.any"}, {"name": "y", "identifier": "workgraph.any"}], "properties": {"metadata": {"identifier": "workgraph.any", "value": null}, "metadata.store_provenance": {"identifier": "workgraph.bool", "value": null}, "metadata.description": {"identifier": "workgraph.any", "value": null}, "metadata.label": {"identifier": "workgraph.any", "value": null}, "metadata.call_link_label": {"identifier": "workgraph.string", "value": null}, "metadata.disable_cache": {"identifier": "workgraph.any", "value": null}, "metadata.dry_run": {"identifier": "workgraph.bool", "value": null}, "metadata.computer": {"identifier": "workgraph.any", "value": null}, "metadata.options": {"identifier": "workgraph.any", "value": null}, "metadata.options.input_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.output_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.submit_script_filename": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stdout": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stderr": {"identifier": "workgraph.string", "value": null}, "metadata.options.resources": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_wallclock_seconds": {"identifier": "workgraph.any", "value": null}, "metadata.options.custom_scheduler_commands": {"identifier": "workgraph.string", "value": null}, "metadata.options.queue_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.rerunnable": {"identifier": "workgraph.any", "value": null}, "metadata.options.account": {"identifier": "workgraph.any", "value": null}, "metadata.options.qos": {"identifier": "workgraph.any", "value": null}, "metadata.options.withmpi": {"identifier": "workgraph.any", "value": null}, "metadata.options.mpirun_extra_params": {"identifier": "workgraph.any", "value": null}, "metadata.options.import_sys_environment": {"identifier": "workgraph.bool", "value": null}, "metadata.options.environment_variables": {"identifier": "workgraph.any", "value": null}, "metadata.options.environment_variables_double_quotes": {"identifier": "workgraph.bool", "value": null}, "metadata.options.priority": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_memory_kb": {"identifier": "workgraph.any", "value": null}, "metadata.options.prepend_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.append_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.parser_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.additional_retrieve_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.target_base": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.source_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.stash_mode": {"identifier": "workgraph.any", "value": null}, "metadata.options.sleep": {"identifier": "workgraph.any", "value": null}, "code": {"identifier": "workgraph.any", "value": null}, "monitors": {"identifier": "workgraph.any", "value": null}, "remote_folder": {"identifier": "workgraph.any", "value": null}, "x": {"identifier": "workgraph.any", "value": null}, "y": {"identifier": "workgraph.any", "value": null}, "_wait": {"identifier": "workgraph.any", "value": null}}, "outputs": [{"name": "sum"}], "position": [30, 30], "children": []}, "add2": {"label": "add2", "node_type": "CALCJOB", "inputs": [{"name": "x", "identifier": "workgraph.any"}, {"name": "y", "identifier": "workgraph.any"}, {"name": "x"}], "properties": {"metadata": {"identifier": "workgraph.any", "value": null}, "metadata.store_provenance": {"identifier": "workgraph.bool", "value": null}, "metadata.description": {"identifier": "workgraph.any", "value": null}, "metadata.label": {"identifier": "workgraph.any", "value": null}, "metadata.call_link_label": {"identifier": "workgraph.string", "value": null}, "metadata.disable_cache": {"identifier": "workgraph.any", "value": null}, "metadata.dry_run": {"identifier": "workgraph.bool", "value": null}, "metadata.computer": {"identifier": "workgraph.any", "value": null}, "metadata.options": {"identifier": "workgraph.any", "value": null}, "metadata.options.input_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.output_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.submit_script_filename": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stdout": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stderr": {"identifier": "workgraph.string", "value": null}, "metadata.options.resources": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_wallclock_seconds": {"identifier": "workgraph.any", "value": null}, "metadata.options.custom_scheduler_commands": {"identifier": "workgraph.string", "value": null}, "metadata.options.queue_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.rerunnable": {"identifier": "workgraph.any", "value": null}, "metadata.options.account": {"identifier": "workgraph.any", "value": null}, "metadata.options.qos": {"identifier": "workgraph.any", "value": null}, "metadata.options.withmpi": {"identifier": "workgraph.any", "value": null}, "metadata.options.mpirun_extra_params": {"identifier": "workgraph.any", "value": null}, "metadata.options.import_sys_environment": {"identifier": "workgraph.bool", "value": null}, "metadata.options.environment_variables": {"identifier": "workgraph.any", "value": null}, "metadata.options.environment_variables_double_quotes": {"identifier": "workgraph.bool", "value": null}, "metadata.options.priority": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_memory_kb": {"identifier": "workgraph.any", "value": null}, "metadata.options.prepend_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.append_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.parser_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.additional_retrieve_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.target_base": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.source_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.stash_mode": {"identifier": "workgraph.any", "value": null}, "metadata.options.sleep": {"identifier": "workgraph.any", "value": null}, "code": {"identifier": "workgraph.any", "value": null}, "monitors": {"identifier": "workgraph.any", "value": null}, "remote_folder": {"identifier": "workgraph.any", "value": null}, "x": {"identifier": "workgraph.any", "value": null}, "y": {"identifier": "workgraph.any", "value": null}, "_wait": {"identifier": "workgraph.any", "value": null}}, "outputs": [], "position": [60, 60], "children": []}}, "links": [{"from_socket": "sum", "from_node": "add1", "to_socket": "x", "to_node": "add2", "state": false}]} + const nodegraphData = {"name": "test_use_calcjob", "uuid": "8bc77c88-b2f9-11ef-ad43-906584de3e5b", "state": "CREATED", "nodes": {"add1": {"label": "add1", "node_type": "CALCJOB", "inputs": [{"name": "x", "identifier": "workgraph.any"}, {"name": "y", "identifier": "workgraph.any"}], "properties": {"metadata": {"identifier": "workgraph.any", "value": null}, "metadata.store_provenance": {"identifier": "workgraph.bool", "value": null}, "metadata.description": {"identifier": "workgraph.any", "value": null}, "metadata.label": {"identifier": "workgraph.any", "value": null}, "metadata.call_link_label": {"identifier": "workgraph.string", "value": null}, "metadata.disable_cache": {"identifier": "workgraph.any", "value": null}, "metadata.dry_run": {"identifier": "workgraph.bool", "value": null}, "metadata.computer": {"identifier": "workgraph.any", "value": null}, "metadata.options": {"identifier": "workgraph.any", "value": null}, "metadata.options.input_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.output_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.submit_script_filename": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stdout": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stderr": {"identifier": "workgraph.string", "value": null}, "metadata.options.resources": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_wallclock_seconds": {"identifier": "workgraph.any", "value": null}, "metadata.options.custom_scheduler_commands": {"identifier": "workgraph.string", "value": null}, "metadata.options.queue_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.rerunnable": {"identifier": "workgraph.any", "value": null}, "metadata.options.account": {"identifier": "workgraph.any", "value": null}, "metadata.options.qos": {"identifier": "workgraph.any", "value": null}, "metadata.options.withmpi": {"identifier": "workgraph.any", "value": null}, "metadata.options.mpirun_extra_params": {"identifier": "workgraph.any", "value": null}, "metadata.options.import_sys_environment": {"identifier": "workgraph.bool", "value": null}, "metadata.options.environment_variables": {"identifier": "workgraph.any", "value": null}, "metadata.options.environment_variables_double_quotes": {"identifier": "workgraph.bool", "value": null}, "metadata.options.priority": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_memory_kb": {"identifier": "workgraph.any", "value": null}, "metadata.options.prepend_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.append_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.parser_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.additional_retrieve_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.target_base": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.source_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.stash_mode": {"identifier": "workgraph.any", "value": null}, "metadata.options.sleep": {"identifier": "workgraph.any", "value": null}, "code": {"identifier": "workgraph.any", "value": null}, "monitors": {"identifier": "workgraph.any", "value": null}, "remote_folder": {"identifier": "workgraph.any", "value": null}, "x": {"identifier": "workgraph.any", "value": null}, "y": {"identifier": "workgraph.any", "value": null}, "_wait": {"identifier": "workgraph.any", "value": null}}, "outputs": [{"name": "sum"}], "position": [30, 30], "children": []}, "add2": {"label": "add2", "node_type": "CALCJOB", "inputs": [{"name": "x", "identifier": "workgraph.any"}, {"name": "y", "identifier": "workgraph.any"}, {"name": "x"}], "properties": {"metadata": {"identifier": "workgraph.any", "value": null}, "metadata.store_provenance": {"identifier": "workgraph.bool", "value": null}, "metadata.description": {"identifier": "workgraph.any", "value": null}, "metadata.label": {"identifier": "workgraph.any", "value": null}, "metadata.call_link_label": {"identifier": "workgraph.string", "value": null}, "metadata.disable_cache": {"identifier": "workgraph.any", "value": null}, "metadata.dry_run": {"identifier": "workgraph.bool", "value": null}, "metadata.computer": {"identifier": "workgraph.any", "value": null}, "metadata.options": {"identifier": "workgraph.any", "value": null}, "metadata.options.input_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.output_filename": {"identifier": "workgraph.any", "value": null}, "metadata.options.submit_script_filename": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stdout": {"identifier": "workgraph.string", "value": null}, "metadata.options.scheduler_stderr": {"identifier": "workgraph.string", "value": null}, "metadata.options.resources": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_wallclock_seconds": {"identifier": "workgraph.any", "value": null}, "metadata.options.custom_scheduler_commands": {"identifier": "workgraph.string", "value": null}, "metadata.options.queue_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.rerunnable": {"identifier": "workgraph.any", "value": null}, "metadata.options.account": {"identifier": "workgraph.any", "value": null}, "metadata.options.qos": {"identifier": "workgraph.any", "value": null}, "metadata.options.withmpi": {"identifier": "workgraph.any", "value": null}, "metadata.options.mpirun_extra_params": {"identifier": "workgraph.any", "value": null}, "metadata.options.import_sys_environment": {"identifier": "workgraph.bool", "value": null}, "metadata.options.environment_variables": {"identifier": "workgraph.any", "value": null}, "metadata.options.environment_variables_double_quotes": {"identifier": "workgraph.bool", "value": null}, "metadata.options.priority": {"identifier": "workgraph.any", "value": null}, "metadata.options.max_memory_kb": {"identifier": "workgraph.any", "value": null}, "metadata.options.prepend_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.append_text": {"identifier": "workgraph.string", "value": null}, "metadata.options.parser_name": {"identifier": "workgraph.any", "value": null}, "metadata.options.additional_retrieve_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.target_base": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.source_list": {"identifier": "workgraph.any", "value": null}, "metadata.options.stash.stash_mode": {"identifier": "workgraph.any", "value": null}, "metadata.options.sleep": {"identifier": "workgraph.any", "value": null}, "code": {"identifier": "workgraph.any", "value": null}, "monitors": {"identifier": "workgraph.any", "value": null}, "remote_folder": {"identifier": "workgraph.any", "value": null}, "x": {"identifier": "workgraph.any", "value": null}, "y": {"identifier": "workgraph.any", "value": null}, "_wait": {"identifier": "workgraph.any", "value": null}}, "outputs": [], "position": [60, 60], "children": []}}, "links": [{"from_socket": "sum", "from_node": "add1", "to_socket": "x", "to_node": "add2", "state": false}]} // Define Schemes to use in vanilla JS const Schemes = { diff --git a/docs/source/howto/use_calcjob_workchain.ipynb b/docs/source/howto/use_calcjob_workchain.ipynb index 199b359f..f4c8fe57 100644 --- a/docs/source/howto/use_calcjob_workchain.ipynb +++ b/docs/source/howto/use_calcjob_workchain.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "a6e0038f", "metadata": {}, "outputs": [ @@ -30,10 +30,10 @@ " " ], "text/plain": [ - "" + "" ] }, - "execution_count": 1, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -44,8 +44,8 @@ "from aiida.calculations.arithmetic.add import ArithmeticAddCalculation\n", "\n", "wg = WorkGraph(\"test_use_calcjob\")\n", - "wg.add_task(ArithmeticAddCalculation, name=\"add1\")\n", - "wg.add_task(ArithmeticAddCalculation, name=\"add2\", x=wg.tasks[\"add1\"].outputs[\"sum\"])\n", + "task1 = wg.add_task(ArithmeticAddCalculation, name=\"add1\")\n", + "task2 = wg.add_task(ArithmeticAddCalculation, name=\"add2\", x=wg.tasks[\"add1\"].outputs[\"sum\"])\n", "wg.to_html()" ] }, @@ -54,8 +54,35 @@ "id": "1781a459", "metadata": {}, "source": [ - "## Set inputs from a process builder\n", - "\n" + "## Set inputs\n", + "One can set the inputs when adding the task, or using the `set` method of the `Task` object." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "288327e4", + "metadata": {}, + "outputs": [], + "source": [ + "from aiida import load_profile\n", + "from aiida.orm import Int\n", + "\n", + "load_profile()\n", + "\n", + "# use set method\n", + "task1.set({\"x\": Int(1), \"y\": Int(2)})\n", + "# set the inputs when adding the task\n", + "task3 = wg.add_task(ArithmeticAddCalculation, name=\"add3\", x=Int(3), y=Int(4))\n" + ] + }, + { + "cell_type": "markdown", + "id": "ef4ba444", + "metadata": {}, + "source": [ + "### Use process builder\n", + "One can also set the inputs of the task using the process builder." ] }, { @@ -68,9 +95,7 @@ "\n", "from aiida.calculations.arithmetic.add import ArithmeticAddCalculation\n", "from aiida.orm import Int, load_code\n", - "from aiida import load_profile\n", "\n", - "load_profile()\n", "\n", "code = load_code(\"add@localhost\")\n", "builder = ArithmeticAddCalculation.get_builder()\n",