Skip to content

Commit

Permalink
Diable load results button after the first click (#316)
Browse files Browse the repository at this point in the history
* diable show load button after first click

* remove title
  • Loading branch information
ordabayevy authored Apr 13, 2022
1 parent fee1456 commit 0cae996
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Binary file modified docs/source/tutorials/view-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 6 additions & 13 deletions tapqir/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import torch
from ipyevents import Event
from ipyfilechooser import FileChooser
from IPython.display import Image, display
from IPython.display import display
from tensorboard import notebook
from tqdm import tqdm_notebook
from traitlets.utils.bunch import Bunch
Expand Down Expand Up @@ -457,11 +457,9 @@ def showUI(out, DEFAULTS):
view = widgets.Output()
params = widgets.VBox(children=[controls, view])
summary = widgets.Output()
fov = widgets.Output()
sum_view = widgets.Accordion(children=[params, summary, fov])
sum_view = widgets.Accordion(children=[params, summary])
sum_view.set_title(0, "AOI images and parameters")
sum_view.set_title(1, "Summary statistics")
sum_view.set_title(2, "FOV, AOI, and offset images")
sum_view.selected_index = 0
# Layout
layout.children = [modelSelect, channelNumber, showParams, sum_view]
Expand All @@ -471,7 +469,7 @@ def showUI(out, DEFAULTS):


def showCmd(b, layout, out):
params, summary, fov = layout.children[-1].children
params, summary = layout.children[-1].children
controls, view = params.children
with out:
logger.info("Loading results ...")
Expand All @@ -487,16 +485,10 @@ def showCmd(b, layout, out):
out.clear_output(wait=True)
return
model, fig, item, ax = show_ret
with summary:
display(model.summary)
with view:
plt.show()
with fov:
display(Image(filename=model.path / f"ontarget-channel{model.cdx}.png"))
display(Image(filename=model.path / f"offtarget-channel{model.cdx}.png"))
display(Image(filename=model.path / f"offset-channel{model.cdx}.png"))
display(Image(filename=model.path / "offset-distribution.png", width=500))
display(Image(filename=model.path / "offset-medians.png"))
with summary:
display(model.summary)
n = widgets.BoundedIntText(
value=0,
min=0,
Expand Down Expand Up @@ -639,6 +631,7 @@ def showCmd(b, layout, out):
logger.info("Loading results: Done")

out.clear_output(wait=True)
b.disabled = True


def onKeyPress(event, n, f1, zoom, targets, nonspecific):
Expand Down

0 comments on commit 0cae996

Please sign in to comment.