From 908813a1104d90d9a92f465c7a9deeee384a34d8 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Tue, 24 May 2022 00:34:53 -0500 Subject: [PATCH 01/10] update version --- .../minnie_materialization/minnie65_materialization.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..3a77116 100644 --- a/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py +++ b/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py @@ -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, @@ -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, @@ -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, From a79c7c9447bcbf895089fbaa53912d07a5abb871 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Tue, 24 May 2022 00:38:43 -0500 Subject: [PATCH 02/10] update for consistent nomenclature --- .../minnie_materialization/minnie65_materialization.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..3a77116 100644 --- a/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py +++ b/python/microns-materialization/microns_materialization/minnie_materialization/minnie65_materialization.py @@ -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, @@ -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, @@ -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, From cd0b5cf93cdbada41d1b6759ff1b7195cf42d021 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Tue, 7 Jun 2022 03:27:55 -0500 Subject: [PATCH 03/10] updates set_CAVE_client to set_CAVEclient --- .../minnie65_materialization.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) 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 3a77116..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' : '', @@ -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'), @@ -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'), @@ -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 = { From 649858bb87a3d6f2f167c62b4ea71ab5221bf4d0 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Fri, 29 Jul 2022 13:51:08 -0500 Subject: [PATCH 04/10] add dashboard module with applets.py --- .../dashboard/applets.py | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 python/microns-materialization-api/microns_materialization_api/dashboard/applets.py diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/applets.py b/python/microns-materialization-api/microns_materialization_api/dashboard/applets.py new file mode 100644 index 0000000..387fe78 --- /dev/null +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/applets.py @@ -0,0 +1,55 @@ +import wridgets.app as wra +from ..schemas import \ + minnie65_materialization as m65mat + +class MatApp(wra.App): + store_config = [ + 'value', + ('options', [ + ('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()) + ]) + ] + + def make(self, on_select=None, **kwargs): + self.propagate = True + + 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) + self.set_value() + + def update_dropdown_options(self): + self.children.MatDropdown.set( + options=self.children.MatButtons.get1('value')) + + def set_value(self): + self.value = self.children.MatDropdown.get1('value') From 8bbf2f39c673a6a6b763b8b9b824328e591fbc23 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Fri, 29 Jul 2022 13:51:27 -0500 Subject: [PATCH 05/10] update version.py --- python/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 520247097688f81107329c2aa6efc97993361f21 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Fri, 29 Jul 2022 13:57:49 -0500 Subject: [PATCH 06/10] adds __init__.py to dashboard --- .../microns_materialization_api/dashboard/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py 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..e69de29 From 316249d5dfe8ea537b7d9e75e6c49a238b1da712 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Wed, 17 Aug 2022 04:42:39 -0500 Subject: [PATCH 07/10] rename applets to apps and import in dashboard.__init__ --- .../microns_materialization_api/dashboard/__init__.py | 1 + .../dashboard/{applets.py => apps.py} | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename python/microns-materialization-api/microns_materialization_api/dashboard/{applets.py => apps.py} (97%) diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py index e69de29..c37ef00 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py @@ -0,0 +1 @@ +from .apps import MatApp \ No newline at end of file diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/applets.py b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py similarity index 97% rename from python/microns-materialization-api/microns_materialization_api/dashboard/applets.py rename to python/microns-materialization-api/microns_materialization_api/dashboard/apps.py index 387fe78..16d1ab1 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/applets.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py @@ -2,7 +2,7 @@ from ..schemas import \ minnie65_materialization as m65mat -class MatApp(wra.App): +class SetMaterializationApp(wra.App): store_config = [ 'value', ('options', [ From f59a3770a92a884f68fd0d29c9acb88850415984 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Wed, 17 Aug 2022 04:45:29 -0500 Subject: [PATCH 08/10] update import --- .../microns_materialization_api/dashboard/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py index c37ef00..d64a8ba 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py @@ -1 +1 @@ -from .apps import MatApp \ No newline at end of file +from .apps import SetMaterializationApp \ No newline at end of file From c8f534f340530d0212ecd8cb9ca753effb7a22eb Mon Sep 17 00:00:00 2001 From: spapa013 Date: Tue, 23 Aug 2022 08:02:23 -0500 Subject: [PATCH 09/10] update SetMaterializationApp --- .../dashboard/apps.py | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py index 16d1ab1..394d747 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py @@ -5,18 +5,12 @@ class SetMaterializationApp(wra.App): store_config = [ 'value', - ('options', [ - ('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()) - ]) + 'options' ] - def make(self, on_select=None, **kwargs): + def make(self, set_button=None, ver=None, on_select=None, **kwargs): self.propagate = True + self.options = self.materializations label_kws = dict( name='MatLabel', @@ -45,11 +39,27 @@ def make(self, on_select=None, **kwargs): self.core = wra.Label(**label_kws) + wra.SelectButtons(**buttons_kws) + \ wra.Dropdown(**dropdown_kws) + wra.ToggleButton(**select_kws) - self.set_value() + + 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): + 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 From c1b9ca4d7404cdd5b6b439b25f578e285f49cf27 Mon Sep 17 00:00:00 2001 From: spapa013 Date: Tue, 23 Aug 2022 16:24:42 -0500 Subject: [PATCH 10/10] update SetMaterializationApp name to MaterializationManager --- .../microns_materialization_api/dashboard/__init__.py | 2 +- .../microns_materialization_api/dashboard/apps.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py index d64a8ba..e6a05e4 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/__init__.py @@ -1 +1 @@ -from .apps import SetMaterializationApp \ No newline at end of file +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 index 394d747..87c40c3 100644 --- a/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py +++ b/python/microns-materialization-api/microns_materialization_api/dashboard/apps.py @@ -2,7 +2,7 @@ from ..schemas import \ minnie65_materialization as m65mat -class SetMaterializationApp(wra.App): +class MaterializationManager(wra.App): store_config = [ 'value', 'options'