Skip to content

Commit 802ea8b

Browse files
committed
update: first attempt at triggering render
1 parent 3d7c5d3 commit 802ea8b

File tree

2 files changed

+13
-53
lines changed

2 files changed

+13
-53
lines changed

examples/full_reproductions/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@
496496
{
497497
"metadata": {},
498498
"cell_type": "code",
499-
"outputs": [],
500-
"execution_count": null,
501499
"source": [
502500
"unit_0 = relaxation_workflow[\"units\"][0]\n",
503501
"unit_1 = workflow[\"units\"][0]\n",
@@ -506,7 +504,9 @@
506504
"unit_0[\"next\"] = unit_1[\"flowchartId\"]\n",
507505
"unit_1[\"head\"] = False"
508506
],
509-
"id": "9fd1471293e56120"
507+
"id": "9fd1471293e56120",
508+
"outputs": [],
509+
"execution_count": null
510510
},
511511
{
512512
"metadata": {},
@@ -517,13 +517,13 @@
517517
{
518518
"metadata": {},
519519
"cell_type": "code",
520-
"outputs": [],
521-
"execution_count": null,
522520
"source": [
523521
"modifier_2 = {\"units\": [unit_0, unit_1]}\n",
524522
"workflow_endpoints.update(id_=band_gap_workflow_id, modifier=modifier_2)"
525523
],
526-
"id": "7d3968658054c4e1"
524+
"id": "7d3968658054c4e1",
525+
"outputs": [],
526+
"execution_count": null
527527
},
528528
{
529529
"metadata": {},
@@ -534,14 +534,14 @@
534534
{
535535
"metadata": {},
536536
"cell_type": "code",
537-
"outputs": [],
538-
"execution_count": null,
539537
"source": [
540538
"# Fetch the updated workflow\n",
541539
"workflow = workflow_endpoints.list(QUERY, OPTIONS)[0]\n",
542540
"display_JSON(workflow)"
543541
],
544-
"id": "db4f4cbb438a9cdb"
542+
"id": "db4f4cbb438a9cdb",
543+
"outputs": [],
544+
"execution_count": null
545545
},
546546
{
547547
"metadata": {},
@@ -684,47 +684,6 @@
684684
"outputs": [],
685685
"execution_count": null
686686
},
687-
{
688-
"metadata": {},
689-
"cell_type": "markdown",
690-
"source": [
691-
"### 8.3. Set `rendered` field\n",
692-
"Update the `rendered` field that contains the ESPRESSO input file content."
693-
],
694-
"id": "517b9a9d619b82c7"
695-
},
696-
{
697-
"metadata": {},
698-
"cell_type": "code",
699-
"source": [
700-
"import re\n",
701-
"\n",
702-
"rendered_relax_str = workflow_in_job[\"subworkflows\"][0][\"units\"][0][\"input\"][0][\"rendered\"]\n",
703-
"rendered_1_str = workflow_in_job[\"subworkflows\"][1][\"units\"][0][\"input\"][0][\"rendered\"]\n",
704-
"rendered_2_str = workflow_in_job[\"subworkflows\"][1][\"units\"][1][\"input\"][0][\"rendered\"]\n",
705-
"\n",
706-
"modifier_relax[\"workflow.subworkflows.0.units.0.input.0.rendered\"] = re.sub(\n",
707-
" r\"K_POINTS automatic\\n(\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+)\",\n",
708-
" f\"K_POINTS automatic\\n{kgrid_relax[0]} {kgrid_relax[1]} {kgrid_relax[2]} 0 0 0\",\n",
709-
" rendered_relax_str,\n",
710-
")\n",
711-
"\n",
712-
"modifier_1[\"workflow.subworkflows.1.units.0.input.0.rendered\"] = re.sub(\n",
713-
" r\"K_POINTS automatic\\n(\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+)\",\n",
714-
" f\"K_POINTS automatic\\n{kgrid_scf[0]} {kgrid_scf[1]} {kgrid_scf[2]} 0 0 0\",\n",
715-
" rendered_1_str,\n",
716-
")\n",
717-
"\n",
718-
"modifier_2[\"workflow.subworkflows.1.units.1.input.0.rendered\"] = re.sub(\n",
719-
" r\"K_POINTS automatic\\n(\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+)\",\n",
720-
" f\"K_POINTS automatic\\n{kgrid_nscf[0]} {kgrid_nscf[1]} {kgrid_nscf[2]} 0 0 0\",\n",
721-
" rendered_2_str,\n",
722-
")"
723-
],
724-
"id": "78136544256e0ef9",
725-
"outputs": [],
726-
"execution_count": null
727-
},
728687
{
729688
"metadata": {},
730689
"cell_type": "markdown",
@@ -736,9 +695,9 @@
736695
"cell_type": "code",
737696
"source": [
738697
"for job in jobs:\n",
739-
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_relax)\n",
740-
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_1)\n",
741-
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_2)"
698+
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_relax, parameteres={\"skipRender\": \"false\"})\n",
699+
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_1, parameteres={\"skipRender\": \"false\"})\n",
700+
" job_endpoints.update(id_=job[\"_id\"], modifier=modifier_2, parameteres={\"skipRender\": \"false\"})"
742701
],
743702
"id": "2c8f1c529cda6b1e",
744703
"outputs": [],
@@ -794,6 +753,7 @@
794753
"metadata": {},
795754
"cell_type": "code",
796755
"source": [
756+
"import re\n",
797757
"from utils.generic import get_property_by_subworkflow_and_unit_indicies\n",
798758
"from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n",
799759
"\n",
6.3 MB
Loading

0 commit comments

Comments
 (0)