Skip to content

Commit

Permalink
Bug fix in the q-section reset.
Browse files Browse the repository at this point in the history
The problem was that the default value of a tl.List(tl.Float())
is tl.Undefined. Now we explicitely reset the default value
of Q0_vec, h_vec and k_vec
  • Loading branch information
mikibonacci committed Dec 3, 2024
1 parent 2332b16 commit 29c363f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/aiidalab_qe_vibroscopy/app/widgets/euphonicmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ def set_model_state(self, parameters: dict):
setattr(self, k, v)

def _get_default(self, trait):
if trait in ["h_vec", "k_vec"]:
return [1, 1, 1, 100, 1]
elif trait == "Q0_vec":
return [0.0, 0.0, 0.0]
return self.traits()[trait].default_value

def get_model_state(self):
Expand Down
5 changes: 4 additions & 1 deletion src/aiidalab_qe_vibroscopy/app/widgets/euphonicwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ class EuphonicSuperWidget(ipw.VBox):
In between, we trigger the initialization of plots via a button.
"""

def __init__(self, mode="aiidalab-qe app plugin", model=None, fc=None, q_path=None):
def __init__(
self, mode="aiidalab-qe app plugin", model=None, node=None, fc=None, q_path=None
):
"""
Initialize the Euphonic utility class.
Parameters:
Expand Down Expand Up @@ -148,6 +150,7 @@ def __init__(self, mode="aiidalab-qe app plugin", model=None, fc=None, q_path=No

self.mode = mode
self._model = model # this is the single crystal model.
self._model.node = node
self._model.fc_hdf5_content = None

self.rendered = False
Expand Down

0 comments on commit 29c363f

Please sign in to comment.