0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix(cmaps): unified all defaults to magma cmap

This commit is contained in:
2024-08-27 12:49:53 +02:00
parent 060935ffc5
commit 1ca9499edd
12 changed files with 32 additions and 32 deletions

View File

@ -483,7 +483,7 @@ class BECFigure(RPCBase):
y_entry: "str | None" = None,
z_entry: "str | None" = None,
color: "str | None" = None,
color_map_z: "str | None" = "plasma",
color_map_z: "str | None" = "magma",
label: "str | None" = None,
validate: "bool" = True,
new: "bool" = False,
@ -1728,7 +1728,7 @@ class BECWaveform(RPCBase):
y_entry: "str | None" = None,
z_entry: "str | None" = None,
color: "str | None" = None,
color_map_z: "str | None" = "plasma",
color_map_z: "str | None" = "magma",
label: "str | None" = None,
validate: "bool" = True,
dap: "str | None" = None,
@ -2042,7 +2042,7 @@ class BECWaveformWidget(RPCBase):
y_entry: "str | None" = None,
z_entry: "str | None" = None,
color: "str | None" = None,
color_map_z: "str | None" = "plasma",
color_map_z: "str | None" = "magma",
label: "str | None" = None,
validate: "bool" = True,
dap: "str | None" = None,

View File

@ -252,7 +252,7 @@ class BECFigure(BECWidget, pg.GraphicsLayoutWidget):
y_entry: str | None = None,
z_entry: str | None = None,
color: str | None = None,
color_map_z: str | None = "plasma",
color_map_z: str | None = "magma",
label: str | None = None,
validate: bool = True,
new: bool = False,

View File

@ -26,7 +26,7 @@ from bec_widgets.widgets.figure.plots.waveform.waveform_curve import (
class Waveform1DConfig(SubplotConfig):
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(
{}, 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,
z_entry: str | None = None,
color: str | None = None,
color_map_z: str | None = "plasma",
color_map_z: str | None = "magma",
label: str | None = None,
validate: bool = True,
dap: str | None = None, # TODO add dap custom curve wrapper
@ -481,7 +481,7 @@ class BECWaveform(BECPlotBase):
y_entry: str | None = None,
z_entry: str | None = None,
color: str | None = None,
color_map_z: str | None = "plasma",
color_map_z: str | None = "magma",
label: str | None = None,
validate_bec: bool = True,
dap: str | None = None,

View File

@ -52,7 +52,7 @@ class CurveConfig(ConnectionConfig):
source: Optional[str] = Field(None, description="The source of the curve.")
signals: Optional[Signal] = Field(None, description="The signal of the curve.")
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}

View File

@ -281,7 +281,7 @@ class DialogRow(QObject):
self.symbol_size.setValue(self.config.symbol_size)
else:
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]
self.color_button.setColor(default_color)
@ -305,7 +305,7 @@ class DialogRow(QObject):
self.symbol_size.setValue(self.config.symbol_size)
else:
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]
self.color_button.setColor(default_color)

View File

@ -284,7 +284,7 @@ class BECWaveformWidget(BECWidget, QWidget):
y_entry: str | None = None,
z_entry: str | None = None,
color: str | None = None,
color_map_z: str | None = "plasma",
color_map_z: str | None = "magma",
label: str | None = None,
validate: bool = True,
dap: str | None = None, # TODO add dap custom curve wrapper

View File

@ -1,7 +1,7 @@
plot_settings:
background_color: "black"
num_columns: 1
colormap: "plasma"
colormap: "magma"
scan_types: false
plot_data:
- plot_name: "BPM4i plots vs samx"

View File

@ -1,7 +1,7 @@
plot_settings:
background_color: "black"
num_columns: 1
colormap: "plasma"
colormap: "magma"
scan_types: false
plot_data:
- plot_name: "BPM4i plots vs samx"

View File

@ -1,7 +1,7 @@
plot_settings:
background_color: "white"
num_columns: 3
colormap: "plasma"
colormap: "magma"
scan_types: true
plot_data:
grid_scan:

View File

@ -49,8 +49,8 @@ def test_mouse_moved_lines(plot_widget_with_crosshair):
crosshair.mouse_moved(event_mock)
# Assert the expected behavior
assert crosshair.v_line.pos().x() == 2
assert crosshair.h_line.pos().y() == 5
assert np.isclose(crosshair.v_line.pos().x(), 2)
assert np.isclose(crosshair.h_line.pos().y(), 5)
def test_mouse_moved_signals(plot_widget_with_crosshair):

View File

@ -73,7 +73,7 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
"x_grid": False,
"y_grid": False,
},
"color_palette": "plasma",
"color_palette": "magma",
"curves": {
"bpm4i-bpm4i": {
"widget_class": "BECCurve",
@ -81,11 +81,11 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
"parent_id": "widget_1",
"label": "bpm4i-bpm4i",
"color": "#cc4778",
"color_map_z": "plasma",
"color_map_z": "magma",
"symbol": "o",
"symbol_color": None,
"symbol_size": 5,
"pen_width": 2,
"symbol_size": 7,
"pen_width": 4,
"pen_style": "dash",
"source": "scan_segment",
"signals": {
@ -114,11 +114,11 @@ def test_create_waveform1D_by_config(qtbot, mocked_client):
"parent_id": "widget_1",
"label": "curve-custom",
"color": "blue",
"color_map_z": "plasma",
"color_map_z": "magma",
"symbol": "o",
"symbol_color": None,
"symbol_size": 5,
"pen_width": 2,
"symbol_size": 7,
"pen_width": 5,
"pen_style": "dashdot",
"source": "custom",
"signals": None,
@ -155,11 +155,11 @@ def test_getting_curve(qtbot, mocked_client):
gui_id="test_curve",
parent_id=w1.gui_id,
label="bpm4i-bpm4i",
color="#cc4778",
color="#b73779",
symbol="o",
symbol_color=None,
symbol_size=5,
pen_width=2,
symbol_size=7,
pen_width=4,
pen_style="solid",
source="scan_segment",
signals=Signal(
@ -398,11 +398,11 @@ def test_curve_add_by_config(qtbot, mocked_client):
"parent_id": "widget_1",
"label": "bpm4i-bpm4i",
"color": "#cc4778",
"color_map_z": "plasma",
"color_map_z": "magma",
"symbol": "o",
"symbol_color": None,
"symbol_size": 5,
"pen_width": 2,
"symbol_size": 7,
"pen_width": 4,
"pen_style": "dash",
"source": "scan_segment",
"signals": {
@ -522,7 +522,7 @@ def test_scatter_2d_update(qtbot, mocked_client):
data = c1.get_data()
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()
colors = [point.brush().color() for point in scatter_points]

View File

@ -66,7 +66,7 @@ def test_waveform_plot_data(waveform_widget, mock_waveform):
y_entry=None,
z_entry=None,
color=None,
color_map_z="plasma",
color_map_z="magma",
label=None,
validate=True,
dap=None,
@ -86,7 +86,7 @@ def test_waveform_plot_scan_curves(waveform_widget, mock_waveform):
y_entry=None,
z_entry=None,
color=None,
color_map_z="plasma",
color_map_z="magma",
label=None,
validate=True,
dap="GaussianModel",