Skip to content

Commit

Permalink
Fix wrong links, update warning messages. (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Sep 23, 2021
1 parent 3c509a5 commit 1f55895
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions aiidalab_widgets_base/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class AiiDACodeSetup(ipw.VBox):
prepend_text = Unicode()
append_text = Unicode()

def __init__(self, **kwargs):
def __init__(self, path_to_root="../", **kwargs):

style = {"description_width": "200px"}

Expand All @@ -178,7 +178,9 @@ def __init__(self, **kwargs):
link((inp_label, "value"), (self, "label"))

# Computer on which the code is installed. Two dlinks are needed to make sure we get a Computer instance.
inp_computer = ComputerDropdown(layout={"margin": "0px 0px 0px 125px"})
inp_computer = ComputerDropdown(
path_to_root=path_to_root, layout={"margin": "0px 0px 0px 125px"}
)
dlink((inp_computer, "selected_computer"), (self, "computer"))
dlink((self, "computer"), (inp_computer, "selected_computer"))

Expand Down Expand Up @@ -250,13 +252,13 @@ def _setup_code(self, _=None):
with self._setup_code_out:
clear_output()
if self.label is None:
print("You did not specify code label")
print("You did not specify code label.")
return
if not self.remote_abs_path:
print("You did not specify absolute path to the executable")
print("You did not specify absolute path to the executable.")
return
if self.exists():
print(f"Code {self.label}@{self.computer.label} already exists")
print(f"Code {self.label}@{self.computer.label} already exists.")
return
code = Code(remote_computer_exec=(self.computer, self.remote_abs_path))
code.label = self.label
Expand Down
4 changes: 2 additions & 2 deletions notebooks/process.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"source": [
"follower = ProcessFollowerWidget(\n",
" process,\n",
" followers=[ProgressBarWidget(), ProcessReportWidget(), ProcessCallStackWidget(), RunningCalcJobOutputWidget()], path_to_root='../', \n",
" followers=[ProgressBarWidget(), ProcessReportWidget(), ProcessCallStackWidget(), RunningCalcJobOutputWidget()], path_to_root=\"../../\", \n",
" update_interval=2)\n",
"display(follower)\n",
"follower.follow(detach=True)"
Expand All @@ -113,7 +113,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/process_list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"metadata": {},
"outputs": [],
"source": [
"process_list = ProcessListWidget()\n",
"process_list = ProcessListWidget(path_to_root=\"../../\")\n",
"\n",
"past_days_widget = ipw.IntText(value=7, description='Past days:')\n",
"dlink((past_days_widget, 'value'), (process_list, 'past_days'))\n",
Expand Down Expand Up @@ -125,7 +125,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/setup_code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"metadata": {},
"outputs": [],
"source": [
"aiidacode = AiiDACodeSetup(**args)\n",
"aiidacode = AiiDACodeSetup(path_to_root=\"../../\", **args)\n",
"display(aiidacode)"
]
}
Expand All @@ -86,7 +86,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1f55895

Please sign in to comment.