-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from spapa013/main
v0.0.16
- Loading branch information
Showing
4 changed files
with
83 additions
and
17 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py
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 @@ | ||
from .apps import MaterializationManager |
65 changes: 65 additions & 0 deletions
65
python/microns-materialization-api/microns_materialization_api/dashboard/apps.py
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,65 @@ | ||
import wridgets.app as wra | ||
from ..schemas import \ | ||
minnie65_materialization as m65mat | ||
|
||
class MaterializationManager(wra.App): | ||
store_config = [ | ||
'value', | ||
'options' | ||
] | ||
|
||
def make(self, set_button=None, ver=None, on_select=None, **kwargs): | ||
self.propagate = True | ||
self.options = self.materializations | ||
|
||
label_kws = dict( | ||
name='MatLabel', | ||
text='Materialization', | ||
output=self.output, | ||
) | ||
buttons_kws = dict( | ||
name='MatButtons', | ||
options=self.options, | ||
on_interact=self.update_dropdown_options, | ||
output=self.output | ||
) | ||
dropdown_kws = dict( | ||
name='MatDropdown', | ||
options=self.options[0][1], | ||
on_interact=self.set_value, | ||
output=self.output | ||
) | ||
|
||
select_kws = dict( | ||
name='MatSelectButton', | ||
description='Select', | ||
button_style='info', | ||
on_interact=on_select | ||
) | ||
|
||
self.core = wra.Label(**label_kws) + wra.SelectButtons(**buttons_kws) + \ | ||
wra.Dropdown(**dropdown_kws) + wra.ToggleButton(**select_kws) | ||
|
||
if set_button is not None: | ||
self.children.MatButtons.set(label=set_button) | ||
self.set_value(ver=ver) | ||
|
||
def update_dropdown_options(self): | ||
self.children.MatDropdown.set( | ||
options=self.children.MatButtons.get1('value')) | ||
|
||
def set_value(self, ver=None): | ||
if ver is not None: | ||
self.children.MatDropdown.set(value=ver) | ||
self.value = self.children.MatDropdown.get1('value') | ||
|
||
@property | ||
def materializations(self): | ||
return [ | ||
('latest', m65mat.Materialization.latest.fetch( | ||
'ver', order_by='ver DESC').tolist()), | ||
('stable', m65mat.Materialization.long_term_support.fetch( | ||
'ver', order_by='ver DESC').tolist()), | ||
('all', m65mat.Materialization.CAVE.fetch( | ||
'ver', order_by='ver DESC').tolist()) | ||
] |
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 +1 @@ | ||
__version__ = "0.0.15" | ||
__version__ = "0.0.16" |