Skip to content

Commit

Permalink
Merge pull request #23 from spapa013/main
Browse files Browse the repository at this point in the history
v0.0.16
  • Loading branch information
spapa013 authored Aug 31, 2022
2 parents 5c29bb2 + c1b9ca4 commit 2090645
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .apps import MaterializationManager
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())
]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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']),
Expand All @@ -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,
Expand All @@ -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']),
Expand Down Expand Up @@ -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' : '',
Expand All @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -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,
Expand All @@ -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']),
Expand Down Expand Up @@ -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'),
Expand All @@ -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,
Expand All @@ -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 = {
Expand Down Expand Up @@ -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'),
Expand All @@ -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,
Expand All @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion python/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.15"
__version__ = "0.0.16"

0 comments on commit 2090645

Please sign in to comment.