diff --git a/uit/gui_tools/connect.py b/uit/gui_tools/connect.py index 213c083..26d14c0 100644 --- a/uit/gui_tools/connect.py +++ b/uit/gui_tools/connect.py @@ -57,8 +57,8 @@ def panel(self): class HpcConnect(param.Parameterized): uit_client = param.ClassSelector(Client) - system = param.ObjectSelector() - login_node = param.ObjectSelector(default=None, objects=[None], label='Login Node') + system = param.Selector() + login_node = param.Selector(default=None, objects=[None], label='Login Node') exclude_nodes = param.ListSelector(default=list(), objects=[], label='Exclude Nodes') connected = param.Boolean(default=False, allow_None=True) connect_btn = param.Action(lambda self: self.connect(), label='Connect') diff --git a/uit/gui_tools/file_browser.py b/uit/gui_tools/file_browser.py index 5b27b9d..2c91f75 100644 --- a/uit/gui_tools/file_browser.py +++ b/uit/gui_tools/file_browser.py @@ -98,7 +98,7 @@ class FileTransfer(param.Parameterized): precedence=-1 ) - from_location = param.ObjectSelector( + from_location = param.Selector( default='local', objects=['local'], precedence=0.21 @@ -106,7 +106,7 @@ class FileTransfer(param.Parameterized): from_directory = param.String( precedence=0.22 ) - to_location = param.ObjectSelector( + to_location = param.Selector( default='local', objects=['local'], precedence=0.31 @@ -395,9 +395,10 @@ def __new__(cls, *args, is_dir=None, uit_client=None): self = super().__new__(cls, *args) self._init(is_dir=is_dir, uit_client=uit_client) return self + def __truediv__(self, key): new_path = super().__truediv__(key) - new_path.__init__(uit_client=self.uit_client) + new_path.__initialize__(uit_client=self.uit_client) return new_path def _ensure_connected(method): @@ -418,7 +419,7 @@ def ls(self): @property def parent(self): parent = super().parent - parent.__init__(is_dir=True, uit_client=self.uit_client) + parent.__initialize__(is_dir=True, uit_client=self.uit_client) return parent @_ensure_connected @@ -623,7 +624,7 @@ def __init__(self, **params): class FileViewer(param.Parameterized): update_btn = param.Action(lambda self: self.get_file_contents(), label='Update', precedence=5) n = param.Integer(default=500, bounds=(0, 10_000), precedence=2) - cmd = param.ObjectSelector(default='head', objects=['head', 'tail', 'grep'], label='Command', precedence=1) + cmd = param.Selector(default='head', objects=['head', 'tail', 'grep'], label='Command', precedence=1) line_wrap = param.Boolean(label='Line Wrap', precedence=3) wrap_length = param.Integer(default=100, label='Wrap Length', precedence=4) file_select = param.ClassSelector(FileSelector, default=FileSelector()) diff --git a/uit/gui_tools/submit.py b/uit/gui_tools/submit.py index 9a2d91b..e1d2fee 100644 --- a/uit/gui_tools/submit.py +++ b/uit/gui_tools/submit.py @@ -16,16 +16,16 @@ class PbsScriptInputs(param.Parameterized): - hpc_subproject = param.ObjectSelector(default=None, label='HPC Subproject', precedence=3) + hpc_subproject = param.Selector(default=None, label='HPC Subproject', precedence=3) subproject_usage = param.DataFrame(precedence=3.1) workdir = param.String(default='', precedence=4) - node_type = param.ObjectSelector(default='', objects=[], label='Node Type', precedence=5) + node_type = param.Selector(default='', objects=[], label='Node Type', precedence=5) nodes = param.Integer(default=1, bounds=(1, 1000), precedence=5.1) - processes_per_node = param.ObjectSelector(default=1, objects=[], label='Processes per Node', precedence=5.2) + processes_per_node = param.Selector(default=1, objects=[], label='Processes per Node', precedence=5.2) wall_time = param.String(default='01:00:00', label='Wall Time', precedence=6) wall_time_alert = pn.pane.Alert(visible=False) node_alert = pn.pane.Alert(visible=False) - queue = param.ObjectSelector(default=QUEUES[0], objects=QUEUES, precedence=7) + queue = param.Selector(default=QUEUES[0], objects=QUEUES, precedence=7) max_wall_time = param.String(default='Not Found', label='Max Wall Time', precedence=7.1) max_nodes = param.String(default='Not Found', label='Max Processes', precedence=7.2) submit_script_filename = param.String(default='run.pbs', precedence=8) @@ -141,6 +141,7 @@ def pbs_options_view(self): title='Subproject Usage Summary', sizing_mode='stretch_width', collapsed=True, + margin=(10, 0), ) ), pn.Column( @@ -290,6 +291,7 @@ def environment_variables_view(self): self.file_browser_col, title='Environment Variables', sizing_mode='stretch_width', + margin=(10, 0), ) def advanced_options_view(self): @@ -303,6 +305,7 @@ def advanced_options_view(self): title='Modules', sizing_mode='stretch_width', collapsed=True, + margin=(10, 0), ), name='Environment', ) diff --git a/uit/gui_tools/utils.py b/uit/gui_tools/utils.py index 04cabdf..83828bf 100644 --- a/uit/gui_tools/utils.py +++ b/uit/gui_tools/utils.py @@ -104,8 +104,8 @@ class PbsJobTabbedViewer(HpcWorkspaces): title = param.String() jobs = param.List() tabs = param.List() - selected_job = param.ObjectSelector(default=None, label='Job') - selected_sub_job = param.ObjectSelector(label='Experiment Point', precedence=0.1) + selected_job = param.Selector(default=None, label='Job') + selected_sub_job = param.Selector(label='Experiment Point', precedence=0.1) active_job = param.Parameter() custom_logs = param.List(default=[]) ready = param.Boolean() @@ -142,8 +142,7 @@ def is_array(self): def update_selected_job(self): if not self.environment_variables: self.update_configurable_hpc_parameters() - self.param.selected_job.names = {j.job_id: j for j in self.jobs} - self.param.selected_job.objects = self.jobs + self.param.selected_job.objects = {j.job_id: j for j in self.jobs} self.selected_job = self.jobs[0] if self.jobs else None self.param.selected_job.precedence = 1 if len(self.jobs) > 1 else -1 @@ -159,8 +158,7 @@ def update_selected_job_dependencies(self): def update_selected_sub_job(self): objects = [j for j in self.selected_job.sub_jobs] - self.param.selected_sub_job.names = {j.job_id: j for j in objects} - self.param.selected_sub_job.objects = objects + self.param.selected_sub_job.objects = {j.job_id: j for j in objects} if objects: self.selected_sub_job = objects[0] @@ -245,7 +243,7 @@ def panel(self): class LogsTab(TabView): title = param.String(default='Logs') - log = param.ObjectSelector(objects=[], label='Log File', precedence=0.2) + log = param.Selector(objects=[], label='Log File', precedence=0.2) log_content = param.String() custom_logs = param.List(default=[]) num_log_lines = param.Integer(default=100, label='n')