bec-widgets 0.52.0__py3-none-any.whl → 0.52.1__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.
bec_widgets/cli/client.py CHANGED
@@ -11,6 +11,7 @@ class BECPlotBase(RPCBase):
11
11
  def config_dict(self) -> "dict":
12
12
  """
13
13
  Get the configuration of the widget.
14
+
14
15
  Returns:
15
16
  dict: The configuration of the widget.
16
17
  """
@@ -19,8 +20,10 @@ class BECPlotBase(RPCBase):
19
20
  def set(self, **kwargs) -> "None":
20
21
  """
21
22
  Set the properties of the plot widget.
23
+
22
24
  Args:
23
25
  **kwargs: Keyword arguments for the properties to be set.
26
+
24
27
  Possible properties:
25
28
  - title: str
26
29
  - x_label: str
@@ -35,6 +38,7 @@ class BECPlotBase(RPCBase):
35
38
  def set_title(self, title: "str"):
36
39
  """
37
40
  Set the title of the plot widget.
41
+
38
42
  Args:
39
43
  title(str): Title of the plot widget.
40
44
  """
@@ -43,6 +47,7 @@ class BECPlotBase(RPCBase):
43
47
  def set_x_label(self, label: "str"):
44
48
  """
45
49
  Set the label of the x-axis.
50
+
46
51
  Args:
47
52
  label(str): Label of the x-axis.
48
53
  """
@@ -51,6 +56,7 @@ class BECPlotBase(RPCBase):
51
56
  def set_y_label(self, label: "str"):
52
57
  """
53
58
  Set the label of the y-axis.
59
+
54
60
  Args:
55
61
  label(str): Label of the y-axis.
56
62
  """
@@ -59,6 +65,7 @@ class BECPlotBase(RPCBase):
59
65
  def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
60
66
  """
61
67
  Set the scale of the x-axis.
68
+
62
69
  Args:
63
70
  scale(Literal["linear", "log"]): Scale of the x-axis.
64
71
  """
@@ -67,6 +74,7 @@ class BECPlotBase(RPCBase):
67
74
  def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
68
75
  """
69
76
  Set the scale of the y-axis.
77
+
70
78
  Args:
71
79
  scale(Literal["linear", "log"]): Scale of the y-axis.
72
80
  """
@@ -105,6 +113,7 @@ class BECPlotBase(RPCBase):
105
113
  def set_grid(self, x: "bool" = False, y: "bool" = False):
106
114
  """
107
115
  Set the grid of the plot widget.
116
+
108
117
  Args:
109
118
  x(bool): Show grid on the x-axis.
110
119
  y(bool): Show grid on the y-axis.
@@ -114,6 +123,7 @@ class BECPlotBase(RPCBase):
114
123
  def lock_aspect_ratio(self, lock):
115
124
  """
116
125
  Lock aspect ratio.
126
+
117
127
  Args:
118
128
  lock(bool): True to lock, False to unlock.
119
129
  """
@@ -122,6 +132,7 @@ class BECPlotBase(RPCBase):
122
132
  def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
123
133
  """
124
134
  Plot custom data on the plot widget. These data are not saved in config.
135
+
125
136
  Args:
126
137
  data_x(list|np.ndarray): x-axis data
127
138
  data_y(list|np.ndarray): y-axis data
@@ -148,6 +159,7 @@ class BECWaveform(RPCBase):
148
159
  def config_dict(self) -> "dict":
149
160
  """
150
161
  Get the configuration of the widget.
162
+
151
163
  Returns:
152
164
  dict: The configuration of the widget.
153
165
  """
@@ -169,6 +181,7 @@ class BECWaveform(RPCBase):
169
181
  ) -> "BECCurve":
170
182
  """
171
183
  Add a curve to the plot widget from the scan segment.
184
+
172
185
  Args:
173
186
  x_name(str): Name of the x signal.
174
187
  x_entry(str): Entry of the x signal.
@@ -196,6 +209,7 @@ class BECWaveform(RPCBase):
196
209
  ) -> "BECCurve":
197
210
  """
198
211
  Add a custom data curve to the plot widget.
212
+
199
213
  Args:
200
214
  x(list|np.ndarray): X data of the curve.
201
215
  y(list|np.ndarray): Y data of the curve.
@@ -211,6 +225,7 @@ class BECWaveform(RPCBase):
211
225
  def remove_curve(self, *identifiers):
212
226
  """
213
227
  Remove a curve from the plot widget.
228
+
214
229
  Args:
215
230
  *identifiers: Identifier of the curve to be removed. Can be either an integer (index) or a string (curve_id).
216
231
  """
@@ -220,6 +235,7 @@ class BECWaveform(RPCBase):
220
235
  """
221
236
  Update the scan curves with the data from the scan storage.
222
237
  Provide only one of scan_id or scan_index.
238
+
223
239
  Args:
224
240
  scan_id(str, optional): ScanID of the scan to be updated. Defaults to None.
225
241
  scan_index(int, optional): Index of the scan to be updated. Defaults to None.
@@ -238,8 +254,10 @@ class BECWaveform(RPCBase):
238
254
  def get_curve(self, identifier) -> "BECCurve":
239
255
  """
240
256
  Get the curve by its index or ID.
257
+
241
258
  Args:
242
259
  identifier(int|str): Identifier of the curve. Can be either an integer (index) or a string (curve_id).
260
+
243
261
  Returns:
244
262
  BECCurve: The curve object.
245
263
  """
@@ -248,8 +266,10 @@ class BECWaveform(RPCBase):
248
266
  def get_curve_config(self, curve_id: "str", dict_output: "bool" = True) -> "CurveConfig | dict":
249
267
  """
250
268
  Get the configuration of a curve by its ID.
269
+
251
270
  Args:
252
271
  curve_id(str): ID of the curve.
272
+
253
273
  Returns:
254
274
  CurveConfig|dict: Configuration of the curve.
255
275
  """
@@ -258,6 +278,7 @@ class BECWaveform(RPCBase):
258
278
  def apply_config(self, config: "dict | SubplotConfig", replot_last_scan: "bool" = False):
259
279
  """
260
280
  Apply the configuration to the 1D waveform widget.
281
+
261
282
  Args:
262
283
  config(dict|SubplotConfig): Configuration settings.
263
284
  replot_last_scan(bool, optional): If True, replot the last scan. Defaults to False.
@@ -267,8 +288,10 @@ class BECWaveform(RPCBase):
267
288
  def get_all_data(self, output: "Literal['dict', 'pandas']" = "dict") -> "dict | pd.DataFrame":
268
289
  """
269
290
  Extract all curve data into a dictionary or a pandas DataFrame.
291
+
270
292
  Args:
271
293
  output (Literal["dict", "pandas"]): Format of the output data.
294
+
272
295
  Returns:
273
296
  dict | pd.DataFrame: Data of all curves in the specified format.
274
297
  """
@@ -277,8 +300,10 @@ class BECWaveform(RPCBase):
277
300
  def set(self, **kwargs) -> "None":
278
301
  """
279
302
  Set the properties of the plot widget.
303
+
280
304
  Args:
281
305
  **kwargs: Keyword arguments for the properties to be set.
306
+
282
307
  Possible properties:
283
308
  - title: str
284
309
  - x_label: str
@@ -293,6 +318,7 @@ class BECWaveform(RPCBase):
293
318
  def set_title(self, title: "str"):
294
319
  """
295
320
  Set the title of the plot widget.
321
+
296
322
  Args:
297
323
  title(str): Title of the plot widget.
298
324
  """
@@ -301,6 +327,7 @@ class BECWaveform(RPCBase):
301
327
  def set_x_label(self, label: "str"):
302
328
  """
303
329
  Set the label of the x-axis.
330
+
304
331
  Args:
305
332
  label(str): Label of the x-axis.
306
333
  """
@@ -309,6 +336,7 @@ class BECWaveform(RPCBase):
309
336
  def set_y_label(self, label: "str"):
310
337
  """
311
338
  Set the label of the y-axis.
339
+
312
340
  Args:
313
341
  label(str): Label of the y-axis.
314
342
  """
@@ -317,6 +345,7 @@ class BECWaveform(RPCBase):
317
345
  def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
318
346
  """
319
347
  Set the scale of the x-axis.
348
+
320
349
  Args:
321
350
  scale(Literal["linear", "log"]): Scale of the x-axis.
322
351
  """
@@ -325,6 +354,7 @@ class BECWaveform(RPCBase):
325
354
  def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
326
355
  """
327
356
  Set the scale of the y-axis.
357
+
328
358
  Args:
329
359
  scale(Literal["linear", "log"]): Scale of the y-axis.
330
360
  """
@@ -363,6 +393,7 @@ class BECWaveform(RPCBase):
363
393
  def set_grid(self, x: "bool" = False, y: "bool" = False):
364
394
  """
365
395
  Set the grid of the plot widget.
396
+
366
397
  Args:
367
398
  x(bool): Show grid on the x-axis.
368
399
  y(bool): Show grid on the y-axis.
@@ -372,6 +403,7 @@ class BECWaveform(RPCBase):
372
403
  def lock_aspect_ratio(self, lock):
373
404
  """
374
405
  Lock aspect ratio.
406
+
375
407
  Args:
376
408
  lock(bool): True to lock, False to unlock.
377
409
  """
@@ -380,6 +412,7 @@ class BECWaveform(RPCBase):
380
412
  def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
381
413
  """
382
414
  Plot custom data on the plot widget. These data are not saved in config.
415
+
383
416
  Args:
384
417
  data_x(list|np.ndarray): x-axis data
385
418
  data_y(list|np.ndarray): y-axis data
@@ -406,6 +439,7 @@ class BECFigure(RPCBase):
406
439
  def config_dict(self) -> "dict":
407
440
  """
408
441
  Get the configuration of the widget.
442
+
409
443
  Returns:
410
444
  dict: The configuration of the widget.
411
445
  """
@@ -414,6 +448,7 @@ class BECFigure(RPCBase):
414
448
  def axes(self, row: "int", col: "int") -> "BECPlotBase":
415
449
  """
416
450
  Get widget by its coordinates in the figure.
451
+
417
452
  Args:
418
453
  row(int): the row coordinate
419
454
  col(int): the column coordinate
@@ -453,6 +488,7 @@ class BECFigure(RPCBase):
453
488
  ) -> "BECWaveform":
454
489
  """
455
490
  Add a Waveform1D plot to the figure at the specified position.
491
+
456
492
  Args:
457
493
  widget_id(str): The unique identifier of the widget. If not provided, a unique ID will be generated.
458
494
  row(int): The row coordinate of the widget in the figure. If not provided, the next empty row will be used.
@@ -476,6 +512,7 @@ class BECFigure(RPCBase):
476
512
  ) -> "BECImageShow":
477
513
  """
478
514
  Add an image to the figure at the specified position.
515
+
479
516
  Args:
480
517
  monitor(str): The name of the monitor to display.
481
518
  color_bar(Literal["simple","full"]): The type of color bar to display.
@@ -533,6 +570,7 @@ class BECFigure(RPCBase):
533
570
  ) -> "BECWaveform":
534
571
  """
535
572
  Add a 1D waveform plot to the figure. Always access the first waveform widget in the figure.
573
+
536
574
  Args:
537
575
  x_name(str): The name of the device for the x-axis.
538
576
  y_name(str): The name of the device for the y-axis.
@@ -564,6 +602,7 @@ class BECFigure(RPCBase):
564
602
  ) -> "BECImageShow":
565
603
  """
566
604
  Add an image to the figure. Always access the first image widget in the figure.
605
+
567
606
  Args:
568
607
  monitor(str): The name of the monitor to display.
569
608
  color_bar(Literal["simple","full"]): The type of color bar to display.
@@ -582,6 +621,7 @@ class BECFigure(RPCBase):
582
621
  ) -> "BECMotorMap":
583
622
  """
584
623
  Add a motor map to the figure. Always access the first motor map widget in the figure.
624
+
585
625
  Args:
586
626
  motor_x(str): The name of the motor for the X axis.
587
627
  motor_y(str): The name of the motor for the Y axis.
@@ -601,6 +641,7 @@ class BECFigure(RPCBase):
601
641
  ) -> "None":
602
642
  """
603
643
  Remove a widget from the figure. Can be removed by its unique identifier or by its coordinates.
644
+
604
645
  Args:
605
646
  row(int): The row coordinate of the widget to remove.
606
647
  col(int): The column coordinate of the widget to remove.
@@ -623,6 +664,7 @@ class BECFigure(RPCBase):
623
664
  def change_theme(self, theme: "Literal['dark', 'light']") -> "None":
624
665
  """
625
666
  Change the theme of the figure widget.
667
+
626
668
  Args:
627
669
  theme(Literal["dark","light"]): The theme to set for the figure widget.
628
670
  """
@@ -668,6 +710,7 @@ class BECCurve(RPCBase):
668
710
  def config_dict(self) -> "dict":
669
711
  """
670
712
  Get the configuration of the widget.
713
+
671
714
  Returns:
672
715
  dict: The configuration of the widget.
673
716
  """
@@ -676,8 +719,10 @@ class BECCurve(RPCBase):
676
719
  def set(self, **kwargs):
677
720
  """
678
721
  Set the properties of the curve.
722
+
679
723
  Args:
680
724
  **kwargs: Keyword arguments for the properties to be set.
725
+
681
726
  Possible properties:
682
727
  - color: str
683
728
  - symbol: str
@@ -697,6 +742,7 @@ class BECCurve(RPCBase):
697
742
  def set_color(self, color: "str", symbol_color: "Optional[str]" = None):
698
743
  """
699
744
  Change the color of the curve.
745
+
700
746
  Args:
701
747
  color(str): Color of the curve.
702
748
  symbol_color(str, optional): Color of the symbol. Defaults to None.
@@ -706,6 +752,7 @@ class BECCurve(RPCBase):
706
752
  def set_colormap(self, colormap: "str"):
707
753
  """
708
754
  Set the colormap for the scatter plot z gradient.
755
+
709
756
  Args:
710
757
  colormap(str): Colormap for the scatter plot.
711
758
  """
@@ -714,6 +761,7 @@ class BECCurve(RPCBase):
714
761
  def set_symbol(self, symbol: "str"):
715
762
  """
716
763
  Change the symbol of the curve.
764
+
717
765
  Args:
718
766
  symbol(str): Symbol of the curve.
719
767
  """
@@ -722,6 +770,7 @@ class BECCurve(RPCBase):
722
770
  def set_symbol_color(self, symbol_color: "str"):
723
771
  """
724
772
  Change the symbol color of the curve.
773
+
725
774
  Args:
726
775
  symbol_color(str): Color of the symbol.
727
776
  """
@@ -730,6 +779,7 @@ class BECCurve(RPCBase):
730
779
  def set_symbol_size(self, symbol_size: "int"):
731
780
  """
732
781
  Change the symbol size of the curve.
782
+
733
783
  Args:
734
784
  symbol_size(int): Size of the symbol.
735
785
  """
@@ -738,6 +788,7 @@ class BECCurve(RPCBase):
738
788
  def set_pen_width(self, pen_width: "int"):
739
789
  """
740
790
  Change the pen width of the curve.
791
+
741
792
  Args:
742
793
  pen_width(int): Width of the pen.
743
794
  """
@@ -746,6 +797,7 @@ class BECCurve(RPCBase):
746
797
  def set_pen_style(self, pen_style: "Literal['solid', 'dash', 'dot', 'dashdot']"):
747
798
  """
748
799
  Change the pen style of the curve.
800
+
749
801
  Args:
750
802
  pen_style(Literal["solid", "dash", "dot", "dashdot"]): Style of the pen.
751
803
  """
@@ -772,6 +824,7 @@ class BECImageShow(RPCBase):
772
824
  def config_dict(self) -> "dict":
773
825
  """
774
826
  Get the configuration of the widget.
827
+
775
828
  Returns:
776
829
  dict: The configuration of the widget.
777
830
  """
@@ -780,6 +833,7 @@ class BECImageShow(RPCBase):
780
833
  def add_image_by_config(self, config: "ImageItemConfig | dict") -> "BECImageItem":
781
834
  """
782
835
  Add an image to the widget by configuration.
836
+
783
837
  Args:
784
838
  config(ImageItemConfig|dict): The configuration of the image.
785
839
 
@@ -791,6 +845,7 @@ class BECImageShow(RPCBase):
791
845
  def get_image_config(self, image_id, dict_output: "bool" = True) -> "ImageItemConfig | dict":
792
846
  """
793
847
  Get the configuration of the image.
848
+
794
849
  Args:
795
850
  image_id(str): The ID of the image.
796
851
  dict_output(bool): Whether to return the configuration as a dictionary. Defaults to True.
@@ -803,6 +858,7 @@ class BECImageShow(RPCBase):
803
858
  def get_image_dict(self) -> "dict[str, dict[str, BECImageItem]]":
804
859
  """
805
860
  Get all images.
861
+
806
862
  Returns:
807
863
  dict[str, dict[str, BECImageItem]]: The dictionary of images.
808
864
  """
@@ -843,6 +899,7 @@ class BECImageShow(RPCBase):
843
899
  """
844
900
  Set the range of the color bar.
845
901
  If name is not specified, then set vrange for all images.
902
+
846
903
  Args:
847
904
  vmin(float): Minimum value of the color bar.
848
905
  vmax(float): Maximum value of the color bar.
@@ -854,6 +911,7 @@ class BECImageShow(RPCBase):
854
911
  """
855
912
  Set the color map of the image.
856
913
  If name is not specified, then set color map for all images.
914
+
857
915
  Args:
858
916
  cmap(str): The color map of the image.
859
917
  name(str): The name of the image. If None, apply to all images.
@@ -863,6 +921,7 @@ class BECImageShow(RPCBase):
863
921
  def set_autorange(self, enable: "bool" = False, name: "str" = None):
864
922
  """
865
923
  Set the autoscale of the image.
924
+
866
925
  Args:
867
926
  enable(bool): Whether to autoscale the color bar.
868
927
  name(str): The name of the image. If None, apply to all images.
@@ -873,6 +932,7 @@ class BECImageShow(RPCBase):
873
932
  """
874
933
  Set the monitor of the image.
875
934
  If name is not specified, then set monitor for all images.
935
+
876
936
  Args:
877
937
  monitor(str): The name of the monitor.
878
938
  name(str): The name of the image. If None, apply to all images.
@@ -883,6 +943,7 @@ class BECImageShow(RPCBase):
883
943
  """
884
944
  Set the post processing of the image.
885
945
  If name is not specified, then set post processing for all images.
946
+
886
947
  Args:
887
948
  name(str): The name of the image. If None, apply to all images.
888
949
  **kwargs: Keyword arguments for the properties to be set.
@@ -897,6 +958,7 @@ class BECImageShow(RPCBase):
897
958
  def set_image_properties(self, name: "str" = None, **kwargs):
898
959
  """
899
960
  Set the properties of the image.
961
+
900
962
  Args:
901
963
  name(str): The name of the image. If None, apply to all images.
902
964
  **kwargs: Keyword arguments for the properties to be set.
@@ -917,6 +979,7 @@ class BECImageShow(RPCBase):
917
979
  """
918
980
  Set the FFT of the image.
919
981
  If name is not specified, then set FFT for all images.
982
+
920
983
  Args:
921
984
  enable(bool): Whether to perform FFT on the monitor data.
922
985
  name(str): The name of the image. If None, apply to all images.
@@ -927,6 +990,7 @@ class BECImageShow(RPCBase):
927
990
  """
928
991
  Set the log of the image.
929
992
  If name is not specified, then set log for all images.
993
+
930
994
  Args:
931
995
  enable(bool): Whether to perform log on the monitor data.
932
996
  name(str): The name of the image. If None, apply to all images.
@@ -937,6 +1001,7 @@ class BECImageShow(RPCBase):
937
1001
  """
938
1002
  Set the rotation of the image.
939
1003
  If name is not specified, then set rotation for all images.
1004
+
940
1005
  Args:
941
1006
  deg_90(int): The rotation angle of the monitor data before displaying.
942
1007
  name(str): The name of the image. If None, apply to all images.
@@ -947,6 +1012,7 @@ class BECImageShow(RPCBase):
947
1012
  """
948
1013
  Set the transpose of the image.
949
1014
  If name is not specified, then set transpose for all images.
1015
+
950
1016
  Args:
951
1017
  enable(bool): Whether to transpose the monitor data before displaying.
952
1018
  name(str): The name of the image. If None, apply to all images.
@@ -956,6 +1022,7 @@ class BECImageShow(RPCBase):
956
1022
  def toggle_threading(self, use_threading: "bool"):
957
1023
  """
958
1024
  Toggle threading for the widgets postprocessing and updating.
1025
+
959
1026
  Args:
960
1027
  use_threading(bool): Whether to use threading.
961
1028
  """
@@ -964,8 +1031,10 @@ class BECImageShow(RPCBase):
964
1031
  def set(self, **kwargs) -> "None":
965
1032
  """
966
1033
  Set the properties of the plot widget.
1034
+
967
1035
  Args:
968
1036
  **kwargs: Keyword arguments for the properties to be set.
1037
+
969
1038
  Possible properties:
970
1039
  - title: str
971
1040
  - x_label: str
@@ -980,6 +1049,7 @@ class BECImageShow(RPCBase):
980
1049
  def set_title(self, title: "str"):
981
1050
  """
982
1051
  Set the title of the plot widget.
1052
+
983
1053
  Args:
984
1054
  title(str): Title of the plot widget.
985
1055
  """
@@ -988,6 +1058,7 @@ class BECImageShow(RPCBase):
988
1058
  def set_x_label(self, label: "str"):
989
1059
  """
990
1060
  Set the label of the x-axis.
1061
+
991
1062
  Args:
992
1063
  label(str): Label of the x-axis.
993
1064
  """
@@ -996,6 +1067,7 @@ class BECImageShow(RPCBase):
996
1067
  def set_y_label(self, label: "str"):
997
1068
  """
998
1069
  Set the label of the y-axis.
1070
+
999
1071
  Args:
1000
1072
  label(str): Label of the y-axis.
1001
1073
  """
@@ -1004,6 +1076,7 @@ class BECImageShow(RPCBase):
1004
1076
  def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
1005
1077
  """
1006
1078
  Set the scale of the x-axis.
1079
+
1007
1080
  Args:
1008
1081
  scale(Literal["linear", "log"]): Scale of the x-axis.
1009
1082
  """
@@ -1012,6 +1085,7 @@ class BECImageShow(RPCBase):
1012
1085
  def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
1013
1086
  """
1014
1087
  Set the scale of the y-axis.
1088
+
1015
1089
  Args:
1016
1090
  scale(Literal["linear", "log"]): Scale of the y-axis.
1017
1091
  """
@@ -1050,6 +1124,7 @@ class BECImageShow(RPCBase):
1050
1124
  def set_grid(self, x: "bool" = False, y: "bool" = False):
1051
1125
  """
1052
1126
  Set the grid of the plot widget.
1127
+
1053
1128
  Args:
1054
1129
  x(bool): Show grid on the x-axis.
1055
1130
  y(bool): Show grid on the y-axis.
@@ -1059,6 +1134,7 @@ class BECImageShow(RPCBase):
1059
1134
  def lock_aspect_ratio(self, lock):
1060
1135
  """
1061
1136
  Lock aspect ratio.
1137
+
1062
1138
  Args:
1063
1139
  lock(bool): True to lock, False to unlock.
1064
1140
  """
@@ -1067,6 +1143,7 @@ class BECImageShow(RPCBase):
1067
1143
  def plot(self, data_x: "list | np.ndarray", data_y: "list | np.ndarray", **kwargs):
1068
1144
  """
1069
1145
  Plot custom data on the plot widget. These data are not saved in config.
1146
+
1070
1147
  Args:
1071
1148
  data_x(list|np.ndarray): x-axis data
1072
1149
  data_y(list|np.ndarray): y-axis data
@@ -1095,6 +1172,7 @@ class BECConnector(RPCBase):
1095
1172
  def config_dict(self) -> "dict":
1096
1173
  """
1097
1174
  Get the configuration of the widget.
1175
+
1098
1176
  Returns:
1099
1177
  dict: The configuration of the widget.
1100
1178
  """
@@ -1119,6 +1197,7 @@ class BECImageItem(RPCBase):
1119
1197
  def config_dict(self) -> "dict":
1120
1198
  """
1121
1199
  Get the configuration of the widget.
1200
+
1122
1201
  Returns:
1123
1202
  dict: The configuration of the widget.
1124
1203
  """
@@ -1127,8 +1206,10 @@ class BECImageItem(RPCBase):
1127
1206
  def set(self, **kwargs):
1128
1207
  """
1129
1208
  Set the properties of the image.
1209
+
1130
1210
  Args:
1131
1211
  **kwargs: Keyword arguments for the properties to be set.
1212
+
1132
1213
  Possible properties:
1133
1214
  - downsample
1134
1215
  - color_map
@@ -1145,6 +1226,7 @@ class BECImageItem(RPCBase):
1145
1226
  def set_fft(self, enable: "bool" = False):
1146
1227
  """
1147
1228
  Set the FFT of the image.
1229
+
1148
1230
  Args:
1149
1231
  enable(bool): Whether to perform FFT on the monitor data.
1150
1232
  """
@@ -1153,6 +1235,7 @@ class BECImageItem(RPCBase):
1153
1235
  def set_log(self, enable: "bool" = False):
1154
1236
  """
1155
1237
  Set the log of the image.
1238
+
1156
1239
  Args:
1157
1240
  enable(bool): Whether to perform log on the monitor data.
1158
1241
  """
@@ -1161,6 +1244,7 @@ class BECImageItem(RPCBase):
1161
1244
  def set_rotation(self, deg_90: "int" = 0):
1162
1245
  """
1163
1246
  Set the rotation of the image.
1247
+
1164
1248
  Args:
1165
1249
  deg_90(int): The rotation angle of the monitor data before displaying.
1166
1250
  """
@@ -1169,6 +1253,7 @@ class BECImageItem(RPCBase):
1169
1253
  def set_transpose(self, enable: "bool" = False):
1170
1254
  """
1171
1255
  Set the transpose of the image.
1256
+
1172
1257
  Args:
1173
1258
  enable(bool): Whether to transpose the image.
1174
1259
  """
@@ -1177,6 +1262,7 @@ class BECImageItem(RPCBase):
1177
1262
  def set_opacity(self, opacity: "float" = 1.0):
1178
1263
  """
1179
1264
  Set the opacity of the image.
1265
+
1180
1266
  Args:
1181
1267
  opacity(float): The opacity of the image.
1182
1268
  """
@@ -1185,6 +1271,7 @@ class BECImageItem(RPCBase):
1185
1271
  def set_autorange(self, autorange: "bool" = False):
1186
1272
  """
1187
1273
  Set the autorange of the color bar.
1274
+
1188
1275
  Args:
1189
1276
  autorange(bool): Whether to autorange the color bar.
1190
1277
  """
@@ -1193,6 +1280,7 @@ class BECImageItem(RPCBase):
1193
1280
  def set_color_map(self, cmap: "str" = "magma"):
1194
1281
  """
1195
1282
  Set the color map of the image.
1283
+
1196
1284
  Args:
1197
1285
  cmap(str): The color map of the image.
1198
1286
  """
@@ -1201,6 +1289,7 @@ class BECImageItem(RPCBase):
1201
1289
  def set_auto_downsample(self, auto: "bool" = True):
1202
1290
  """
1203
1291
  Set the auto downsample of the image.
1292
+
1204
1293
  Args:
1205
1294
  auto(bool): Whether to downsample the image.
1206
1295
  """
@@ -1209,6 +1298,7 @@ class BECImageItem(RPCBase):
1209
1298
  def set_monitor(self, monitor: "str"):
1210
1299
  """
1211
1300
  Set the monitor of the image.
1301
+
1212
1302
  Args:
1213
1303
  monitor(str): The name of the monitor.
1214
1304
  """
@@ -1219,6 +1309,7 @@ class BECImageItem(RPCBase):
1219
1309
  ):
1220
1310
  """
1221
1311
  Set the range of the color bar.
1312
+
1222
1313
  Args:
1223
1314
  vmin(float): Minimum value of the color bar.
1224
1315
  vmax(float): Maximum value of the color bar.
@@ -1239,6 +1330,7 @@ class BECMotorMap(RPCBase):
1239
1330
  def config_dict(self) -> "dict":
1240
1331
  """
1241
1332
  Get the configuration of the widget.
1333
+
1242
1334
  Returns:
1243
1335
  dict: The configuration of the widget.
1244
1336
  """
@@ -1254,6 +1346,7 @@ class BECMotorMap(RPCBase):
1254
1346
  ) -> "None":
1255
1347
  """
1256
1348
  Change the active motors for the plot.
1349
+
1257
1350
  Args:
1258
1351
  motor_x(str): Motor name for the X axis.
1259
1352
  motor_y(str): Motor name for the Y axis.
@@ -1266,6 +1359,7 @@ class BECMotorMap(RPCBase):
1266
1359
  def set_max_points(self, max_points: "int") -> "None":
1267
1360
  """
1268
1361
  Set the maximum number of points to display.
1362
+
1269
1363
  Args:
1270
1364
  max_points(int): Maximum number of points to display.
1271
1365
  """
@@ -1274,6 +1368,7 @@ class BECMotorMap(RPCBase):
1274
1368
  def set_precision(self, precision: "int") -> "None":
1275
1369
  """
1276
1370
  Set the decimal precision of the motor position.
1371
+
1277
1372
  Args:
1278
1373
  precision(int): Decimal precision of the motor position.
1279
1374
  """
@@ -1282,6 +1377,7 @@ class BECMotorMap(RPCBase):
1282
1377
  def set_num_dim_points(self, num_dim_points: "int") -> "None":
1283
1378
  """
1284
1379
  Set the number of dim points for the motor map.
1380
+
1285
1381
  Args:
1286
1382
  num_dim_points(int): Number of dim points.
1287
1383
  """
@@ -1290,6 +1386,7 @@ class BECMotorMap(RPCBase):
1290
1386
  def set_background_value(self, background_value: "int") -> "None":
1291
1387
  """
1292
1388
  Set the background value of the motor map.
1389
+
1293
1390
  Args:
1294
1391
  background_value(int): Background value of the motor map.
1295
1392
  """
@@ -1298,6 +1395,7 @@ class BECMotorMap(RPCBase):
1298
1395
  def set_scatter_size(self, scatter_size: "int") -> "None":
1299
1396
  """
1300
1397
  Set the scatter size of the motor map plot.
1398
+
1301
1399
  Args:
1302
1400
  scatter_size(int): Size of the scatter points.
1303
1401
  """
@@ -1312,11 +1410,19 @@ class BECMotorMap(RPCBase):
1312
1410
 
1313
1411
 
1314
1412
  class BECDock(RPCBase):
1413
+ @property
1414
+ @rpc_call
1415
+ def rpc_id(self) -> "str":
1416
+ """
1417
+ Get the RPC ID of the widget.
1418
+ """
1419
+
1315
1420
  @property
1316
1421
  @rpc_call
1317
1422
  def widget_list(self) -> "list":
1318
1423
  """
1319
1424
  Get the widgets in the dock.
1425
+
1320
1426
  Returns:
1321
1427
  widgets(list): The widgets in the dock.
1322
1428
  """
@@ -1363,6 +1469,7 @@ class BECDock(RPCBase):
1363
1469
  ):
1364
1470
  """
1365
1471
  Add a widget to the dock.
1472
+
1366
1473
  Args:
1367
1474
  widget_type(str): The widget to add. Only BEC RPC widgets from RPCWidgetHandler are allowed.
1368
1475
  row(int): The row to add the widget to. If None, the widget will be added to the next available row.
@@ -1376,6 +1483,7 @@ class BECDock(RPCBase):
1376
1483
  def list_eligible_widgets(self) -> "list":
1377
1484
  """
1378
1485
  List all widgets that can be added to the dock.
1486
+
1379
1487
  Returns:
1380
1488
  list: The list of eligible widgets.
1381
1489
  """
@@ -1384,6 +1492,7 @@ class BECDock(RPCBase):
1384
1492
  def move_widget(self, widget: "QWidget", new_row: "int", new_col: "int"):
1385
1493
  """
1386
1494
  Move a widget to a new position in the layout.
1495
+
1387
1496
  Args:
1388
1497
  widget(QWidget): The widget to move.
1389
1498
  new_row(int): The new row to move the widget to.
@@ -1391,11 +1500,12 @@ class BECDock(RPCBase):
1391
1500
  """
1392
1501
 
1393
1502
  @rpc_call
1394
- def remove_widget(self, widget: "QWidget"):
1503
+ def remove_widget(self, widget_rpc_id: "str"):
1395
1504
  """
1396
1505
  Remove a widget from the dock.
1506
+
1397
1507
  Args:
1398
- widget(QWidget): The widget to remove.
1508
+ widget_rpc_id(str): The ID of the widget to remove.
1399
1509
  """
1400
1510
 
1401
1511
  @rpc_call
@@ -1407,13 +1517,13 @@ class BECDock(RPCBase):
1407
1517
  @rpc_call
1408
1518
  def attach(self):
1409
1519
  """
1410
- None
1520
+ Attach the dock to the parent dock area.
1411
1521
  """
1412
1522
 
1413
1523
  @rpc_call
1414
1524
  def detach(self):
1415
1525
  """
1416
- None
1526
+ Detach the dock from the parent dock area.
1417
1527
  """
1418
1528
 
1419
1529
 
@@ -1431,6 +1541,7 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1431
1541
  def save_state(self) -> "dict":
1432
1542
  """
1433
1543
  Save the state of the dock area.
1544
+
1434
1545
  Returns:
1435
1546
  dict: The state of the dock area.
1436
1547
  """
@@ -1439,6 +1550,7 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1439
1550
  def remove_dock(self, name: "str"):
1440
1551
  """
1441
1552
  Remove a dock by name and ensure it is properly closed and cleaned up.
1553
+
1442
1554
  Args:
1443
1555
  name(str): The name of the dock to remove.
1444
1556
  """
@@ -1449,6 +1561,7 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1449
1561
  ):
1450
1562
  """
1451
1563
  Restore the state of the dock area. If no state is provided, the last state is restored.
1564
+
1452
1565
  Args:
1453
1566
  state(dict): The state to restore.
1454
1567
  missing(Literal['ignore','error']): What to do if a dock is missing.
@@ -1460,10 +1573,10 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1460
1573
  self,
1461
1574
  name: "str" = None,
1462
1575
  position: "Literal['bottom', 'top', 'left', 'right', 'above', 'below']" = None,
1463
- relative_to: "Optional[BECDock]" = None,
1576
+ relative_to: "BECDock | None" = None,
1464
1577
  closable: "bool" = False,
1465
1578
  prefix: "str" = "dock",
1466
- widget: "QWidget" = None,
1579
+ widget: "str | QWidget | None" = None,
1467
1580
  row: "int" = None,
1468
1581
  col: "int" = 0,
1469
1582
  rowspan: "int" = 1,
@@ -1478,11 +1591,12 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1478
1591
  relative_to(BECDock): The dock to which the new dock should be added relative to.
1479
1592
  closable(bool): Whether the dock is closable.
1480
1593
  prefix(str): The prefix for the dock name if no name is provided.
1481
- widget(QWidget): The widget to be added to the dock.
1594
+ widget(str|QWidget|None): The widget to be added to the dock. While using RPC, only BEC RPC widgets from RPCWidgetHandler are allowed.
1482
1595
  row(int): The row of the added widget.
1483
1596
  col(int): The column of the added widget.
1484
1597
  rowspan(int): The rowspan of the added widget.
1485
1598
  colspan(int): The colspan of the added widget.
1599
+
1486
1600
  Returns:
1487
1601
  BECDock: The created dock.
1488
1602
  """
@@ -1497,8 +1611,9 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1497
1611
  def detach_dock(self, dock_name: "str") -> "BECDock":
1498
1612
  """
1499
1613
  Undock a dock from the dock area.
1614
+
1500
1615
  Args:
1501
- dock(BECDock): The dock to undock.
1616
+ dock_name(str): The dock to undock.
1502
1617
 
1503
1618
  Returns:
1504
1619
  BECDock: The undocked dock.