Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 19, 2023
1 parent 16197d7 commit bbfc111
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 83 deletions.
7 changes: 5 additions & 2 deletions aiidalab_widgets_base/computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ def quick_setup(self, _=None):
This action will only trigger the setup of the widget, not the actual setup of the computer and code.
The actual setup will be triggered from DetailedSetupWidget from ComputationalResourcesWidget.
"""
from jinja2 import ChainableUndefined, Environment, meta
import copy

from jinja2 import ChainableUndefined, Environment, meta

# From the remote original setup, fill the template
computer_setup = copy.deepcopy(self.computer_setup) # The dict is nested, so we need deepcopy
computer_setup = copy.deepcopy(
self.computer_setup
) # The dict is nested, so we need deepcopy

for key, value in computer_setup.get("setup", {}).items():
env = Environment(undefined=ChainableUndefined)
Expand Down
93 changes: 12 additions & 81 deletions notebooks/computational_resources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,10 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "4013ce60",
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"IPython.OutputArea.prototype._should_scroll = function(lines) {\n",
" return false;\n",
"}\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"%%javascript\n",
"IPython.OutputArea.prototype._should_scroll = function(lines) {\n",
Expand All @@ -30,30 +15,17 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "53f49d32",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6ea24e36af9d4230bbde5f966901fba9",
"version_major": 2,
"version_minor": 0
},
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"import aiidalab_widgets_base as awb"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "56116f88",
"metadata": {},
"outputs": [],
Expand All @@ -64,54 +36,28 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "b75b6687",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6cad017fcce44d35904b7fe815e6bccc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"ComputationalResourcesWidget(children=(HBox(children=(Dropdown(description='Select code:', disabled=True, opti…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(resources1)\n",
"# display(resources2)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "15b22b09",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"resources1.detailed_setup.aiida_computer_setup.computer_setup"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "b286d587",
"metadata": {},
"outputs": [],
Expand All @@ -121,25 +67,10 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "47b3bc92",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "98b940e17ea34ee9ac31a9e5dab1b964",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"QuickSetupWidget(children=(HTML(value='Please select the computer/code from a database to pre-fill the fields …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"display(qs)"
]
Expand Down

0 comments on commit bbfc111

Please sign in to comment.