Skip to content

Commit

Permalink
Fix edge case in default code selection
Browse files Browse the repository at this point in the history
Closes #240
  • Loading branch information
danielhollas committed Apr 29, 2024
1 parent 4d7f8a0 commit 1376374
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions aiidalab_ispg/app/input_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enum import Enum, unique

import ipywidgets as ipw
import traitlets
import traitlets as tl

from aiida.common import NotExistent
from aiida.orm import load_code
Expand Down Expand Up @@ -240,7 +240,7 @@ def reset(self):


class WignerSamplingSettings(ipw.VBox):
disabled = traitlets.Bool(default=False)
disabled = tl.Bool(default=False)

title = ipw.HTML(
"""<div style="padding-top: 0px; padding-bottom: 0px">
Expand Down Expand Up @@ -279,7 +279,7 @@ def __init__(self):

super().__init__([self.title, self.nwigner, self.wigner_low_freq_thr])

@traitlets.observe("disabled")
@tl.observe("disabled")
def _observer_disabled(self, change):
if change["new"]:
self.nwigner.disabled = True
Expand Down Expand Up @@ -333,6 +333,11 @@ def _set_default_codes(self, _=None):
return
except (NotExistent, ValueError):
pass
except tl.TraitError:
# This can happen if one of the code/computers is not configured/enabled or hidden
# In practice, this happened to me locally when importing from production DB.
# https://github.com/ispg-group/aiidalab-ispg/issues/240
pass

if not self.orca.value:
print("WARNING: ORCA code has not been found locally")
Expand Down

0 comments on commit 1376374

Please sign in to comment.