Skip to content

Commit ea8a046

Browse files
committed
update: cleanup
1 parent 2fa7605 commit ea8a046

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

other/materials_designer/workflows/valence_band_offset.ipynb

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,11 @@
641641
"job_data = client.jobs.get(job_id)\n",
642642
"workflow = job_data[\"workflow\"]\n",
643643
"\n",
644-
"vbo_value = client.properties.get_for_job(\n",
644+
"vbo_value_non_polar = client.properties.get_for_job(\n",
645645
" job_id,\n",
646646
" property_name=PropertyName.scalar.valence_band_offset.value,\n",
647647
")[0]\n",
648-
"workflow_vbo_value = float(vbo_value[\"value\"])\n",
649-
"display_vbo_value = workflow_vbo_value\n",
650-
"print(f\"Workflow Valence Band Offset (VBO) value: {workflow_vbo_value:.3f} eV\")\n",
648+
"print(f\"Workflow Valence Band Offset (VBO) value: {float(vbo_value_non_polar['value']):.3f} eV\")\n",
651649
"\n",
652650
"avg_esp_unit_ids = {}\n",
653651
"for subworkflow in workflow[\"subworkflows\"]:\n",
@@ -754,15 +752,15 @@
754752
"Va_bulk_left, _, _ = fit_and_average(X_left, Y_left, slab1_start_left, slab1_end_left)\n",
755753
"Vb_bulk_right, _, _ = fit_and_average(X_right, Y_right, slab2_start_right, slab2_end_right)\n",
756754
"\n",
757-
"polar_vbo = (Vb_interface - Va_interface) - (Vb_bulk_right - Va_bulk_left)\n",
755+
"vbo_value_polar = (Vb_interface - Va_interface) - (Vb_bulk_right - Va_bulk_left)\n",
758756
"\n",
759757
"print(f\"Interface ESP slab 1: {Va_interface:.3f} eV\")\n",
760758
"print(f\"Interface ESP slab 2: {Vb_interface:.3f} eV\")\n",
761759
"print(f\"Bulk ESP left: {Va_bulk_left:.3f} eV\")\n",
762760
"print(f\"Bulk ESP right: {Vb_bulk_right:.3f} eV\")\n",
763761
"print(f\"Fit slope slab 1: {slope_a:.6f} eV/A\")\n",
764762
"print(f\"Fit slope slab 2: {slope_b:.6f} eV/A\")\n",
765-
"print(f\"Polar post-process VBO: {polar_vbo:.3f} eV\")"
763+
"print(f\"Polar post-process VBO: {vbo_value_polar:.3f} eV\")"
766764
]
767765
},
768766
{
@@ -799,7 +797,7 @@
799797
"plt.axhline(Vb_interface, color=\"blue\", linestyle=\":\", linewidth=2, label=f\"Avg ESP Slab 2 = {Vb_interface:.3f} eV\")\n",
800798
"plt.xlabel(\"z-coordinate (A)\", fontsize=12)\n",
801799
"plt.ylabel(\"Macroscopic Average Potential (eV)\", fontsize=12)\n",
802-
"plt.title(f\"Polar Interface VBO = {polar_vbo:.3f} eV\", fontsize=14, fontweight=\"bold\")\n",
800+
"plt.title(f\"Polar Interface VBO = {vbo_value_polar:.3f} eV\", fontsize=14, fontweight=\"bold\")\n",
803801
"plt.legend(loc=\"best\", fontsize=10)\n",
804802
"plt.grid(True, alpha=0.3)\n",
805803
"plt.tight_layout()\n",
@@ -822,27 +820,15 @@
822820
"outputs": [],
823821
"source": [
824822
"if IS_POLAR:\n",
825-
" display_vbo_value = polar_vbo\n",
826-
" vbo_value[\"value\"] = polar_vbo\n",
827823
" vbo_property_holder = get_property_holder_for_job(\n",
828824
" client,\n",
829825
" job_id,\n",
830826
" PropertyName.scalar.valence_band_offset.value,\n",
831827
" )\n",
832-
" update_property_holder_value(client, vbo_property_holder[\"_id\"], polar_vbo)\n",
833-
" print(f\"Persisted displayed Valence Band Offset (VBO) value: {display_vbo_value:.3f} eV\")\n",
834-
"else:\n",
835-
" print(f\"Displayed Valence Band Offset (VBO) value: {display_vbo_value:.3f} eV\")\n",
828+
" update_property_holder_value(client, vbo_property_holder[\"_id\"], vbo_value_polar)\n",
829+
" print(f\"Persisted displayed Valence Band Offset (VBO) value: {vbo_value_polar:.3f} eV\")\n",
836830
"\n"
837831
]
838-
},
839-
{
840-
"cell_type": "code",
841-
"execution_count": null,
842-
"id": "49",
843-
"metadata": {},
844-
"outputs": [],
845-
"source": []
846832
}
847833
],
848834
"metadata": {

0 commit comments

Comments
 (0)