diff --git a/aiidalab_widgets_base/computational_resources.py b/aiidalab_widgets_base/computational_resources.py index 3f3ce1630..ef24102fd 100644 --- a/aiidalab_widgets_base/computational_resources.py +++ b/aiidalab_widgets_base/computational_resources.py @@ -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) diff --git a/notebooks/computational_resources.ipynb b/notebooks/computational_resources.ipynb index 9ff109028..0b46bb3b6 100644 --- a/notebooks/computational_resources.ipynb +++ b/notebooks/computational_resources.ipynb @@ -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": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "%%javascript\n", "IPython.OutputArea.prototype._should_scroll = function(lines) {\n", @@ -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": [], @@ -64,25 +36,10 @@ }, { "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)" @@ -90,28 +47,17 @@ }, { "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": [], @@ -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)" ]