processview 1.4.2__tar.gz → 1.4.4__tar.gz

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.
Files changed (39) hide show
  1. {processview-1.4.2 → processview-1.4.4}/PKG-INFO +1 -1
  2. {processview-1.4.2 → processview-1.4.4}/processview/core/manager/manager.py +22 -41
  3. {processview-1.4.2 → processview-1.4.4}/processview/gui/DropDownWidget.py +3 -0
  4. {processview-1.4.2 → processview-1.4.4}/processview/gui/processmanager.py +6 -35
  5. {processview-1.4.2 → processview-1.4.4}/processview/gui/test/test_process_manager.py +1 -1
  6. {processview-1.4.2 → processview-1.4.4}/processview/version.py +1 -1
  7. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/PKG-INFO +1 -1
  8. {processview-1.4.2 → processview-1.4.4}/LICENSE +0 -0
  9. {processview-1.4.2 → processview-1.4.4}/README.md +0 -0
  10. {processview-1.4.2 → processview-1.4.4}/processview/__init__.py +0 -0
  11. {processview-1.4.2 → processview-1.4.4}/processview/core/__init__.py +0 -0
  12. {processview-1.4.2 → processview-1.4.4}/processview/core/dataset.py +0 -0
  13. {processview-1.4.2 → processview-1.4.4}/processview/core/helpers.py +0 -0
  14. {processview-1.4.2 → processview-1.4.4}/processview/core/manager/__init__.py +0 -0
  15. {processview-1.4.2 → processview-1.4.4}/processview/core/manager/test/__init__.py +0 -0
  16. {processview-1.4.2 → processview-1.4.4}/processview/core/manager/test/test_manager.py +0 -0
  17. {processview-1.4.2 → processview-1.4.4}/processview/core/setup.py +0 -0
  18. {processview-1.4.2 → processview-1.4.4}/processview/core/sorting.py +0 -0
  19. {processview-1.4.2 → processview-1.4.4}/processview/core/superviseprocess.py +0 -0
  20. {processview-1.4.2 → processview-1.4.4}/processview/core/test/__init__.py +0 -0
  21. {processview-1.4.2 → processview-1.4.4}/processview/gui/__init__.py +0 -0
  22. {processview-1.4.2 → processview-1.4.4}/processview/gui/icons.py +0 -0
  23. {processview-1.4.2 → processview-1.4.4}/processview/gui/messagebox.py +0 -0
  24. {processview-1.4.2 → processview-1.4.4}/processview/gui/test/__init__.py +0 -0
  25. {processview-1.4.2 → processview-1.4.4}/processview/resources/__init__.py +0 -0
  26. {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/advancement.png +0 -0
  27. {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/advancement.svg +0 -0
  28. {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.png +0 -0
  29. {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.svg +0 -0
  30. {processview-1.4.2 → processview-1.4.4}/processview/test/__init__.py +0 -0
  31. {processview-1.4.2 → processview-1.4.4}/processview/utils/__init__.py +0 -0
  32. {processview-1.4.2 → processview-1.4.4}/processview/utils/singleton.py +0 -0
  33. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/SOURCES.txt +0 -0
  34. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/dependency_links.txt +0 -0
  35. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/requires.txt +0 -0
  36. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/top_level.txt +0 -0
  37. {processview-1.4.2 → processview-1.4.4}/processview.egg-info/zip-safe +0 -0
  38. {processview-1.4.2 → processview-1.4.4}/setup.cfg +0 -0
  39. {processview-1.4.2 → processview-1.4.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: processview
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Simple helper to provide user feedback about dataset processing
5
5
  Author: data analysis unit
6
6
  Author-email: henri.payno@esrf.fr
@@ -1,32 +1,4 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "03/11/2020"
29
-
1
+ from __future__ import annotations
30
2
 
31
3
  from processview.utils.singleton import singleton
32
4
  from processview.core.dataset import Dataset
@@ -62,7 +34,7 @@ class ProcessManager:
62
34
 
63
35
  def __init__(self):
64
36
  self._processes = {}
65
- self._dataset_process_states = {}
37
+ self._dataset_process_states: dict[int, dict[str, tuple]] = {}
66
38
  """key is processID, Value is a tuple of
67
39
  (dataset state, details)"""
68
40
  self._processID = 0
@@ -154,7 +126,6 @@ class ProcessManager:
154
126
  """
155
127
 
156
128
  :return: tuple of processes currently registered
157
- :rtype: tuple
158
129
  """
159
130
  processes = []
160
131
  for _, p in self._processes.items():
@@ -182,10 +153,15 @@ class ProcessManager:
182
153
  """
183
154
  dataset_id = self._find_dataset_id(dataset)
184
155
  for process_id in self._dataset_process_states:
185
- if dataset_id in self._dataset_process_states[process_id]:
186
- self._dataset_process_states[process_id].pop(dataset_id)
187
-
188
- def notify_dataset_state(self, dataset, process, state, details=None) -> None:
156
+ self._dataset_process_states[process_id].pop(dataset_id, None)
157
+
158
+ def notify_dataset_state(
159
+ self,
160
+ dataset: Dataset | DatasetIdentifier,
161
+ process,
162
+ state: DatasetState,
163
+ details=None,
164
+ ) -> None:
189
165
  """
190
166
  Update dataset state
191
167
 
@@ -209,7 +185,14 @@ class ProcessManager:
209
185
  self._dataset_process_states[process.process_id] = OrderedDict()
210
186
  if details is None:
211
187
  details = ""
212
- dataset_id = dataset.get_identifier()
188
+ if isinstance(dataset, Dataset):
189
+ dataset_id = dataset.get_identifier()
190
+ else:
191
+ dataset_id = dataset
192
+ if not isinstance(dataset_id, DatasetIdentifier):
193
+ raise TypeError(
194
+ f"dataset should be an instance of {Dataset} or {DatasetIdentifier}. Got {type(dataset)}"
195
+ )
213
196
  # as we store the identifier and not a string anymore we might need to remove another instanciation
214
197
  process_states = self._dataset_process_states[process.process_id]
215
198
  to_remove = set()
@@ -253,7 +236,6 @@ class ProcessManager:
253
236
  :param Dataset dataset_id:
254
237
  :param BaseProcess process:
255
238
  :return: DatasetState relative to provided process if know
256
- :rtype: Union[None, DatasetState]
257
239
  """
258
240
  dataset_id = self._find_dataset_id(dataset_id)
259
241
  process = self._find_process(process)
@@ -273,7 +255,6 @@ class ProcessManager:
273
255
  :param Dataset dataset_id:
274
256
  :param BaseProcess process:
275
257
  :return: DatasetState relative to provided process if know
276
- :rtype: Union[None, DatasetState]
277
258
  """
278
259
  dataset_id = self._find_dataset_id(dataset_id)
279
260
  process = self._find_process(process)
@@ -287,14 +268,15 @@ class ProcessManager:
287
268
  return self._dataset_process_states[process.process_id][dataset_id][1]
288
269
  return None
289
270
 
290
- def get_dataset_stream(self, dataset, time_stamp=False) -> tuple:
271
+ def get_dataset_stream(
272
+ self, dataset, time_stamp=False
273
+ ) -> tuple[int, DatasetState, list]:
291
274
  """
292
275
 
293
276
  :param Dataset dataset: dataset the stream is focus on
294
277
  :param bool time_stamp: if True then return timestamp in the list of
295
278
  elements
296
279
  :return: stream of (process ID, DatasetState) for a given dataset
297
- :rtype: tuple of (process ID, DatasetState, [timestamp])
298
280
  """
299
281
  stream = []
300
282
  for process_id, dataset_states in self._dataset_process_states.items():
@@ -316,7 +298,6 @@ class ProcessManager:
316
298
  :param bool time_stamp: if True then return timestamp in the list of
317
299
  elements
318
300
  :return: tuple of (DatasetIdentifier, state, [timestamp])
319
- :rtype: tuple
320
301
  """
321
302
  history = []
322
303
  if process.process_id in self._dataset_process_states:
@@ -55,3 +55,6 @@ class DropDownWidget(qt.QWidget):
55
55
  def _toggleVisibility(self, visible):
56
56
  self._setButtonIcon(show=visible)
57
57
  self._mainWidget.setVisible(visible)
58
+
59
+ def setChecked(self, checked: bool):
60
+ self._toggleButton.setChecked(checked)
@@ -1,33 +1,4 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
-
27
- __authors__ = ["H. Payno"]
28
- __license__ = "MIT"
29
- __date__ = "03/11/2020"
30
-
1
+ from __future__ import annotations
31
2
 
32
3
  import fnmatch
33
4
  from collections import OrderedDict
@@ -83,8 +54,8 @@ class ObservationTable(qt.QTableView):
83
54
  self.dataset_menu = qt.QMenu()
84
55
  self._copyAction = qt.QAction("copy")
85
56
  self.dataset_menu.addAction(self._copyAction)
86
- self._clearAction = qt.QAction("clear")
87
- self.dataset_menu.addAction(self._clearAction)
57
+ self._removeAction = qt.QAction("remove")
58
+ self.dataset_menu.addAction(self._removeAction)
88
59
 
89
60
  # QMenu for cell from on dataset and one process
90
61
  self.menu_dataset_vs_process = qt.QMenu()
@@ -94,14 +65,14 @@ class ObservationTable(qt.QTableView):
94
65
  self.menu_dataset_vs_process.addAction(self._cancelAction)
95
66
  self._infoAction = qt.QAction("info")
96
67
  self.menu_dataset_vs_process.addAction(self._infoAction)
97
- self.menu_dataset_vs_process.addAction(self._clearAction)
68
+ self.menu_dataset_vs_process.addAction(self._removeAction)
98
69
 
99
70
  self._target = (None, None)
100
71
  # register target of the last menu (process, DatasetIdentifier)
101
72
 
102
73
  # connect signal / slot
103
74
  self._copyAction.triggered.connect(self._requestDatasetIdCopy)
104
- self._clearAction.triggered.connect(self._requestClearDataset)
75
+ self._removeAction.triggered.connect(self._requestRemoveDataset)
105
76
  self._reprocessAction.triggered.connect(self._requestReprocessing)
106
77
  self._infoAction.triggered.connect(self._requestInfo)
107
78
  self._cancelAction.triggered.connect(self._requestCancelProcessing)
@@ -163,7 +134,7 @@ class ObservationTable(qt.QTableView):
163
134
  clipboard = qt.QGuiApplication.clipboard()
164
135
  clipboard.setText(dataset.to_str())
165
136
 
166
- def _requestClearDataset(self, *args, **kwargs):
137
+ def _requestRemoveDataset(self, *args, **kwargs):
167
138
  def get_dataset_at(row: int):
168
139
  datasets = self.model()._sorted_datasets
169
140
  return datasets.get(
@@ -92,7 +92,7 @@ class TestProcessManager(TestCaseQt):
92
92
  )
93
93
 
94
94
  window._centralWidget.observationTable.selectAll()
95
- window._centralWidget.observationTable._requestClearDataset()
95
+ window._centralWidget.observationTable._requestRemoveDataset()
96
96
  self.qapp.processEvents()
97
97
  assert len(manager.manager._dataset_process_states[p1.process_id]) == 0
98
98
  manager.notify_dataset_state(
@@ -77,7 +77,7 @@ RELEASE_LEVEL_VALUE = {
77
77
 
78
78
  MAJOR = 1
79
79
  MINOR = 4
80
- MICRO = 2
80
+ MICRO = 4
81
81
  RELEV = "final" # <16
82
82
  SERIAL = 0 # <16
83
83
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: processview
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Simple helper to provide user feedback about dataset processing
5
5
  Author: data analysis unit
6
6
  Author-email: henri.payno@esrf.fr
File without changes
File without changes
File without changes
File without changes