bec-widgets 2.12.3__py3-none-any.whl → 2.12.4__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.
@@ -0,0 +1,15 @@
1
+ name: 'Close stale issues and PRs'
2
+ on:
3
+ schedule:
4
+ - cron: '00 10 * * *'
5
+
6
+ jobs:
7
+ stale:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/stale@v9
11
+ with:
12
+ stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
13
+ stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
14
+ days-before-stale: 60
15
+ days-before-close: 7
CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v2.12.4 (2025-06-10)
5
+
6
+ ### Bug Fixes
7
+
8
+ - **image_roi**: Coordinates are emitted correctly when handles are inverted; closes #672
9
+ ([`9ef418b`](https://github.com/bec-project/bec_widgets/commit/9ef418bf5597d4be77adc3c0c88c1c1619c9aa2f))
10
+
11
+ ### Continuous Integration
12
+
13
+ - Add stale issue job
14
+ ([`b3ce680`](https://github.com/bec-project/bec_widgets/commit/b3ce68070d58cdd76559cbd7db04cdbcc6c1f075))
15
+
16
+
4
17
  ## v2.12.3 (2025-06-05)
5
18
 
6
19
  ### Bug Fixes
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 2.12.3
3
+ Version: 2.12.4
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
@@ -437,6 +437,23 @@ class RectangularROI(BaseROI, pg.RectROI):
437
437
  self.hoverPen = fn.mkPen(color=(255, 0, 0), width=3, style=QtCore.Qt.DashLine)
438
438
  self.handleHoverPen = fn.mkPen("lime", width=4)
439
439
 
440
+ def _normalized_edges(self) -> tuple[float, float, float, float]:
441
+ """
442
+ Return rectangle edges as (left, bottom, right, top) with consistent
443
+ ordering even when the ROI has been inverted by its scale handles.
444
+
445
+ Returns:
446
+ tuple: A tuple containing the left, bottom, right, and top edges
447
+ of the ROI rectangle in normalized coordinates.
448
+ """
449
+ x0, y0 = self.pos().x(), self.pos().y()
450
+ w, h = self.state["size"]
451
+ x_left = min(x0, x0 + w)
452
+ x_right = max(x0, x0 + w)
453
+ y_bottom = min(y0, y0 + h)
454
+ y_top = max(y0, y0 + h)
455
+ return x_left, y_bottom, x_right, y_top
456
+
440
457
  def add_scale_handle(self):
441
458
  """
442
459
  Add scale handles at every corner and edge of the ROI.
@@ -465,17 +482,15 @@ class RectangularROI(BaseROI, pg.RectROI):
465
482
 
466
483
  def _on_region_changed(self):
467
484
  """
468
- Handles ROI region change events.
485
+ Handles changes to the ROI's region.
469
486
 
470
487
  This method is called whenever the ROI's position or size changes.
471
488
  It calculates the new corner coordinates and emits the edgesChanged signal
472
489
  with the updated coordinates.
473
490
  """
474
- x0, y0 = self.pos().x(), self.pos().y()
475
- w, h = self.state["size"]
476
- self.edgesChanged.emit(x0, y0, x0 + w, y0 + h)
477
- viewBox = self.parent_plot_item.vb
478
- viewBox.update()
491
+ x_left, y_bottom, x_right, y_top = self._normalized_edges()
492
+ self.edgesChanged.emit(x_left, y_bottom, x_right, y_top)
493
+ self.parent_plot_item.vb.update()
479
494
 
480
495
  def mouseDragEvent(self, ev):
481
496
  """
@@ -489,9 +504,8 @@ class RectangularROI(BaseROI, pg.RectROI):
489
504
  """
490
505
  super().mouseDragEvent(ev)
491
506
  if ev.isFinish():
492
- x0, y0 = self.pos().x(), self.pos().y()
493
- w, h = self.state["size"]
494
- self.edgesReleased.emit(x0, y0, x0 + w, y0 + h)
507
+ x_left, y_bottom, x_right, y_top = self._normalized_edges()
508
+ self.edgesReleased.emit(x_left, y_bottom, x_right, y_top)
495
509
 
496
510
  def get_coordinates(self, typed: bool | None = None) -> dict | tuple:
497
511
  """
@@ -510,17 +524,16 @@ class RectangularROI(BaseROI, pg.RectROI):
510
524
  if typed is None:
511
525
  typed = self.description
512
526
 
513
- x0, y0 = self.pos().x(), self.pos().y()
514
- w, h = self.state["size"]
515
- x1, y1 = x0 + w, y0 + h
527
+ x_left, y_bottom, x_right, y_top = self._normalized_edges()
528
+
516
529
  if typed:
517
530
  return {
518
- "bottom_left": (x0, y0),
519
- "bottom_right": (x1, y0),
520
- "top_left": (x0, y1),
521
- "top_right": (x1, y1),
531
+ "bottom_left": (x_left, y_bottom),
532
+ "bottom_right": (x_right, y_bottom),
533
+ "top_left": (x_left, y_top),
534
+ "top_right": (x_right, y_top),
522
535
  }
523
- return ((x0, y0), (x1, y0), (x0, y1), (x1, y1))
536
+ return (x_left, y_bottom), (x_right, y_bottom), (x_left, y_top), (x_right, y_top)
524
537
 
525
538
  def _lookup_scene_image(self):
526
539
  """
@@ -654,7 +667,7 @@ class CircularROI(BaseROI, pg.CircleROI):
654
667
  if typed is None:
655
668
  typed = self.description
656
669
 
657
- d = self.state["size"][0]
670
+ d = abs(self.state["size"][0])
658
671
  cx = self.pos().x() + d / 2
659
672
  cy = self.pos().y() + d / 2
660
673
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 2.12.3
3
+ Version: 2.12.4
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=1nMYldzVk0tFkBWYTcUjumOrdSADASheWOAc0kOFDYs,9509
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=ivqg3HTaOxNbEW3bzWh9MXAkrekuGoNdj0Mj3SdRYuw,639
5
- CHANGELOG.md,sha256=-3WQU4pTRoYhYRYqq3l_pU9H6tevpGKSbPIdIk2DUOY,298015
5
+ CHANGELOG.md,sha256=On772_xBp6UXL4xD4-avtvUKnrHAn_WkDG54pbO8faw,298414
6
6
  LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
7
- PKG-INFO,sha256=r3TUzt3yd2hxbLa3PN3y3K3nXlrDOkCkYjQOvuFc_rw,1252
7
+ PKG-INFO,sha256=yGts5s4Gww_NSvVRgwxfZ4qy9VcGBEFgtvYb3GwhVFE,1252
8
8
  README.md,sha256=oY5Jc1uXehRASuwUJ0umin2vfkFh7tHF-LLruHTaQx0,3560
9
- pyproject.toml,sha256=yNICdyTZSQATRSjrmwHJ2Jh832NbrsObMzGZmc7t2wU,2827
9
+ pyproject.toml,sha256=J2FCGRnxVqdJMydJh53r1De16ht1tmpzMqa-I5v1FEM,2827
10
10
  .git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
11
11
  .github/pull_request_template.md,sha256=F_cJXzooWMFgMGtLK-7KeGcQt0B4AYFse5oN0zQ9p6g,801
12
12
  .github/ISSUE_TEMPLATE/bug_report.yml,sha256=WdRnt7HGxvsIBLzhkaOWNfg8IJQYa_oV9_F08Ym6znQ,1081
@@ -23,6 +23,7 @@ pyproject.toml,sha256=yNICdyTZSQATRSjrmwHJ2Jh832NbrsObMzGZmc7t2wU,2827
23
23
  .github/workflows/pytest-matrix.yml,sha256=0gL5wNPJKJF1JapqstlYNYiJ44ko05uaTD7epa7smVw,1834
24
24
  .github/workflows/pytest.yml,sha256=hYOB7XK_79MaiELaTH7zDT-WRw-pRDe4mHyB_WfcGDc,1747
25
25
  .github/workflows/semantic_release.yml,sha256=pdkv1rVG3YgG7yu4nNWvbGZifH4bqO1eh3pM0KHRK04,3720
26
+ .github/workflows/stale-issues.yml,sha256=Q1n-RO1FjEtuWJFRXpqzWnl7Y6EUn0T2ZSRdZQadJA4,568
26
27
  .github/workflows/sync-issues-pr.yml,sha256=Wn68mK8h0xhwIX1VZPEqHEJmku2BRPOrQ6zQsuCIBJk,1039
27
28
  bec_widgets/__init__.py,sha256=mZhbU6zfFt8-A7q_do74ie89budSevwpKZ6FKtEBdmo,170
28
29
  bec_widgets/applications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -290,7 +291,7 @@ bec_widgets/widgets/plots/multi_waveform/settings/multi_waveform_controls.ui,sha
290
291
  bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
291
292
  bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py,sha256=lGreAkRBd-A4X_wqYZiKyGDmb_3uzLunjSju9A2PjWw,2532
292
293
  bec_widgets/widgets/plots/roi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
293
- bec_widgets/widgets/plots/roi/image_roi.py,sha256=HIDlsRJtsZf2Iu09tHQuRXI0jFUiBJzTvKe8C_aI1no,32333
294
+ bec_widgets/widgets/plots/roi/image_roi.py,sha256=EobZDeUV3l9O08tKwFGZEvkGNOMnVp0hHWNodYce9I0,32998
294
295
  bec_widgets/widgets/plots/scatter_waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
295
296
  bec_widgets/widgets/plots/scatter_waveform/register_scatter_waveform.py,sha256=KttVjlAK3PfP9tyMfLnqEm6kphap8NZyqyaRry8oebY,514
296
297
  bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py,sha256=nCyZ_6EunS1m5XkLB-CwfBV9L4IX04D9SpHlHc8zG_I,6763
@@ -407,8 +408,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=O
407
408
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
408
409
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
409
410
  bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
410
- bec_widgets-2.12.3.dist-info/METADATA,sha256=r3TUzt3yd2hxbLa3PN3y3K3nXlrDOkCkYjQOvuFc_rw,1252
411
- bec_widgets-2.12.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
412
- bec_widgets-2.12.3.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
413
- bec_widgets-2.12.3.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
414
- bec_widgets-2.12.3.dist-info/RECORD,,
411
+ bec_widgets-2.12.4.dist-info/METADATA,sha256=yGts5s4Gww_NSvVRgwxfZ4qy9VcGBEFgtvYb3GwhVFE,1252
412
+ bec_widgets-2.12.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
413
+ bec_widgets-2.12.4.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
414
+ bec_widgets-2.12.4.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
415
+ bec_widgets-2.12.4.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "2.12.3"
7
+ version = "2.12.4"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [