Skip to content

Commit

Permalink
enh: show wait cursor when computing lme4 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 15, 2021
1 parent 8835814 commit c0f6c82
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions shapeout2/gui/compute/comp_lme4.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from .comp_lme4_dataset import LME4Dataset
from .comp_lme4_results import Rlme4ResultsDialog

from ..widgets import ShowWaitCursor


class ComputeSignificance(QtWidgets.QDialog):
def __init__(self, parent, pipeline, *args, **kwargs):
Expand Down Expand Up @@ -74,10 +76,13 @@ def on_lme4(self, ret_dlg=False):
If set to True, then the dialog is returned without
`_exec`uting it (used for testing).
"""
rlme4 = lme4.Rlme4(model=self.model, feature=self.feature)
for wds in self.datasets:
wds.add_to_rlme4(self.pipeline, rlme4)
result = rlme4.fit()
self.setEnabled(False)
with ShowWaitCursor():
rlme4 = lme4.Rlme4(model=self.model, feature=self.feature)
for wds in self.datasets:
wds.add_to_rlme4(self.pipeline, rlme4)
result = rlme4.fit()
self.setEnabled(True)
dlg = Rlme4ResultsDialog(self, result)
if ret_dlg:
return dlg
Expand Down

0 comments on commit c0f6c82

Please sign in to comment.