Skip to content

Commit 1034d0a

Browse files
committed
minor refactor
1 parent 83dc5cb commit 1034d0a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

waveform_editor/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def panel(self, nice_mode):
6363
if p == "name":
6464
continue
6565

66+
# Add warning indicator if required parameter is not filled
6667
is_inv_required = p == "inv_executable" and nice_mode == self.INVERSE_MODE
6768
is_dir_required = p == "dir_executable" and nice_mode == self.DIRECT_MODE
6869
is_base_required = p in self.BASE_REQUIRED

waveform_editor/shape_editor/coil_currents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CoilCurrents(Viewer):
1212
coil_ui = param.List(
1313
doc="List of tuples containing the checkboxes and sliders for the coil currents"
1414
)
15-
nice_mode = param.Parameter(allow_refs=True)
15+
nice_mode = param.Selector(allow_refs=True)
1616

1717
def __init__(self, **params):
1818
super().__init__(**params)

waveform_editor/shape_editor/nice_plotter.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class NicePlotter(Viewer):
2626
pf_active = param.ClassSelector(class_=IDSToplevel, precedence=-1)
2727
plasma_shape = param.ClassSelector(class_=PlasmaShape, precedence=-1)
2828
plasma_properties = param.ClassSelector(class_=PlasmaProperties, precedence=-1)
29-
nice_mode = param.Parameter(precedence=-1, allow_refs=True)
29+
nice_mode = param.Selector(precedence=-1, allow_refs=True)
3030

3131
# Plot parameters
3232
show_contour = param.Boolean(default=True, label="Show contour lines")
@@ -88,6 +88,15 @@ def __init__(self, **params):
8888
self.profiles_pane = pn.pane.HoloViews(
8989
profiles_plot, width=self.PROFILE_WIDTH, height=self.PROFILE_HEIGHT
9090
)
91+
self.panel_layout = pn.Param(
92+
self.param,
93+
show_name=False,
94+
widgets={
95+
"show_desired_shape": {
96+
"visible": self.param.nice_mode.rx() == NiceSettings.INVERSE_MODE
97+
}
98+
},
99+
)
91100

92101
@pn.depends("plasma_properties.profile_updated")
93102
def _plot_profiles(self):
@@ -392,12 +401,4 @@ def _plot_xo_points(self):
392401
return o_scatter * x_scatter
393402

394403
def __panel__(self):
395-
return pn.Param(
396-
self.param,
397-
show_name=False,
398-
widgets={
399-
"show_desired_shape": {
400-
"visible": self.param.nice_mode.rx() == NiceSettings.INVERSE_MODE
401-
}
402-
},
403-
)
404+
return self.panel_layout

0 commit comments

Comments
 (0)