plopp 25.10.0__py3-none-any.whl → 25.11.0__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.
plopp/widgets/drawing.py CHANGED
@@ -76,6 +76,7 @@ class DrawingTool(ToggleTool):
76
76
  self._destination = destination
77
77
  self._destination_is_fig = is_figure(self._destination)
78
78
  self._get_artist_info = get_artist_info
79
+ self._get_artist_info_is_callable = None
79
80
  self._tool.on_create(self.make_node)
80
81
  self._tool.on_remove(self.remove_node)
81
82
  if continuous_update:
@@ -85,7 +86,10 @@ class DrawingTool(ToggleTool):
85
86
  self._tool.on_drag_release(self.update_node)
86
87
 
87
88
  def make_node(self, artist):
88
- draw_node = Node(self._get_artist_info(artist=artist, figure=self._figure))
89
+ info = self._get_artist_info(artist=artist, figure=self._figure)
90
+ if self._get_artist_info_is_callable is None:
91
+ self._get_artist_info_is_callable = callable(info)
92
+ draw_node = Node(info)
89
93
  draw_node.pretty_name = f'Draw node {len(self._draw_nodes)}'
90
94
  nodeid = draw_node.id
91
95
  self._draw_nodes[nodeid] = draw_node
@@ -105,7 +109,10 @@ class DrawingTool(ToggleTool):
105
109
 
106
110
  def update_node(self, artist):
107
111
  n = self._draw_nodes[artist.nodeid]
108
- n.func = self._get_artist_info(artist=artist, figure=self._figure)
112
+ if self._get_artist_info_is_callable:
113
+ n.func = self._get_artist_info(artist=artist, figure=self._figure)
114
+ else:
115
+ n.func = partial(self._get_artist_info, artist=artist, figure=self._figure)
109
116
  n.notify_children(artist)
110
117
 
111
118
  def remove_node(self, artist):
@@ -134,7 +141,7 @@ def _get_points_info(artist, figure):
134
141
  Convert the raw (x, y) position of a point to a dict containing the dimensions of
135
142
  each axis, and scalar values with units.
136
143
  """
137
- return lambda: {
144
+ return {
138
145
  'x': {
139
146
  'dim': figure.canvas.dims['x'],
140
147
  'value': sc.scalar(artist.x, unit=figure.canvas.units['x']),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plopp
3
- Version: 25.10.0
3
+ Version: 25.11.0
4
4
  Summary: Visualization library for Scipp
5
5
  Author: Scipp contributors
6
6
  License-Expression: BSD-3-Clause
@@ -36,6 +36,7 @@ Requires-Dist: graphviz>=0.20.3; extra == "test"
36
36
  Requires-Dist: h5py>=3.12; extra == "test"
37
37
  Requires-Dist: ipympl>=0.8.4; extra == "test"
38
38
  Requires-Dist: ipywidgets>=8.1.0; extra == "test"
39
+ Requires-Dist: ipykernel<7; extra == "test"
39
40
  Requires-Dist: mpltoolbox>=24.6.0; extra == "test"
40
41
  Requires-Dist: pandas>=2.2.2; extra == "test"
41
42
  Requires-Dist: plotly>=5.15.0; extra == "test"
@@ -65,14 +65,14 @@ plopp/widgets/box.py,sha256=v5Gd3sY0WXcc3UfkcXxZboPG02sfOMXIo50tmpxPwVs,1806
65
65
  plopp/widgets/checkboxes.py,sha256=52yJryEu1upYafFxqoTOdAZmHeKzCI_CJiCWSezCtRA,2430
66
66
  plopp/widgets/clip3d.py,sha256=L90HUd3bjEU3BaPdK8DnUbeeFNqfFyBWDEwaG9nP-M8,14602
67
67
  plopp/widgets/debounce.py,sha256=V5aIcnb465oqXZX-UG_DR7GjvoG6D_C2jjEUBmguGDA,1292
68
- plopp/widgets/drawing.py,sha256=Pcozffq7I5H9x57GNBJVvkCjVR6eaPBuxyHlFkEEjzQ,6252
68
+ plopp/widgets/drawing.py,sha256=pfbMtG078LPkZc5M_UGdo0kusIKFdLNlhihpO9z0Hv0,6582
69
69
  plopp/widgets/linesave.py,sha256=s5QcY-31x7Hvf9iLHmzfFIzodXTD9BX0Av3NlG8GS88,2458
70
70
  plopp/widgets/slice.py,sha256=rWBxvNru7m9PDWSjUUb-WGPCTDfOcNDQBjP88HFEqbc,5474
71
71
  plopp/widgets/style.py,sha256=Fw4S8te0xDyT8-kWu4Ut35aLgyr98qMlWZRbXbd1-dk,184
72
72
  plopp/widgets/toolbar.py,sha256=GH4KKsPGBnNl-bllGD8gF__PgmKpr_QS7zL81GYXUWE,4697
73
73
  plopp/widgets/tools.py,sha256=9l7LmB8qG0OTt5ZJihJzqRna1ouxJthO_Ahnq7WKTtY,7172
74
- plopp-25.10.0.dist-info/licenses/LICENSE,sha256=fCqnkzCwkGneGtgOidkO2b3ed6SGZT0yhuworuJG0K0,1553
75
- plopp-25.10.0.dist-info/METADATA,sha256=FS_IwuAl8hOO2FAvEIMXpFhKYls7PgRX98XA8cnjT30,2850
76
- plopp-25.10.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
- plopp-25.10.0.dist-info/top_level.txt,sha256=Lk_GLFh37eX-3PO3c6bPkDpir7GjJmbQHYza3IpIphc,6
78
- plopp-25.10.0.dist-info/RECORD,,
74
+ plopp-25.11.0.dist-info/licenses/LICENSE,sha256=fCqnkzCwkGneGtgOidkO2b3ed6SGZT0yhuworuJG0K0,1553
75
+ plopp-25.11.0.dist-info/METADATA,sha256=tihTwwjYfb-A1gFpWVUiWjRxeR7iE2eL8dd98N3FLFI,2894
76
+ plopp-25.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
+ plopp-25.11.0.dist-info/top_level.txt,sha256=Lk_GLFh37eX-3PO3c6bPkDpir7GjJmbQHYza3IpIphc,6
78
+ plopp-25.11.0.dist-info/RECORD,,