diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py new file mode 100644 index 0000000..e6a05e4 --- /dev/null +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py @@ -0,0 +1 @@ +from .apps import MaterializationManager \ No newline at end of file diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py new file mode 100644 index 0000000..87c40c3 --- /dev/null +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py @@ -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()) + ] \ No newline at end of file diff --git a/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py b/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py index 21b44e4..bc07b8f 100644 --- a/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py +++ b/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py @@ -22,7 +22,7 @@ # Utils from microns_utils.adapter_utils import adapt_mesh_hdf5 -from microns_utils.ap_utils import set_CAVE_client +from microns_utils.ap_utils import set_CAVEclient from microns_utils.filepath_utils import (append_timestamp_to_filepath, get_file_modification_time) from microns_utils.misc_utils import wrap @@ -56,7 +56,7 @@ def update_method(cls, ver=None, **kwargs): datastack = 'minnie65_phase3_v1' # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1({ 'caveclient_version': cpvfd('caveclient'), 'datastack': datastack, @@ -68,7 +68,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], ver=params['ver']) + client = set_CAVEclient(params['datastack'], ver=params['ver']) self.master.validate_method( names=('caveclient version', 'datastack', 'materialization_version'), method_values=(params['caveclient_version'], params['datastack'], params['ver']), @@ -89,7 +89,7 @@ def update_method(cls, ver=None, **kwargs): datastack = 'minnie65_phase3_v1' # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1({ 'caveclient_version': cpvfd('caveclient'), 'datastack': datastack, @@ -101,7 +101,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], ver=params['ver']) + client = set_CAVEclient(params['datastack'], ver=params['ver']) self.master.validate_method( names=('caveclient version', 'datastack', 'materialization_version'), method_values=(params['caveclient_version'], params['datastack'], params['ver']), @@ -153,7 +153,7 @@ def update_method(cls, ver=None, download_meshes_kwargs={}, **kwargs): download_meshes_kwargs.setdefault('progress', False) # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1( { 'description' : '', @@ -164,7 +164,7 @@ def update_method(cls, ver=None, download_meshes_kwargs={}, **kwargs): 'ver': ver if ver is not None else client.materialize.version, 'cloudvolume_path': client.info.segmentation_source(), 'download_meshes_kwargs': json.dumps(download_meshes_kwargs), - 'target_dir': m65mat.config.externals['minnie65_meshes']['location'], + 'target_dir': config.externals['minnie65_meshes']['location'], }, insert_to_master=True, @@ -176,7 +176,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], params['ver']) + client = set_CAVEclient(params['datastack'], params['ver']) packages = { 'meshparty_version': 'meshparty', 'caveclient_version': 'caveclient', @@ -231,7 +231,7 @@ def update_method(cls, ver=None, **kwargs): datastack = 'minnie65_phase3_v1' # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1({ 'caveclient_version': cpvfd('caveclient'), 'datastack': datastack, @@ -243,7 +243,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], ver=params['ver']) + client = set_CAVEclient(params['datastack'], ver=params['ver']) self.master.validate_method( names=('caveclient version', 'datastack', 'materialization_version'), method_values=(params['caveclient_version'], params['datastack'], params['ver']), @@ -299,7 +299,7 @@ def update_method(cls, ver=None, pcg_meshwork_params={}, **kwargs): pcg_meshwork_params.setdefault('root_point_resolution', [4,4,40]) # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1( { 'meshparty_version': cpvfd('meshparty'), @@ -312,7 +312,7 @@ def update_method(cls, ver=None, pcg_meshwork_params={}, **kwargs): 'cloudvolume_version': cpvfd('cloud-volume'), 'cloudvolume_path': client.info.segmentation_source(), 'pcg_meshwork_params': json.dumps(pcg_meshwork_params), - 'target_dir': m65mat.config.externals['minnie65_meshwork']['location'], + 'target_dir': config.externals['minnie65_meshwork']['location'], }, insert_to_master=True, @@ -324,7 +324,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], ver=params['ver']) + client = set_CAVEclient(params['datastack'], ver=params['ver']) # validate package dependencies packages = { @@ -401,7 +401,7 @@ def update_method(cls, ver=None, pcg_skel_params={}, **kwargs): pcg_skel_params.setdefault('root_point_resolution', [4,4,40]) # INSERT - client = set_CAVE_client(datastack, ver) + client = set_CAVEclient(datastack, ver) cls.insert1( { 'meshparty_version': cpvfd('meshparty'), @@ -414,7 +414,7 @@ def update_method(cls, ver=None, pcg_skel_params={}, **kwargs): 'cloudvolume_version': cpvfd('cloud-volume'), 'cloudvolume_path': client.info.segmentation_source(), 'pcg_skel_params': json.dumps(pcg_skel_params), - 'target_dir': m65mat.config.externals['minnie65_pcg_skeletons']['location'], + 'target_dir': config.externals['minnie65_pcg_skeletons']['location'], }, insert_to_master=True, @@ -427,7 +427,7 @@ def run(self, **kwargs): self.Log('info', f'Running {self.class_name} with params {params}.') # INITIALIZE & VALIDATE - client = set_CAVE_client(params['datastack'], ver=params['ver']) + client = set_CAVEclient(params['datastack'], ver=params['ver']) # validate package dependencies packages = { diff --git a/python/version.py b/python/version.py index 6561790..d62d967 100644 --- a/python/version.py +++ b/python/version.py @@ -1 +1 @@ -__version__ = "0.0.15" +__version__ = "0.0.16"