Skip to content

Commit

Permalink
f-sa: screenshots/ remove
Browse files Browse the repository at this point in the history
- layout
- enable_quick_setup
  • Loading branch information
unkcpz committed Oct 9, 2023
1 parent 56d3662 commit 3558c90
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ venv.bak/

.DS_Store
.vscode

# screenshots from tests
screenshots/
17 changes: 10 additions & 7 deletions aiidalab_widgets_base/computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ class ComputationalResourcesWidget(ipw.VBox):
allow_hidden_codes = tl.Bool(False)
allow_disabled_computers = tl.Bool(False)

# code output layout width
_output_width = "460px"

def __init__(
self,
description="Select code:",
quick_setup=True,
detailed_setup=True,
enable_quick_setup=True,
enable_detailed_setup=True,
clear_after=None,
default_calc_job_plugin=None,
**kwargs,
Expand Down Expand Up @@ -94,7 +97,7 @@ def __init__(
self.btn_setup_new_code = ipw.ToggleButton(description="Setup new code")
self.btn_setup_new_code.observe(self._setup_new_code, "value")

self._setup_new_code_output = ipw.Output(layout={"width": "500px"})
self._setup_new_code_output = ipw.Output(layout={"width": self._output_width})

children = [
ipw.HBox([self.code_select_dropdown, self.btn_setup_new_code]),
Expand All @@ -106,8 +109,8 @@ def __init__(
# Quick setup.
self.resource_setup = _ResourceSetupBaseWidget(
default_calc_job_plugin=self.default_calc_job_plugin,
enable_quick_setup=quick_setup,
enable_detailed_setup=detailed_setup,
enable_quick_setup=enable_quick_setup,
enable_detailed_setup=enable_detailed_setup,
)
self.resource_setup.observe(self.refresh, "success")
ipw.dlink(
Expand Down Expand Up @@ -183,7 +186,7 @@ def _setup_new_code(self, _=None):
clear_output()
if self.btn_setup_new_code.value:
self._setup_new_code_output.layout = {
"width": "460px",
"width": self._output_width,
"border": "1px solid gray",
}

Expand All @@ -194,7 +197,7 @@ def _setup_new_code(self, _=None):
display(*children)
else:
self._setup_new_code_output.layout = {
"width": "460px",
"width": self._output_width,
"border": "none",
}

Expand Down
4 changes: 2 additions & 2 deletions notebooks/computational_resources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"outputs": [],
"source": [
"resources1 = awb.ComputationalResourcesWidget()\n",
"resources2 = awb.ComputationalResourcesWidget(quick_setup=False)\n",
"resources3 = awb.ComputationalResourcesWidget(detailed_setup=False)"
"resources2 = awb.ComputationalResourcesWidget(enable_quick_setup=False)\n",
"resources3 = awb.ComputationalResourcesWidget(enable_detailed_setup=False)"
]
},
{
Expand Down
Binary file removed screenshots/computational_resources_code_setup.png
Binary file not shown.

0 comments on commit 3558c90

Please sign in to comment.