Skip to content

Commit

Permalink
Fix widgets behaviour in the SPM notebok. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Oct 20, 2023
1 parent 0109b5f commit 8c0009a
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions submit_spm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -87,7 +86,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -106,9 +104,7 @@
"\n",
"uks_input = inputs.UksSectionWidget()\n",
"\n",
"sc_diag_check = ipw.Checkbox(\n",
" value=False, description=\"self-consistent diagonalization\", disabled=True\n",
")\n",
"sc_diag_check = ipw.Checkbox(value=False, description=\"self-consistent diagonalization\")\n",
"\n",
"protocol = ipw.Dropdown(\n",
" value=\"standard\",\n",
Expand All @@ -121,7 +117,7 @@
" style={\"description_width\": \"120px\"},\n",
")\n",
"\n",
"elpa_check = ipw.Checkbox(value=True, description=\"use ELPA\", disabled=False)\n",
"elpa_check = ipw.Checkbox(value=True, description=\"use ELPA\")\n",
"display(uks_input, sc_diag_check)\n",
"\n",
"\n",
Expand Down Expand Up @@ -157,7 +153,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -219,7 +214,6 @@
" max=4.0,\n",
" step=0.1,\n",
" description=\"Emin, Emax (eV):\",\n",
" disabled=False,\n",
" continuous_update=False,\n",
" orientation=\"horizontal\",\n",
" readout=True,\n",
Expand Down Expand Up @@ -480,8 +474,8 @@
"para_list = [stip_ipw, pytip_ipw, pztip_ipw, pxtip_ipw, fwhmtip_ipw]\n",
"\n",
"\n",
"def para_values(value):\n",
" if value == \"parametrized\":\n",
"def set_para_values(value):\n",
" if value[\"new\"] == \"parametrized\":\n",
" stip_ipw.disabled = False\n",
" pytip_ipw.disabled = False\n",
" pztip_ipw.disabled = False\n",
Expand All @@ -499,7 +493,7 @@
" orbstip_ipw.disabled = False\n",
"\n",
"\n",
"para_ipw = ipw.interactive(para_values, value=tiptype_ipw)"
"tiptype_ipw.observe(set_para_values, \"value\")"
]
},
{
Expand All @@ -517,7 +511,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -793,8 +786,6 @@
" scanmaxz_floattxt.step = 0.1\n",
" scanmaxz_floattxt.value = 8.5\n",
" submit_button.children = [btn_submit_afm]\n",
" uks_input.net_charge = 0\n",
" uks_input.charge.disabled = True\n",
" elif drop_spm_type.value == \"HRSTM\":\n",
" spm_code_box.children = [hrstm_code, twopp_code]\n",
" submit_button.children = [btn_submit_hrstm]\n",
Expand All @@ -807,8 +798,6 @@
" scanmaxz_floattxt.step = 0.1\n",
" scanmaxz_floattxt.value = 7.5\n",
" submit_button.children = [btn_submit_hrstm]\n",
" uks_input.net_charge = 0\n",
" uks_input.charge.disabled = True\n",
"\n",
"\n",
"btn_submit_stm = awb.SubmitButtonWidget(Cp2kStmWorkChain, inputs_generator=get_builder)\n",
Expand Down Expand Up @@ -851,7 +840,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -868,7 +856,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down

0 comments on commit 8c0009a

Please sign in to comment.