Skip to content

Commit

Permalink
adding logic for reset symprec
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresOrtegaGuerrero committed Nov 29, 2024
1 parent 1ea22a0 commit 16b999d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
7 changes: 7 additions & 0 deletions src/aiidalab_qe_vibroscopy/app/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ def supercell_reset(self, _=None):
if not self.disable_z:
self.supercell_z = self._get_default("supercell_x")
self.supercell = [self.supercell_x, self.supercell_y, self.supercell_z]

def reset_symprec(self, _=None):
self.symmetry_symprec = (
self._get_default("symmetry_symprec")
if self.input_structure.pbc != (True, False, False)
else 1e-3
)
20 changes: 11 additions & 9 deletions src/aiidalab_qe_vibroscopy/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def render(self):
"value",
)

self.symmetry_symprec = ipw.FloatText(
self.symmetry_symprec = ipw.BoundedFloatText(
max=1,
min=1e-7,
step=1e-4,
Expand Down Expand Up @@ -231,6 +231,16 @@ def render(self):
button_style="info",
tooltip="Number of supercells for phonons calculations;\nwarning: for large systems, this may take some time.",
)

self.symmetry_symprec_reset_button = ipw.Button(
description="Reset symprec",
disabled=False,
layout=ipw.Layout(width="125px"),
button_style="warning",
)
# supercell reset reaction
self.symmetry_symprec_reset_button.on_click(self._model.reset_symprec)

# supercell reset reaction
# self.supercell_estimate_button.on_click(self._estimate_supercells)

Expand Down Expand Up @@ -264,14 +274,6 @@ def render(self):
# self.symmetry_symprec.observe(self._activate_estimate_supercells, "value")

# reset supercell
self.symmetry_symprec_reset_button = ipw.Button(
description="Reset symprec",
disabled=False,
layout=ipw.Layout(width="125px"),
button_style="warning",
)
# supercell reset reaction
# self.symmetry_symprec_reset_button.on_click(self._reset_symprec)

self.children = [
ipw.VBox(
Expand Down

0 comments on commit 16b999d

Please sign in to comment.