bec-widgets 0.57.3__py3-none-any.whl → 0.57.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
 
4
4
 
5
+ ## v0.57.5 (2024-06-06)
6
+
7
+ ### Documentation
8
+
9
+ * docs(figure): docs adjusted to be compatible with new signature ([`c037b87`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c037b87675af91b26e8c7c60e76622d4ed4cf5d5))
10
+
11
+ ### Fix
12
+
13
+ * fix(waveform): added .plot method with the same signature as BECFigure.plot ([`8479caf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8479caf53a7325788ca264e5bd9aee01f1d4c5a0))
14
+
15
+ * fix(plot_base): .plot removed from plot_base.py, because there is no use case for it ([`82e2c89`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82e2c898d2e26f786b2d481f85c647472675e75b))
16
+
17
+ ### Refactor
18
+
19
+ * refactor(figure): logic for .add_image and .image consolidated; logic for .add_plot and .plot consolidated ([`52bc322`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/52bc322b2b8d3ef92ff3480e61bddaf32464f976))
20
+
21
+
22
+ ## v0.57.4 (2024-06-06)
23
+
24
+ ### Fix
25
+
26
+ * fix(docks): set_title do update dock internal _name now ([`15cbc21`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/15cbc21e5bb3cf85f5822d44a2b3665b5aa2f346))
27
+
28
+ * fix(docks): docks widget_list adn dockarea panels return values fixed ([`ffae5ee`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ffae5ee54e6b43da660131092452adff195ba4fb))
29
+
30
+
5
31
  ## v0.57.3 (2024-06-06)
6
32
 
7
33
  ### Documentation
@@ -131,31 +157,3 @@
131
157
 
132
158
 
133
159
  ## v0.55.0 (2024-05-24)
134
-
135
- ### Feature
136
-
137
- * feat(widgets/progressbar): SpiralProgressBar added with rpc interface ([`76bd0d3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/76bd0d339ac9ae9e8a3baa0d0d4e951ec1d09670))
138
-
139
-
140
- ## v0.54.0 (2024-05-24)
141
-
142
- ### Build
143
-
144
- * build: added pyqt6 as sphinx build dependency ([`a47a8ec`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a47a8ec413934cf7fce8d5b7a5913371d4b3b4a5))
145
-
146
- ### Feature
147
-
148
- * feat(figure): changes to support direct plot functionality ([`fc4d0f3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fc4d0f3bb2a7c2fca9c326d86eb68b305bcd548b))
149
-
150
- ### Refactor
151
-
152
- * refactor(reconstruction): repository structure is changed to separate assets needed for each widget ([`3455c60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3455c602361d3b5cc3ff9190f9d2870474becf8a))
153
-
154
- * refactor(clean-up): 1st generation widgets are removed ([`edc25fb`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/edc25fbf9d5a0321e5f0a80b492b6337df807849))
155
-
156
-
157
- ## v0.53.3 (2024-05-16)
158
-
159
- ### Fix
160
-
161
- * fix: removed apparently unnecessary sleep while waiting for an rpc response ([`7d64cac`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7d64cac6610b39d3553ff650354f78ead8ee6b55))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.57.3
3
+ Version: 0.57.5
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
bec_widgets/cli/client.py CHANGED
@@ -128,17 +128,6 @@ class BECPlotBase(RPCBase):
128
128
  lock(bool): True to lock, False to unlock.
129
129
  """
130
130
 
131
- @rpc_call
132
- def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
133
- """
134
- Plot custom data on the plot widget. These data are not saved in config.
135
-
136
- Args:
137
- data_x(list|np.ndarray): x-axis data
138
- data_y(list|np.ndarray): y-axis data
139
- **kwargs: Keyword arguments for the plot.
140
- """
141
-
142
131
  @rpc_call
143
132
  def remove(self):
144
133
  """
@@ -165,57 +154,36 @@ class BECWaveform(RPCBase):
165
154
  """
166
155
 
167
156
  @rpc_call
168
- def add_curve_scan(
157
+ def plot(
169
158
  self,
170
- x_name: "str",
171
- y_name: "str",
172
- z_name: "Optional[str]" = None,
173
- x_entry: "Optional[str]" = None,
174
- y_entry: "Optional[str]" = None,
175
- z_entry: "Optional[str]" = None,
176
- color: "Optional[str]" = None,
177
- color_map_z: "Optional[str]" = "plasma",
178
- label: "Optional[str]" = None,
179
- validate_bec: "bool" = True,
180
- **kwargs,
159
+ x: "list | np.ndarray | None" = None,
160
+ y: "list | np.ndarray | None" = None,
161
+ x_name: "str | None" = None,
162
+ y_name: "str | None" = None,
163
+ z_name: "str | None" = None,
164
+ x_entry: "str | None" = None,
165
+ y_entry: "str | None" = None,
166
+ z_entry: "str | None" = None,
167
+ color: "str | None" = None,
168
+ color_map_z: "str | None" = "plasma",
169
+ label: "str | None" = None,
170
+ validate: "bool" = True,
181
171
  ) -> "BECCurve":
182
172
  """
183
- Add a curve to the plot widget from the scan segment.
184
-
173
+ Plot a curve to the plot widget.
185
174
  Args:
186
- x_name(str): Name of the x signal.
187
- x_entry(str): Entry of the x signal.
188
- y_name(str): Name of the y signal.
189
- y_entry(str): Entry of the y signal.
190
- z_name(str): Name of the z signal.
191
- z_entry(str): Entry of the z signal.
192
- color(str, optional): Color of the curve. Defaults to None.
175
+ x(list | np.ndarray): Custom x data to plot.
176
+ y(list | np.ndarray): Custom y data to plot.
177
+ x_name(str): The name of the device for the x-axis.
178
+ y_name(str): The name of the device for the y-axis.
179
+ z_name(str): The name of the device for the z-axis.
180
+ x_entry(str): The name of the entry for the x-axis.
181
+ y_entry(str): The name of the entry for the y-axis.
182
+ z_entry(str): The name of the entry for the z-axis.
183
+ color(str): The color of the curve.
193
184
  color_map_z(str): The color map to use for the z-axis.
194
- label(str, optional): Label of the curve. Defaults to None.
195
- **kwargs: Additional keyword arguments for the curve configuration.
196
-
197
- Returns:
198
- BECCurve: The curve object.
199
- """
200
-
201
- @rpc_call
202
- def add_curve_custom(
203
- self,
204
- x: "list | np.ndarray",
205
- y: "list | np.ndarray",
206
- label: "str" = None,
207
- color: "str" = None,
208
- **kwargs,
209
- ) -> "BECCurve":
210
- """
211
- Add a custom data curve to the plot widget.
212
-
213
- Args:
214
- x(list|np.ndarray): X data of the curve.
215
- y(list|np.ndarray): Y data of the curve.
216
- label(str, optional): Label of the curve. Defaults to None.
217
- color(str, optional): Color of the curve. Defaults to None.
218
- **kwargs: Additional keyword arguments for the curve configuration.
185
+ label(str): The label of the curve.
186
+ validate(bool): If True, validate the device names and entries.
219
187
 
220
188
  Returns:
221
189
  BECCurve: The curve object.
@@ -409,14 +377,39 @@ class BECWaveform(RPCBase):
409
377
  """
410
378
 
411
379
  @rpc_call
412
- def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
380
+ def plot(
381
+ self,
382
+ x: "list | np.ndarray | None" = None,
383
+ y: "list | np.ndarray | None" = None,
384
+ x_name: "str | None" = None,
385
+ y_name: "str | None" = None,
386
+ z_name: "str | None" = None,
387
+ x_entry: "str | None" = None,
388
+ y_entry: "str | None" = None,
389
+ z_entry: "str | None" = None,
390
+ color: "str | None" = None,
391
+ color_map_z: "str | None" = "plasma",
392
+ label: "str | None" = None,
393
+ validate: "bool" = True,
394
+ ) -> "BECCurve":
413
395
  """
414
- Plot custom data on the plot widget. These data are not saved in config.
415
-
396
+ Plot a curve to the plot widget.
416
397
  Args:
417
- data_x(list|np.ndarray): x-axis data
418
- data_y(list|np.ndarray): y-axis data
419
- **kwargs: Keyword arguments for the plot.
398
+ x(list | np.ndarray): Custom x data to plot.
399
+ y(list | np.ndarray): Custom y data to plot.
400
+ x_name(str): The name of the device for the x-axis.
401
+ y_name(str): The name of the device for the y-axis.
402
+ z_name(str): The name of the device for the z-axis.
403
+ x_entry(str): The name of the entry for the x-axis.
404
+ y_entry(str): The name of the entry for the y-axis.
405
+ z_entry(str): The name of the entry for the z-axis.
406
+ color(str): The color of the curve.
407
+ color_map_z(str): The color map to use for the z-axis.
408
+ label(str): The label of the curve.
409
+ validate(bool): If True, validate the device names and entries.
410
+
411
+ Returns:
412
+ BECCurve: The curve object.
420
413
  """
421
414
 
422
415
  @rpc_call
@@ -469,14 +462,14 @@ class BECFigure(RPCBase):
469
462
  @rpc_call
470
463
  def add_plot(
471
464
  self,
465
+ x: "list | np.ndarray" = None,
466
+ y: "list | np.ndarray" = None,
472
467
  x_name: "str" = None,
473
468
  y_name: "str" = None,
474
469
  z_name: "str" = None,
475
470
  x_entry: "str" = None,
476
471
  y_entry: "str" = None,
477
472
  z_entry: "str" = None,
478
- x: "list | np.ndarray" = None,
479
- y: "list | np.ndarray" = None,
480
473
  color: "Optional[str]" = None,
481
474
  color_map_z: "Optional[str]" = "plasma",
482
475
  label: "Optional[str]" = None,
@@ -490,7 +483,18 @@ class BECFigure(RPCBase):
490
483
  Add a Waveform1D plot to the figure at the specified position.
491
484
 
492
485
  Args:
493
- widget_id(str): The unique identifier of the widget. If not provided, a unique ID will be generated.
486
+ x(list | np.ndarray): Custom x data to plot.
487
+ y(list | np.ndarray): Custom y data to plot.
488
+ x_name(str): The name of the device for the x-axis.
489
+ y_name(str): The name of the device for the y-axis.
490
+ z_name(str): The name of the device for the z-axis.
491
+ x_entry(str): The name of the entry for the x-axis.
492
+ y_entry(str): The name of the entry for the y-axis.
493
+ z_entry(str): The name of the entry for the z-axis.
494
+ color(str): The color of the curve.
495
+ color_map_z(str): The color map to use for the z-axis.
496
+ label(str): The label of the curve.
497
+ validate(bool): If True, validate the device names and entries.
494
498
  row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
495
499
  col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
496
500
  config(dict): Additional configuration for the widget.
@@ -1139,17 +1143,6 @@ class BECImageShow(RPCBase):
1139
1143
  lock(bool): True to lock, False to unlock.
1140
1144
  """
1141
1145
 
1142
- @rpc_call
1143
- def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
1144
- """
1145
- Plot custom data on the plot widget. These data are not saved in config.
1146
-
1147
- Args:
1148
- data_x(list|np.ndarray): x-axis data
1149
- data_y(list|np.ndarray): y-axis data
1150
- **kwargs: Keyword arguments for the plot.
1151
- """
1152
-
1153
1146
  @rpc_call
1154
1147
  def remove(self):
1155
1148
  """
@@ -1429,7 +1422,7 @@ class BECDock(RPCBase):
1429
1422
 
1430
1423
  @property
1431
1424
  @rpc_call
1432
- def widget_list(self) -> "list":
1425
+ def widget_list(self) -> "list[BECConnector]":
1433
1426
  """
1434
1427
  Get the widgets in the dock.
1435
1428
 
@@ -1550,7 +1543,7 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1550
1543
 
1551
1544
  @property
1552
1545
  @rpc_call
1553
- def panels(self) -> "dict":
1546
+ def panels(self) -> "dict[str, BECDock]":
1554
1547
  """
1555
1548
  Get the docks in the dock area.
1556
1549
  Returns:
@@ -97,14 +97,16 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
97
97
  self.w3 = self.figure[1, 0]
98
98
 
99
99
  # curves for w1
100
- self.w1.add_curve_scan("samx", "samy", "bpm4i", pen_style="dash")
101
- self.w1.add_curve_scan("samx", "samy", "bpm3a", pen_style="dash")
100
+ self.w1.plot(x_name="samx", y_name="samy", z_name="bpm4i")
101
+ self.w1.plot(x_name="samx", y_name="samy", z_name="bpm3a")
102
102
  self.c1 = self.w1.get_config()
103
103
 
104
104
  def _init_dock(self):
105
105
 
106
106
  self.d0 = self.dock.add_dock(name="dock_0")
107
107
  self.fig0 = self.d0.add_widget("BECFigure")
108
+ data = np.random.rand(10, 2)
109
+ self.fig0.plot(data, label="2d Data")
108
110
  self.fig0.image("eiger", vrange=(0, 100))
109
111
 
110
112
  self.d1 = self.dock.add_dock(name="dock_1", position="right")
@@ -114,7 +116,6 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
114
116
 
115
117
  self.d2 = self.dock.add_dock(name="dock_2", position="bottom")
116
118
  self.fig2 = self.d2.add_widget("BECFigure", row=0, col=0)
117
- self.fig2.motor_map(x_name="samx", y_name="samy")
118
119
  self.fig2.plot(x_name="samx", y_name="bpm4i")
119
120
  self.bar = self.d2.add_widget("SpiralProgressBar", row=0, col=1)
120
121
  self.bar.set_diameter(200)
@@ -93,7 +93,7 @@ class BECDock(BECConnector, Dock):
93
93
  super().float()
94
94
 
95
95
  @property
96
- def widget_list(self) -> list:
96
+ def widget_list(self) -> list[BECConnector]:
97
97
  """
98
98
  Get the widgets in the dock.
99
99
 
@@ -103,7 +103,7 @@ class BECDock(BECConnector, Dock):
103
103
  return self.widgets
104
104
 
105
105
  @widget_list.setter
106
- def widget_list(self, value: list):
106
+ def widget_list(self, value: list[BECConnector]):
107
107
  self.widgets = value
108
108
 
109
109
  def hide_title_bar(self):
@@ -131,6 +131,7 @@ class BECDock(BECConnector, Dock):
131
131
  """
132
132
  self.parent_dock_area.docks[title] = self.parent_dock_area.docks.pop(self.name())
133
133
  self.setTitle(title)
134
+ self._name = title
134
135
 
135
136
  def get_widgets_positions(self) -> dict:
136
137
  """
@@ -61,7 +61,7 @@ class BECDockArea(BECConnector, DockArea):
61
61
  painter.drawText(self.rect(), Qt.AlignCenter, "Add docks using 'add_dock' method")
62
62
 
63
63
  @property
64
- def panels(self) -> dict:
64
+ def panels(self) -> dict[str, BECDock]:
65
65
  """
66
66
  Get the docks in the dock area.
67
67
  Returns:
@@ -70,7 +70,7 @@ class BECDockArea(BECConnector, DockArea):
70
70
  return dict(self.docks)
71
71
 
72
72
  @panels.setter
73
- def panels(self, value: dict):
73
+ def panels(self, value: dict[str, BECDock]):
74
74
  self.docks = WeakValueDictionary(value)
75
75
 
76
76
  @property
@@ -184,8 +184,9 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
184
184
  """
185
185
  self._widgets = value
186
186
 
187
- def add_plot(
187
+ def _init_waveform(
188
188
  self,
189
+ waveform,
189
190
  x_name: str = None,
190
191
  y_name: str = None,
191
192
  z_name: str = None,
@@ -198,33 +199,45 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
198
199
  color_map_z: Optional[str] = "plasma",
199
200
  label: Optional[str] = None,
200
201
  validate: bool = True,
201
- row: int = None,
202
- col: int = None,
203
- config=None,
204
- **axis_kwargs,
205
- ) -> BECWaveform:
202
+ ):
206
203
  """
207
- Add a Waveform1D plot to the figure at the specified position.
204
+ Configure the waveform based on the provided parameters.
208
205
 
209
206
  Args:
210
- widget_id(str): The unique identifier of the widget. If not provided, a unique ID will be generated.
211
- row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
212
- col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
213
- config(dict): Additional configuration for the widget.
214
- **axis_kwargs(dict): Additional axis properties to set on the widget after creation.
207
+ waveform (BECWaveform): The waveform to configure.
208
+ x (list | np.ndarray): Custom x data to plot.
209
+ y (list | np.ndarray): Custom y data to plot.
210
+ x_name (str): The name of the device for the x-axis.
211
+ y_name (str): The name of the device for the y-axis.
212
+ z_name (str): The name of the device for the z-axis.
213
+ x_entry (str): The name of the entry for the x-axis.
214
+ y_entry (str): The name of the entry for the y-axis.
215
+ z_entry (str): The name of the entry for the z-axis.
216
+ color (str): The color of the curve.
217
+ color_map_z (str): The color map to use for the z-axis.
218
+ label (str): The label of the curve.
219
+ validate (bool): If True, validate the device names and entries.
215
220
  """
216
- widget_id = str(uuid.uuid4())
217
- waveform = self.add_widget(
218
- widget_type="Waveform1D",
219
- widget_id=widget_id,
220
- row=row,
221
- col=col,
222
- config=config,
223
- **axis_kwargs,
224
- )
225
-
226
- # TODO remove repetition from .plot method
227
-
221
+ if x is not None and y is None:
222
+ if isinstance(x, np.ndarray):
223
+ if x.ndim == 1:
224
+ y = np.arange(x.size)
225
+ waveform.add_curve_custom(x=np.arange(x.size), y=x, color=color, label=label)
226
+ return waveform
227
+ if x.ndim == 2:
228
+ waveform.add_curve_custom(x=x[:, 0], y=x[:, 1], color=color, label=label)
229
+ return waveform
230
+ elif isinstance(x, list):
231
+ y = np.arange(len(x))
232
+ waveform.add_curve_custom(x=np.arange(len(x)), y=x, color=color, label=label)
233
+ return waveform
234
+ else:
235
+ raise ValueError(
236
+ "Invalid input. Provide either device names (x_name, y_name) or custom data."
237
+ )
238
+ if x is not None and y is not None:
239
+ waveform.add_curve_custom(x=x, y=y, color=color, label=label)
240
+ return waveform
228
241
  # User wants to add scan curve -> 1D Waveform
229
242
  if x_name is not None and y_name is not None and z_name is None and x is None and y is None:
230
243
  waveform.add_curve_scan(
@@ -262,6 +275,73 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
262
275
 
263
276
  return waveform
264
277
 
278
+ def add_plot(
279
+ self,
280
+ x: list | np.ndarray = None,
281
+ y: list | np.ndarray = None,
282
+ x_name: str = None,
283
+ y_name: str = None,
284
+ z_name: str = None,
285
+ x_entry: str = None,
286
+ y_entry: str = None,
287
+ z_entry: str = None,
288
+ color: Optional[str] = None,
289
+ color_map_z: Optional[str] = "plasma",
290
+ label: Optional[str] = None,
291
+ validate: bool = True,
292
+ row: int = None,
293
+ col: int = None,
294
+ config=None,
295
+ **axis_kwargs,
296
+ ) -> BECWaveform:
297
+ """
298
+ Add a Waveform1D plot to the figure at the specified position.
299
+
300
+ Args:
301
+ x(list | np.ndarray): Custom x data to plot.
302
+ y(list | np.ndarray): Custom y data to plot.
303
+ x_name(str): The name of the device for the x-axis.
304
+ y_name(str): The name of the device for the y-axis.
305
+ z_name(str): The name of the device for the z-axis.
306
+ x_entry(str): The name of the entry for the x-axis.
307
+ y_entry(str): The name of the entry for the y-axis.
308
+ z_entry(str): The name of the entry for the z-axis.
309
+ color(str): The color of the curve.
310
+ color_map_z(str): The color map to use for the z-axis.
311
+ label(str): The label of the curve.
312
+ validate(bool): If True, validate the device names and entries.
313
+ row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
314
+ col(int): The column coordinate of the widget in the figure. If not provided, the next empty column will be used.
315
+ config(dict): Additional configuration for the widget.
316
+ **axis_kwargs(dict): Additional axis properties to set on the widget after creation.
317
+ """
318
+ widget_id = str(uuid.uuid4())
319
+ waveform = self.add_widget(
320
+ widget_type="Waveform1D",
321
+ widget_id=widget_id,
322
+ row=row,
323
+ col=col,
324
+ config=config,
325
+ **axis_kwargs,
326
+ )
327
+
328
+ waveform = self._init_waveform(
329
+ waveform=waveform,
330
+ x=x,
331
+ y=y,
332
+ x_name=x_name,
333
+ y_name=y_name,
334
+ z_name=z_name,
335
+ x_entry=x_entry,
336
+ y_entry=y_entry,
337
+ z_entry=z_entry,
338
+ color=color,
339
+ color_map_z=color_map_z,
340
+ label=label,
341
+ validate=validate,
342
+ )
343
+ return waveform
344
+
265
345
  @typechecked
266
346
  def plot(
267
347
  self,
@@ -309,69 +389,60 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
309
389
  else:
310
390
  waveform = self.add_plot(**axis_kwargs)
311
391
 
312
- if x is not None and y is None:
313
- if isinstance(x, np.ndarray):
314
- if x.ndim == 1:
315
- y = np.arange(x.size)
316
- waveform.add_curve_custom(x=np.arange(x.size), y=x, color=color, label=label)
317
- return waveform
318
- if x.ndim == 2:
319
- waveform.add_curve_custom(x=x[:, 0], y=x[:, 1], color=color, label=label)
320
- return waveform
321
- elif isinstance(x, list):
322
- y = np.arange(len(x))
323
- waveform.add_curve_custom(x=np.arange(len(x)), y=x, color=color, label=label)
324
- return waveform
325
- else:
326
- raise ValueError(
327
- "Invalid input. Provide either device names (x_name, y_name) or custom data."
328
- )
329
- if x is not None and y is not None:
330
- waveform.add_curve_custom(x=x, y=y, color=color, label=label)
331
- return waveform
392
+ waveform = self._init_waveform(
393
+ waveform=waveform,
394
+ x=x,
395
+ y=y,
396
+ x_name=x_name,
397
+ y_name=y_name,
398
+ z_name=z_name,
399
+ x_entry=x_entry,
400
+ y_entry=y_entry,
401
+ z_entry=z_entry,
402
+ color=color,
403
+ color_map_z=color_map_z,
404
+ label=label,
405
+ validate=validate,
406
+ )
407
+ # TODO remove repetition from .plot method
408
+ return waveform
332
409
 
333
- # User wants to add scan curve -> 1D Waveform
334
- if x_name is not None and y_name is not None and z_name is None and x is None and y is None:
335
- waveform.add_curve_scan(
336
- x_name=x_name,
337
- y_name=y_name,
338
- x_entry=x_entry,
339
- y_entry=y_entry,
340
- color=color,
341
- color_map_z="plasma",
342
- label=label,
343
- validate=validate,
410
+ def _init_image(
411
+ self,
412
+ image,
413
+ monitor: str = None,
414
+ color_bar: Literal["simple", "full"] = "full",
415
+ color_map: str = "magma",
416
+ data: np.ndarray = None,
417
+ vrange: tuple[float, float] = None,
418
+ ) -> BECImageShow:
419
+ """
420
+ Configure the image based on the provided parameters.
421
+
422
+ Args:
423
+ image (BECImageShow): The image to configure.
424
+ monitor (str): The name of the monitor to display.
425
+ color_bar (Literal["simple","full"]): The type of color bar to display.
426
+ color_map (str): The color map to use for the image.
427
+ data (np.ndarray): Custom data to display.
428
+ """
429
+ if monitor is not None and data is None:
430
+ image.add_monitor_image(
431
+ monitor=monitor, color_map=color_map, vrange=vrange, color_bar=color_bar
344
432
  )
345
- # User wants to add scan curve -> 2D Waveform Scatter
346
- elif (
347
- x_name is not None
348
- and y_name is not None
349
- and z_name is not None
350
- and x is None
351
- and y is None
352
- ):
353
- waveform.add_curve_scan(
354
- x_name=x_name,
355
- y_name=y_name,
356
- z_name=z_name,
357
- x_entry=x_entry,
358
- y_entry=y_entry,
359
- z_entry=z_entry,
360
- color=color,
361
- color_map_z=color_map_z,
362
- label=label,
363
- validate=validate,
433
+ elif data is not None and monitor is None:
434
+ image.add_custom_image(
435
+ name="custom", data=data, color_map=color_map, vrange=vrange, color_bar=color_bar
364
436
  )
365
- # User wants to add custom curve
366
- elif (
367
- x is not None and y is not None and x_name is None and y_name is None and z_name is None
368
- ):
369
- waveform.add_curve_custom(x=x, y=y, color=color, label=label)
437
+ elif data is None and monitor is None:
438
+ # Setting appearance
439
+ if vrange is not None:
440
+ image.set_vrange(vmin=vrange[0], vmax=vrange[1])
441
+ if color_map is not None:
442
+ image.set_color_map(color_map)
370
443
  else:
371
- raise ValueError(
372
- "Invalid input. Provide either device names (x_name, y_name) or custom data."
373
- )
374
- return waveform
444
+ raise ValueError("Invalid input. Provide either monitor name or custom data.")
445
+ return image
375
446
 
376
447
  def image(
377
448
  self,
@@ -405,23 +476,14 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
405
476
  else:
406
477
  image = self.add_image(color_bar=color_bar, **axis_kwargs)
407
478
 
408
- # Setting data #TODO check logic if monitor or data are already created
409
- if monitor is not None and data is None:
410
- image.add_monitor_image(
411
- monitor=monitor, color_map=color_map, vrange=vrange, color_bar=color_bar
412
- )
413
- elif data is not None and monitor is None:
414
- image.add_custom_image(
415
- name="custom", data=data, color_map=color_map, vrange=vrange, color_bar=color_bar
416
- )
417
- elif data is None and monitor is None:
418
- # Setting appearance
419
- if vrange is not None:
420
- image.set_vrange(vmin=vrange[0], vmax=vrange[1])
421
- if color_map is not None:
422
- image.set_color_map(color_map)
423
- else:
424
- raise ValueError("Invalid input. Provide either monitor name or custom data.")
479
+ image = self._init_image(
480
+ image=image,
481
+ monitor=monitor,
482
+ color_bar=color_bar,
483
+ color_map=color_map,
484
+ data=data,
485
+ vrange=vrange,
486
+ )
425
487
  return image
426
488
 
427
489
  def add_image(
@@ -472,22 +534,14 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
472
534
  config=config,
473
535
  **axis_kwargs,
474
536
  )
475
- # TODO remove repetition from .image method
476
- if monitor is not None and data is None:
477
- image.add_monitor_image(
478
- monitor=monitor, color_map=color_map, vrange=vrange, color_bar=color_bar
479
- )
480
- elif data is not None and monitor is None:
481
- image.add_custom_image(
482
- name="custom", data=data, color_map=color_map, vrange=vrange, color_bar=color_bar
483
- )
484
- elif data is None and monitor is None:
485
- # Setting appearance
486
- if vrange is not None:
487
- image.set_vrange(vmin=vrange[0], vmax=vrange[1])
488
- if color_map is not None:
489
- image.set_color_map(color_map)
490
-
537
+ image = self._init_image(
538
+ image=image,
539
+ monitor=monitor,
540
+ color_bar=color_bar,
541
+ color_map=color_map,
542
+ data=data,
543
+ vrange=vrange,
544
+ )
491
545
  return image
492
546
 
493
547
  def motor_map(self, motor_x: str = None, motor_y: str = None, **axis_kwargs) -> BECMotorMap:
@@ -53,7 +53,6 @@ class BECImageShow(BECPlotBase):
53
53
  "set_y_lim",
54
54
  "set_grid",
55
55
  "lock_aspect_ratio",
56
- "plot",
57
56
  "remove",
58
57
  "images",
59
58
  ]
@@ -48,7 +48,6 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout):
48
48
  "set_y_lim",
49
49
  "set_grid",
50
50
  "lock_aspect_ratio",
51
- "plot",
52
51
  "remove",
53
52
  ]
54
53
 
@@ -237,19 +236,6 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout):
237
236
  """
238
237
  self.plot_item.setAspectLocked(lock)
239
238
 
240
- def plot(self, data_x: list | np.ndarray, data_y: list | np.ndarray, **kwargs):
241
- """
242
- Plot custom data on the plot widget. These data are not saved in config.
243
-
244
- Args:
245
- data_x(list|np.ndarray): x-axis data
246
- data_y(list|np.ndarray): y-axis data
247
- **kwargs: Keyword arguments for the plot.
248
- """
249
- # TODO very basic so far, add more options
250
- # TODO decide name of the method
251
- self.plot_item.plot(data_x, data_y, **kwargs)
252
-
253
239
  def remove(self):
254
240
  """Remove the plot widget from the figure."""
255
241
  if self.figure is not None:
@@ -35,8 +35,7 @@ class BECWaveform(BECPlotBase):
35
35
  USER_ACCESS = [
36
36
  "rpc_id",
37
37
  "config_dict",
38
- "add_curve_scan",
39
- "add_curve_custom",
38
+ "plot",
40
39
  "remove_curve",
41
40
  "scan_history",
42
41
  "curves",
@@ -200,6 +199,57 @@ class BECWaveform(BECPlotBase):
200
199
  else:
201
200
  raise ValueError("Identifier must be either an integer (index) or a string (curve_id).")
202
201
 
202
+ def plot(
203
+ self,
204
+ x: list | np.ndarray | None = None,
205
+ y: list | np.ndarray | None = None,
206
+ x_name: str | None = None,
207
+ y_name: str | None = None,
208
+ z_name: str | None = None,
209
+ x_entry: str | None = None,
210
+ y_entry: str | None = None,
211
+ z_entry: str | None = None,
212
+ color: str | None = None,
213
+ color_map_z: str | None = "plasma",
214
+ label: str | None = None,
215
+ validate: bool = True,
216
+ ) -> BECCurve:
217
+ """
218
+ Plot a curve to the plot widget.
219
+ Args:
220
+ x(list | np.ndarray): Custom x data to plot.
221
+ y(list | np.ndarray): Custom y data to plot.
222
+ x_name(str): The name of the device for the x-axis.
223
+ y_name(str): The name of the device for the y-axis.
224
+ z_name(str): The name of the device for the z-axis.
225
+ x_entry(str): The name of the entry for the x-axis.
226
+ y_entry(str): The name of the entry for the y-axis.
227
+ z_entry(str): The name of the entry for the z-axis.
228
+ color(str): The color of the curve.
229
+ color_map_z(str): The color map to use for the z-axis.
230
+ label(str): The label of the curve.
231
+ validate(bool): If True, validate the device names and entries.
232
+
233
+ Returns:
234
+ BECCurve: The curve object.
235
+ """
236
+
237
+ if x is not None and y is not None:
238
+ return self.add_curve_custom(x=x, y=y, label=label, color=color)
239
+ else:
240
+ return self.add_curve_scan(
241
+ x_name=x_name,
242
+ y_name=y_name,
243
+ z_name=z_name,
244
+ x_entry=x_entry,
245
+ y_entry=y_entry,
246
+ z_entry=z_entry,
247
+ color=color,
248
+ color_map_z=color_map_z,
249
+ label=label,
250
+ validate_bec=validate,
251
+ )
252
+
203
253
  def add_curve_custom(
204
254
  self,
205
255
  x: list | np.ndarray,
@@ -252,33 +302,6 @@ class BECWaveform(BECPlotBase):
252
302
  )
253
303
  return curve
254
304
 
255
- def _add_curve_object(
256
- self,
257
- name: str,
258
- source: str,
259
- config: CurveConfig,
260
- data: tuple[list | np.ndarray, list | np.ndarray] = None,
261
- ) -> BECCurve:
262
- """
263
- Add a curve object to the plot widget.
264
-
265
- Args:
266
- name(str): ID of the curve.
267
- source(str): Source of the curve.
268
- config(CurveConfig): Configuration of the curve.
269
- data(tuple[list|np.ndarray,list|np.ndarray], optional): Data (x,y) to be plotted. Defaults to None.
270
-
271
- Returns:
272
- BECCurve: The curve object.
273
- """
274
- curve = BECCurve(config=config, name=name, parent_item=self.plot_item)
275
- self._curves_data[source][name] = curve
276
- self.plot_item.addItem(curve)
277
- self.config.curves[name] = curve.config
278
- if data is not None:
279
- curve.setData(data[0], data[1])
280
- return curve
281
-
282
305
  def add_curve_scan(
283
306
  self,
284
307
  x_name: str,
@@ -354,6 +377,33 @@ class BECWaveform(BECPlotBase):
354
377
  curve = self._add_curve_object(name=label, source=curve_source, config=curve_config)
355
378
  return curve
356
379
 
380
+ def _add_curve_object(
381
+ self,
382
+ name: str,
383
+ source: str,
384
+ config: CurveConfig,
385
+ data: tuple[list | np.ndarray, list | np.ndarray] = None,
386
+ ) -> BECCurve:
387
+ """
388
+ Add a curve object to the plot widget.
389
+
390
+ Args:
391
+ name(str): ID of the curve.
392
+ source(str): Source of the curve.
393
+ config(CurveConfig): Configuration of the curve.
394
+ data(tuple[list|np.ndarray,list|np.ndarray], optional): Data (x,y) to be plotted. Defaults to None.
395
+
396
+ Returns:
397
+ BECCurve: The curve object.
398
+ """
399
+ curve = BECCurve(config=config, name=name, parent_item=self.plot_item)
400
+ self._curves_data[source][name] = curve
401
+ self.plot_item.addItem(curve)
402
+ self.config.curves[name] = curve.config
403
+ if data is not None:
404
+ curve.setData(data[0], data[1])
405
+ return curve
406
+
357
407
  def _validate_signal_entries(
358
408
  self,
359
409
  x_name: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.57.3
3
+ Version: 0.57.5
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=RF2JeGh8tG09DyAOwEu991IZy3C8Vm6lI8O_4Dr9B9Q,12239
3
3
  .pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=5H1fQ0fZSKvNRSrVkZJ00ZkSff7DzKmFjg35jPc8vTg,7199
5
+ CHANGELOG.md,sha256=7H2GTncFqnR-otViaWQZ6GjWQYaXBZaVSlZi7gg1r8A,7242
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=NUwnybNOdIQRdfaJCymSOUpaYxAZhsEK9CIhk0hPz2I,1178
7
+ PKG-INFO,sha256=FrFmymNmKhGgdnROQ1lQVuTNsR37w-FOZD83DW3gd-g,1178
8
8
  README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
9
- pyproject.toml,sha256=ZLJ-JsjWQsfDxZAyCiSNk5Io50lUBDI-SlY562nGgEw,1822
9
+ pyproject.toml,sha256=pmkWfhl5AVkaAK06SsqJiwwOP4qIifYqbVh7CtIo0ac,1822
10
10
  .git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
11
11
  .gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
12
12
  .gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
@@ -17,7 +17,7 @@ bec_widgets/assets/bec_widgets_icon.png,sha256=K8dgGwIjalDh9PRHUsSQBqgdX7a00nM3i
17
17
  bec_widgets/assets/terminal_icon.png,sha256=bJl7Tft4Fi2uxvuXI8o14uMHnI9eAWKSU2uftXCH9ws,3889
18
18
  bec_widgets/cli/__init__.py,sha256=tLD8HWgyURhMjYlKZ43pBu-qvGD1LI5o3n3rEieg-70,43
19
19
  bec_widgets/cli/auto_updates.py,sha256=8x4_SrD8Hh1RbrUWXLfisw6X5v8Mij2DiTfjvn9dkUw,4692
20
- bec_widgets/cli/client.py,sha256=E6t7gZzM3-YogkKdFz53PIXdHnkWhKyfSwRr2lu2hz0,53363
20
+ bec_widgets/cli/client.py,sha256=RB11oNngqo3_mqWxQJRalsehh_fwwh34o7IN2HTNTyg,53804
21
21
  bec_widgets/cli/client_utils.py,sha256=7u8P9EYgLPJuAcHxnFiZi-gCZohO3vAn0W7dqsSrs4M,10660
22
22
  bec_widgets/cli/generate_cli.py,sha256=tBt-F4Xccg9Pj2zuDEGHd0Ho1fKLfCf3PuSa8KmelQk,4431
23
23
  bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
@@ -25,7 +25,7 @@ bec_widgets/cli/rpc_wigdet_handler.py,sha256=OXHoiDFJPzbQ5RO0bzIX5aUXeMMlJTwAiTm
25
25
  bec_widgets/cli/server.py,sha256=rsj31Vsx6ayThNe4PQelQFahGjYXFZjfrNyB2fnm6Ro,5737
26
26
  bec_widgets/examples/__init__.py,sha256=WWQ0cu7m8sA4Ehy-DWdTIqSISjaHsbxhsNmNrMnhDZU,202
27
27
  bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=pfwbMfvXu0FdX-a6SdprfOEGxG-IgsuySnYy3l9fwIM,5328
28
+ bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=Rnr6bO-cue1AuT5IyUsBw5gXGeyuEQFqLpA1sx_-Kcs,5339
29
29
  bec_widgets/examples/jupyter_console/jupyter_console_window.ui,sha256=2A2mNTUMZBYygz8K4qWzrcjnNqZBMVyeHm26iLZVRWI,1473
30
30
  bec_widgets/examples/motor_movement/__init__.py,sha256=LzPJkxLAxOsZCbXR-fRCPmeYobp7Yqds6tDxW4W1gSw,214
31
31
  bec_widgets/examples/motor_movement/motor_control_compilations.py,sha256=8rpA7a2xVZTDMrx7YQIj3IJew78J1gcVMkHvloS0U_Q,9055
@@ -48,20 +48,20 @@ bec_widgets/utils/widget_io.py,sha256=f36198CvT_EzWQ_cg2G-4tRRsaMdJ3yVqsZWKJCQEf
48
48
  bec_widgets/utils/yaml_dialog.py,sha256=cMVif-39SB9WjwGH5FWBJcFs4tnfFJFs5cacydRyhy0,1853
49
49
  bec_widgets/widgets/__init__.py,sha256=LKgIuY3CI-NHCa_bY9pThYhxLH0MHDo8iNEJDDVIVmw,172
50
50
  bec_widgets/widgets/dock/__init__.py,sha256=B7foHt02gnhM7mFksa7GJVwT7n0j_JvYDCt6wc6XR5g,61
51
- bec_widgets/widgets/dock/dock.py,sha256=kdX0ZbuUdx6XETZ1NUgzBWlee_Q7JcN3fXpARDAlre8,8955
52
- bec_widgets/widgets/dock/dock_area.py,sha256=Yj01iI5Lzh-Rf6D9Z4m48JItVHC-1954MJHfjYimEE8,7731
51
+ bec_widgets/widgets/dock/dock.py,sha256=HCr0MeXljzIFOSuHuWfTz_B5str03pjkKXPX8PCrJ9c,9010
52
+ bec_widgets/widgets/dock/dock_area.py,sha256=zupu05KHrrdUlNNQe-x9zC-bXDk-qPXvr_mONCm-JwI,7759
53
53
  bec_widgets/widgets/figure/__init__.py,sha256=3hGx_KOV7QHCYAV06aNuUgKq4QIYCjUTad-DrwkUaBM,44
54
- bec_widgets/widgets/figure/figure.py,sha256=OzeKZme89JnzMcKT1sACnyw951EtRoSUALl58upY6b4,29762
54
+ bec_widgets/widgets/figure/figure.py,sha256=O--r3dyeOPXndV2400wpE9lPdBezzd0ZUt7yA2u2n0A,31468
55
55
  bec_widgets/widgets/figure/plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- bec_widgets/widgets/figure/plots/plot_base.py,sha256=oNUXEe94bD0_fVu-HPMRaoAuwPMW0DOAN8vvOeRz254,8513
56
+ bec_widgets/widgets/figure/plots/plot_base.py,sha256=R3wiO88ZmATRy9kJoLvj_7BmkMSyayNkzrSOJzJHvtk,7994
57
57
  bec_widgets/widgets/figure/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- bec_widgets/widgets/figure/plots/image/image.py,sha256=fdANm_lMzmKeddwCq3Arc1p48VakAYRlhY2q3pZspDI,19669
58
+ bec_widgets/widgets/figure/plots/image/image.py,sha256=-rxCt1IXmS2XQu0dS0SSXAF8VaxacSmQ-_kDsFxbPm4,19653
59
59
  bec_widgets/widgets/figure/plots/image/image_item.py,sha256=1oytCY2IIgRbtS3GRrp9JV02KOif78O2-iaK0qYuHFU,9058
60
60
  bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=59JwHMEBjLo72fmrAB7W1PFBT2oBe16heBaZfYM6MAk,4368
61
61
  bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=Ff2WoNHxO_A3ggsbSd_AVUP1JeOWMuJs-0GLskxn-94,15267
63
63
  bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=U0d4Qdsej9AlHrAf7krgE4AFWEkK_Y-IAGjH-Tv9bT0,21663
64
+ bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=DgnUdH3wj0uyvZvK9jqdDKaRwPoadf14VZ4g1TOXY5A,23511
65
65
  bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=9q7nJfyH8y9rWw_AIOd6tk7cbckoAGNLHv2oHEKCCyo,7229
66
66
  bec_widgets/widgets/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=ioLYJL31RdBoAOGFSS8PVSnUhkWPWmLC3tiKp7CouO8,2251
@@ -113,7 +113,7 @@ docs/user/getting_started/getting_started.md,sha256=lxZXCr6HAkM61oo5Bu-YjINSKo4w
113
113
  docs/user/getting_started/gui_complex_gui.gif,sha256=ovv9u371BGG5GqhzyBMl4mvqMHLfJS0ylr-dR0Ydwtw,6550393
114
114
  docs/user/getting_started/installation.md,sha256=nBl2Hfvo6ua3-tVZn1B-UG0hCTlrFY6_ibXHWnXeegs,1135
115
115
  docs/user/getting_started/quick_start.md,sha256=MNXEaww5hiQY7N7AQhrmbxdYQHimFk_iKQW8tS-72cU,9337
116
- docs/user/widgets/bec_figure.md,sha256=Ph8ajmESk71Y9nBJsLKLiN-YvGJwN4FdN_Rs3jcObwE,5068
116
+ docs/user/widgets/bec_figure.md,sha256=371T59CniH1pv2MT796kywfwYgWRBHPh17ixEWIcfVc,5093
117
117
  docs/user/widgets/image_plot.gif,sha256=_mVFhMTXGqwDOcEtrBHMZj5Thn2sLhDAHEeL2XyHN-s,14098977
118
118
  docs/user/widgets/motor.gif,sha256=FtaWdRHx4UZaGJPpq8LNhMMgX4PFcAB6IZ93JCMEh_w,2280719
119
119
  docs/user/widgets/progress_bar.gif,sha256=5jh0Zw2BBGPuNxszV1DBLJCb4_6glIRX-U2ABjnsK2k,5263592
@@ -125,8 +125,8 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  tests/end-2-end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
126
126
  tests/end-2-end/conftest.py,sha256=taLqiYVzOhJjMre5ypgQjB7wzSXP4soKANW3XfAjems,1773
127
127
  tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=G-YBfOhJCyV6g74mxXuhAPA9E_BPQ6EUT6xS278aq34,8865
128
- tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=yIbGoDJRN22XVmNASCSh51MdcCMSan1d1qNW1QIXiVk,5082
129
- tests/end-2-end/test_rpc_register_e2e.py,sha256=yUt0-UzWZX1keyHO-dyK0zIevtTgBWLP47_zpcvBywI,1583
128
+ tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=zTbB_F4Fs-QG8KhMK24xfsrCQBgZUAguMk3KFdEdP2o,5095
129
+ tests/end-2-end/test_rpc_register_e2e.py,sha256=3dfCnSvdcRO92pzHt9WlCTK0vzTKAvPtliEoEKrtuzQ,1604
130
130
  tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
131
  tests/unit_tests/client_mocks.py,sha256=ErrklY7446jXE2_XGKebs_a-2Pqif5ECOPvxVAKRZXY,4170
132
132
  tests/unit_tests/conftest.py,sha256=KrnktXPWmZhnKNue-xGWOLD1XGEvdz9Vf7V2eO3XQ3A,596
@@ -151,7 +151,7 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
151
151
  tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
152
152
  tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
154
- bec_widgets-0.57.3.dist-info/METADATA,sha256=NUwnybNOdIQRdfaJCymSOUpaYxAZhsEK9CIhk0hPz2I,1178
155
- bec_widgets-0.57.3.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
156
- bec_widgets-0.57.3.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
157
- bec_widgets-0.57.3.dist-info/RECORD,,
154
+ bec_widgets-0.57.5.dist-info/METADATA,sha256=FrFmymNmKhGgdnROQ1lQVuTNsR37w-FOZD83DW3gd-g,1178
155
+ bec_widgets-0.57.5.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
156
+ bec_widgets-0.57.5.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
157
+ bec_widgets-0.57.5.dist-info/RECORD,,
@@ -22,7 +22,7 @@ The following code snipped demonstrates how to create a 1D waveform plot using B
22
22
  # adds a new dock, a new BECFigure and a BECWaveForm to the dock
23
23
  plt = gui.add_dock().add_widget('BECFigure').plot('samx', 'bpm4i')
24
24
  # add a second curve to the same plot
25
- plt.add_curve_scan('samx', 'bpm3i')
25
+ plt.plot(x_name='samx', y_name='bpm3i')
26
26
  plt.set_title("Gauss plots vs. samx")
27
27
  plt.set_x_label("Motor X")
28
28
  plt.set_y_label("Gauss Signal (A.U.")
@@ -53,7 +53,7 @@ dev.bpm3i.sim.select_sim_model("StepModel")
53
53
  The following code snipped demonstrates how to create a 2D scatter plot using BEC Widgets within BEC.
54
54
  ```python
55
55
  # adds a new dock, a new BECFigure and a BECWaveForm to the dock
56
- plt = gui.add_dock().add_widget('BECFigure').add_plot('samx', 'samy', 'bpm4i')
56
+ plt = gui.add_dock().add_widget('BECFigure').add_plot(x_name='samx', y_name='samy', z_name='bpm4i')
57
57
  ```
58
58
 
59
59
  (user.widgets.motor_map)=
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.57.3"
7
+ version = "0.57.5"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -9,7 +9,7 @@ def test_rpc_waveform1d_custom_curve(rpc_server_figure):
9
9
  fig = BECFigure(rpc_server_figure)
10
10
 
11
11
  ax = fig.add_plot()
12
- curve = ax.add_curve_custom([1, 2, 3], [1, 2, 3])
12
+ curve = ax.plot(x=[1, 2, 3], y=[1, 2, 3])
13
13
  curve.set_color("red")
14
14
  curve = ax.curves[0]
15
15
  curve.set_color("blue")
@@ -24,7 +24,7 @@ def test_rpc_plotting_shortcuts_init_configs(rpc_server_figure, qtbot):
24
24
  plt = fig.plot(x_name="samx", y_name="bpm4i")
25
25
  im = fig.image("eiger")
26
26
  motor_map = fig.motor_map("samx", "samy")
27
- plt_z = fig.add_plot("samx", "samy", "bpm4i")
27
+ plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
28
28
 
29
29
  # Checking if classes are correctly initialised
30
30
  assert len(fig.widgets) == 4
@@ -9,7 +9,7 @@ def test_rpc_register_list_connections(rpc_server_figure):
9
9
  plt = fig.plot(x_name="samx", y_name="bpm4i")
10
10
  im = fig.image("eiger")
11
11
  motor_map = fig.motor_map("samx", "samy")
12
- plt_z = fig.add_plot("samx", "samy", "bpm4i")
12
+ plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
13
13
 
14
14
  # keep only class names from objects, since objects on server and client are different
15
15
  # so the best we can do is to compare types (rpc register is unit-tested elsewhere)