|
496 | 496 | {
|
497 | 497 | "metadata": {},
|
498 | 498 | "cell_type": "code",
|
499 |
| - "outputs": [], |
500 |
| - "execution_count": null, |
501 | 499 | "source": [
|
502 | 500 | "unit_0 = relaxation_workflow[\"units\"][0]\n",
|
503 | 501 | "unit_1 = workflow[\"units\"][0]\n",
|
|
506 | 504 | "unit_0[\"next\"] = unit_1[\"flowchartId\"]\n",
|
507 | 505 | "unit_1[\"head\"] = False"
|
508 | 506 | ],
|
509 |
| - "id": "9fd1471293e56120" |
| 507 | + "id": "9fd1471293e56120", |
| 508 | + "outputs": [], |
| 509 | + "execution_count": null |
510 | 510 | },
|
511 | 511 | {
|
512 | 512 | "metadata": {},
|
|
517 | 517 | {
|
518 | 518 | "metadata": {},
|
519 | 519 | "cell_type": "code",
|
520 |
| - "outputs": [], |
521 |
| - "execution_count": null, |
522 | 520 | "source": [
|
523 | 521 | "modifier_2 = {\"units\": [unit_0, unit_1]}\n",
|
524 | 522 | "workflow_endpoints.update(id_=band_gap_workflow_id, modifier=modifier_2)"
|
525 | 523 | ],
|
526 |
| - "id": "7d3968658054c4e1" |
| 524 | + "id": "7d3968658054c4e1", |
| 525 | + "outputs": [], |
| 526 | + "execution_count": null |
527 | 527 | },
|
528 | 528 | {
|
529 | 529 | "metadata": {},
|
|
534 | 534 | {
|
535 | 535 | "metadata": {},
|
536 | 536 | "cell_type": "code",
|
537 |
| - "outputs": [], |
538 |
| - "execution_count": null, |
539 | 537 | "source": [
|
540 | 538 | "# Fetch the updated workflow\n",
|
541 | 539 | "workflow = workflow_endpoints.list(QUERY, OPTIONS)[0]\n",
|
542 | 540 | "display_JSON(workflow)"
|
543 | 541 | ],
|
544 |
| - "id": "db4f4cbb438a9cdb" |
| 542 | + "id": "db4f4cbb438a9cdb", |
| 543 | + "outputs": [], |
| 544 | + "execution_count": null |
545 | 545 | },
|
546 | 546 | {
|
547 | 547 | "metadata": {},
|
|
684 | 684 | "outputs": [],
|
685 | 685 | "execution_count": null
|
686 | 686 | },
|
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 |
| - }, |
728 | 687 | {
|
729 | 688 | "metadata": {},
|
730 | 689 | "cell_type": "markdown",
|
|
736 | 695 | "cell_type": "code",
|
737 | 696 | "source": [
|
738 | 697 | "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\"})" |
742 | 701 | ],
|
743 | 702 | "id": "2c8f1c529cda6b1e",
|
744 | 703 | "outputs": [],
|
|
794 | 753 | "metadata": {},
|
795 | 754 | "cell_type": "code",
|
796 | 755 | "source": [
|
| 756 | + "import re\n", |
797 | 757 | "from utils.generic import get_property_by_subworkflow_and_unit_indicies\n",
|
798 | 758 | "from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n",
|
799 | 759 | "\n",
|
|
0 commit comments