mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(cmaps): unified all defaults to magma cmap
This commit is contained in:
@ -483,7 +483,7 @@ class BECFigure(RPCBase):
|
|||||||
y_entry: "str | None" = None,
|
y_entry: "str | None" = None,
|
||||||
z_entry: "str | None" = None,
|
z_entry: "str | None" = None,
|
||||||
color: "str | None" = None,
|
color: "str | None" = None,
|
||||||
color_map_z: "str | None" = "plasma",
|
color_map_z: "str | None" = "magma",
|
||||||
label: "str | None" = None,
|
label: "str | None" = None,
|
||||||
validate: "bool" = True,
|
validate: "bool" = True,
|
||||||
new: "bool" = False,
|
new: "bool" = False,
|
||||||
@ -1728,7 +1728,7 @@ class BECWaveform(RPCBase):
|
|||||||
y_entry: "str | None" = None,
|
y_entry: "str | None" = None,
|
||||||
z_entry: "str | None" = None,
|
z_entry: "str | None" = None,
|
||||||
color: "str | None" = None,
|
color: "str | None" = None,
|
||||||
color_map_z: "str | None" = "plasma",
|
color_map_z: "str | None" = "magma",
|
||||||
label: "str | None" = None,
|
label: "str | None" = None,
|
||||||
validate: "bool" = True,
|
validate: "bool" = True,
|
||||||
dap: "str | None" = None,
|
dap: "str | None" = None,
|
||||||
@ -2042,7 +2042,7 @@ class BECWaveformWidget(RPCBase):
|
|||||||
y_entry: "str | None" = None,
|
y_entry: "str | None" = None,
|
||||||
z_entry: "str | None" = None,
|
z_entry: "str | None" = None,
|
||||||
color: "str | None" = None,
|
color: "str | None" = None,
|
||||||
color_map_z: "str | None" = "plasma",
|
color_map_z: "str | None" = "magma",
|
||||||
label: "str | None" = None,
|
label: "str | None" = None,
|
||||||
validate: "bool" = True,
|
validate: "bool" = True,
|
||||||
dap: "str | None" = None,
|
dap: "str | None" = None,
|
||||||
|
@ -252,7 +252,7 @@ class BECFigure(BECWidget, pg.GraphicsLayoutWidget):
|
|||||||
y_entry: str | None = None,
|
y_entry: str | None = None,
|
||||||
z_entry: str | None = None,
|
z_entry: str | None = None,
|
||||||
color: str | None = None,
|
color: str | None = None,
|
||||||
color_map_z: str | None = "plasma",
|
color_map_z: str | None = "magma",
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
validate: bool = True,
|
validate: bool = True,
|
||||||
new: bool = False,
|
new: bool = False,
|
||||||
|
@ -26,7 +26,7 @@ from bec_widgets.widgets.figure.plots.waveform.waveform_curve import (
|
|||||||
|
|
||||||
class Waveform1DConfig(SubplotConfig):
|
class Waveform1DConfig(SubplotConfig):
|
||||||
color_palette: Optional[str] = Field(
|
color_palette: Optional[str] = Field(
|
||||||
"plasma", description="The color palette of the figure widget.", validate_default=True
|
"magma", description="The color palette of the figure widget.", validate_default=True
|
||||||
)
|
)
|
||||||
curves: dict[str, CurveConfig] = Field(
|
curves: dict[str, CurveConfig] = Field(
|
||||||
{}, description="The list of curves to be added to the 1D waveform widget."
|
{}, description="The list of curves to be added to the 1D waveform widget."
|
||||||
@ -269,7 +269,7 @@ class BECWaveform(BECPlotBase):
|
|||||||
y_entry: str | None = None,
|
y_entry: str | None = None,
|
||||||
z_entry: str | None = None,
|
z_entry: str | None = None,
|
||||||
color: str | None = None,
|
color: str | None = None,
|
||||||
color_map_z: str | None = "plasma",
|
color_map_z: str | None = "magma",
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
validate: bool = True,
|
validate: bool = True,
|
||||||
dap: str | None = None, # TODO add dap custom curve wrapper
|
dap: str | None = None, # TODO add dap custom curve wrapper
|
||||||
@ -481,7 +481,7 @@ class BECWaveform(BECPlotBase):
|
|||||||
y_entry: str | None = None,
|
y_entry: str | None = None,
|
||||||
z_entry: str | None = None,
|
z_entry: str | None = None,
|
||||||
color: str | None = None,
|
color: str | None = None,
|
||||||
color_map_z: str | None = "plasma",
|
color_map_z: str | None = "magma",
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
validate_bec: bool = True,
|
validate_bec: bool = True,
|
||||||
dap: str | None = None,
|
dap: str | None = None,
|
||||||
|
@ -52,7 +52,7 @@ class CurveConfig(ConnectionConfig):
|
|||||||
source: Optional[str] = Field(None, description="The source of the curve.")
|
source: Optional[str] = Field(None, description="The source of the curve.")
|
||||||
signals: Optional[Signal] = Field(None, description="The signal of the curve.")
|
signals: Optional[Signal] = Field(None, description="The signal of the curve.")
|
||||||
color_map_z: Optional[str] = Field(
|
color_map_z: Optional[str] = Field(
|
||||||
"plasma", description="The colormap of the curves z gradient.", validate_default=True
|
"magma", description="The colormap of the curves z gradient.", validate_default=True
|
||||||
)
|
)
|
||||||
|
|
||||||
model_config: dict = {"validate_assignment": True}
|
model_config: dict = {"validate_assignment": True}
|
||||||
|
@ -281,7 +281,7 @@ class DialogRow(QObject):
|
|||||||
self.symbol_size.setValue(self.config.symbol_size)
|
self.symbol_size.setValue(self.config.symbol_size)
|
||||||
else:
|
else:
|
||||||
default_colors = Colors.golden_angle_color(
|
default_colors = Colors.golden_angle_color(
|
||||||
colormap="plasma", num=max(10, self.row + 1), format="HEX"
|
colormap="magma", num=max(10, self.row + 1), format="HEX"
|
||||||
)
|
)
|
||||||
default_color = default_colors[self.row]
|
default_color = default_colors[self.row]
|
||||||
self.color_button.setColor(default_color)
|
self.color_button.setColor(default_color)
|
||||||
@ -305,7 +305,7 @@ class DialogRow(QObject):
|
|||||||
self.symbol_size.setValue(self.config.symbol_size)
|
self.symbol_size.setValue(self.config.symbol_size)
|
||||||
else:
|
else:
|
||||||
default_colors = Colors.golden_angle_color(
|
default_colors = Colors.golden_angle_color(
|
||||||
colormap="plasma", num=max(10, self.row + 1), format="HEX"
|
colormap="magma", num=max(10, self.row + 1), format="HEX"
|
||||||
)
|
)
|
||||||
default_color = default_colors[self.row]
|
default_color = default_colors[self.row]
|
||||||
self.color_button.setColor(default_color)
|
self.color_button.setColor(default_color)
|
||||||
|
@ -284,7 +284,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|||||||
y_entry: str | None = None,
|
y_entry: str | None = None,
|
||||||
z_entry: str | None = None,
|
z_entry: str | None = None,
|
||||||
color: str | None = None,
|
color: str | None = None,
|
||||||
color_map_z: str | None = "plasma",
|
color_map_z: str | None = "magma",
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
validate: bool = True,
|
validate: bool = True,
|
||||||
dap: str | None = None, # TODO add dap custom curve wrapper
|
dap: str | None = None, # TODO add dap custom curve wrapper
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
plot_settings:
|
plot_settings:
|
||||||
background_color: "black"
|
background_color: "black"
|
||||||
num_columns: 1
|
num_columns: 1
|
||||||
colormap: "plasma"
|
colormap: "magma"
|
||||||
scan_types: false
|
scan_types: false
|
||||||
plot_data:
|
plot_data:
|
||||||
- plot_name: "BPM4i plots vs samx"
|
- plot_name: "BPM4i plots vs samx"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
plot_settings:
|
plot_settings:
|
||||||
background_color: "black"
|
background_color: "black"
|
||||||
num_columns: 1
|
num_columns: 1
|
||||||
colormap: "plasma"
|
colormap: "magma"
|
||||||
scan_types: false
|
scan_types: false
|
||||||
plot_data:
|
plot_data:
|
||||||
- plot_name: "BPM4i plots vs samx"
|
- plot_name: "BPM4i plots vs samx"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
plot_settings:
|
plot_settings:
|
||||||
background_color: "white"
|
background_color: "white"
|
||||||
num_columns: 3
|
num_columns: 3
|
||||||
colormap: "plasma"
|
colormap: "magma"
|
||||||
scan_types: true
|
scan_types: true
|
||||||
plot_data:
|
plot_data:
|
||||||
grid_scan:
|
grid_scan:
|
||||||
|
@ -49,8 +49,8 @@ def test_mouse_moved_lines(plot_widget_with_crosshair):
|
|||||||
crosshair.mouse_moved(event_mock)
|
crosshair.mouse_moved(event_mock)
|
||||||
|
|
||||||
# Assert the expected behavior
|
# Assert the expected behavior
|
||||||
assert crosshair.v_line.pos().x() == 2
|
assert np.isclose(crosshair.v_line.pos().x(), 2)
|
||||||
assert crosshair.h_line.pos().y() == 5
|
assert np.isclose(crosshair.h_line.pos().y(), 5)
|
||||||
|
|
||||||
|
|
||||||
def test_mouse_moved_signals(plot_widget_with_crosshair):
|
def test_mouse_moved_signals(plot_widget_with_crosshair):
|
||||||
|
@ -73,7 +73,7 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
|
|||||||
"x_grid": False,
|
"x_grid": False,
|
||||||
"y_grid": False,
|
"y_grid": False,
|
||||||
},
|
},
|
||||||
"color_palette": "plasma",
|
"color_palette": "magma",
|
||||||
"curves": {
|
"curves": {
|
||||||
"bpm4i-bpm4i": {
|
"bpm4i-bpm4i": {
|
||||||
"widget_class": "BECCurve",
|
"widget_class": "BECCurve",
|
||||||
@ -81,11 +81,11 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
|
|||||||
"parent_id": "widget_1",
|
"parent_id": "widget_1",
|
||||||
"label": "bpm4i-bpm4i",
|
"label": "bpm4i-bpm4i",
|
||||||
"color": "#cc4778",
|
"color": "#cc4778",
|
||||||
"color_map_z": "plasma",
|
"color_map_z": "magma",
|
||||||
"symbol": "o",
|
"symbol": "o",
|
||||||
"symbol_color": None,
|
"symbol_color": None,
|
||||||
"symbol_size": 5,
|
"symbol_size": 7,
|
||||||
"pen_width": 2,
|
"pen_width": 4,
|
||||||
"pen_style": "dash",
|
"pen_style": "dash",
|
||||||
"source": "scan_segment",
|
"source": "scan_segment",
|
||||||
"signals": {
|
"signals": {
|
||||||
@ -114,11 +114,11 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
|
|||||||
"parent_id": "widget_1",
|
"parent_id": "widget_1",
|
||||||
"label": "curve-custom",
|
"label": "curve-custom",
|
||||||
"color": "blue",
|
"color": "blue",
|
||||||
"color_map_z": "plasma",
|
"color_map_z": "magma",
|
||||||
"symbol": "o",
|
"symbol": "o",
|
||||||
"symbol_color": None,
|
"symbol_color": None,
|
||||||
"symbol_size": 5,
|
"symbol_size": 7,
|
||||||
"pen_width": 2,
|
"pen_width": 5,
|
||||||
"pen_style": "dashdot",
|
"pen_style": "dashdot",
|
||||||
"source": "custom",
|
"source": "custom",
|
||||||
"signals": None,
|
"signals": None,
|
||||||
@ -155,11 +155,11 @@ def test_getting_curve(qtbot, mocked_client):
|
|||||||
gui_id="test_curve",
|
gui_id="test_curve",
|
||||||
parent_id=w1.gui_id,
|
parent_id=w1.gui_id,
|
||||||
label="bpm4i-bpm4i",
|
label="bpm4i-bpm4i",
|
||||||
color="#cc4778",
|
color="#b73779",
|
||||||
symbol="o",
|
symbol="o",
|
||||||
symbol_color=None,
|
symbol_color=None,
|
||||||
symbol_size=5,
|
symbol_size=7,
|
||||||
pen_width=2,
|
pen_width=4,
|
||||||
pen_style="solid",
|
pen_style="solid",
|
||||||
source="scan_segment",
|
source="scan_segment",
|
||||||
signals=Signal(
|
signals=Signal(
|
||||||
@ -398,11 +398,11 @@ def test_curve_add_by_config(qtbot, mocked_client):
|
|||||||
"parent_id": "widget_1",
|
"parent_id": "widget_1",
|
||||||
"label": "bpm4i-bpm4i",
|
"label": "bpm4i-bpm4i",
|
||||||
"color": "#cc4778",
|
"color": "#cc4778",
|
||||||
"color_map_z": "plasma",
|
"color_map_z": "magma",
|
||||||
"symbol": "o",
|
"symbol": "o",
|
||||||
"symbol_color": None,
|
"symbol_color": None,
|
||||||
"symbol_size": 5,
|
"symbol_size": 7,
|
||||||
"pen_width": 2,
|
"pen_width": 4,
|
||||||
"pen_style": "dash",
|
"pen_style": "dash",
|
||||||
"source": "scan_segment",
|
"source": "scan_segment",
|
||||||
"signals": {
|
"signals": {
|
||||||
@ -522,7 +522,7 @@ def test_scatter_2d_update(qtbot, mocked_client):
|
|||||||
|
|
||||||
data = c1.get_data()
|
data = c1.get_data()
|
||||||
expected_x_y_data = ([1, 2, 3], [1, 2, 3])
|
expected_x_y_data = ([1, 2, 3], [1, 2, 3])
|
||||||
expected_z_colors = w1._make_z_gradient([1, 3, 2], "plasma")
|
expected_z_colors = w1._make_z_gradient([1, 3, 2], "magma")
|
||||||
|
|
||||||
scatter_points = c1.scatter.points()
|
scatter_points = c1.scatter.points()
|
||||||
colors = [point.brush().color() for point in scatter_points]
|
colors = [point.brush().color() for point in scatter_points]
|
||||||
|
@ -66,7 +66,7 @@ def test_waveform_plot_data(waveform_widget, mock_waveform):
|
|||||||
y_entry=None,
|
y_entry=None,
|
||||||
z_entry=None,
|
z_entry=None,
|
||||||
color=None,
|
color=None,
|
||||||
color_map_z="plasma",
|
color_map_z="magma",
|
||||||
label=None,
|
label=None,
|
||||||
validate=True,
|
validate=True,
|
||||||
dap=None,
|
dap=None,
|
||||||
@ -86,7 +86,7 @@ def test_waveform_plot_scan_curves(waveform_widget, mock_waveform):
|
|||||||
y_entry=None,
|
y_entry=None,
|
||||||
z_entry=None,
|
z_entry=None,
|
||||||
color=None,
|
color=None,
|
||||||
color_map_z="plasma",
|
color_map_z="magma",
|
||||||
label=None,
|
label=None,
|
||||||
validate=True,
|
validate=True,
|
||||||
dap="GaussianModel",
|
dap="GaussianModel",
|
||||||
|
Reference in New Issue
Block a user