-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert separate notebooks into tabs
- Loading branch information
1 parent
e514da5
commit 8c80ad2
Showing
7 changed files
with
92 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from .manage_samples import ManageSamplesMenu | ||
from .submit_experiment import MainPanel | ||
from .submit_experiment import ExperimentBuilder | ||
from .visualize_results import CyclingResultsWidget | ||
|
||
__all__ = [ | ||
"ManageSamplesMenu", | ||
"MainPanel", | ||
"ExperimentBuilder", | ||
"CyclingResultsWidget", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import ipywidgets as ipw | ||
|
||
from aurora import __version__ | ||
from aurora.interface.menus import (CyclingResultsWidget, ExperimentBuilder, | ||
ManageSamplesMenu) | ||
|
||
|
||
class MainPanel(ipw.VBox): | ||
""" | ||
Aurora's main panel containing the tab sections for submitting | ||
experiments, managing the samples/protocols inventory, and | ||
visualizing experiment results. | ||
""" | ||
|
||
TITLE = f""" | ||
<div style="text-align: center;"> | ||
<h1>AURORA</h1> | ||
<p>Version {__version__}</p> | ||
</div> | ||
""" | ||
|
||
TAB_LABELS = ( | ||
"Experiment", | ||
"Inventory", | ||
"Results", | ||
) | ||
|
||
def __init__(self) -> None: | ||
"""`MainPanel` constructor.""" | ||
|
||
header = ipw.VBox( | ||
layout={ | ||
'width': '100%', | ||
'border': 'solid black 4px', | ||
'padding': '10px' | ||
}, | ||
children=[ | ||
ipw.HTML(self.TITLE), | ||
], | ||
) | ||
|
||
tabs = self._build_tabs() | ||
|
||
super().__init__( | ||
layout={}, | ||
children=[ | ||
header, | ||
tabs, | ||
], | ||
) | ||
|
||
def _build_tabs(self) -> ipw.Tab: | ||
"""Build the main tab sections. | ||
Returns | ||
------- | ||
`ipw.Tab` | ||
The tab sections of the main panel. | ||
""" | ||
|
||
experiment = ExperimentBuilder() | ||
manager = ManageSamplesMenu() | ||
visualizer = CyclingResultsWidget() | ||
|
||
tabs = ipw.Tab( | ||
children=[ | ||
experiment, | ||
manager, | ||
visualizer, | ||
], | ||
selected_index=0, | ||
) | ||
|
||
for i, title in enumerate(self.TAB_LABELS): | ||
tabs.set_title(i, title) | ||
|
||
return tabs |