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.
- {processview-1.4.2 → processview-1.4.4}/PKG-INFO +1 -1
- {processview-1.4.2 → processview-1.4.4}/processview/core/manager/manager.py +22 -41
- {processview-1.4.2 → processview-1.4.4}/processview/gui/DropDownWidget.py +3 -0
- {processview-1.4.2 → processview-1.4.4}/processview/gui/processmanager.py +6 -35
- {processview-1.4.2 → processview-1.4.4}/processview/gui/test/test_process_manager.py +1 -1
- {processview-1.4.2 → processview-1.4.4}/processview/version.py +1 -1
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/PKG-INFO +1 -1
- {processview-1.4.2 → processview-1.4.4}/LICENSE +0 -0
- {processview-1.4.2 → processview-1.4.4}/README.md +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/dataset.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/helpers.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/manager/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/manager/test/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/manager/test/test_manager.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/setup.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/sorting.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/superviseprocess.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/core/test/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/gui/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/gui/icons.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/gui/messagebox.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/gui/test/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/resources/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/advancement.png +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/advancement.svg +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.png +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.svg +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/test/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/utils/__init__.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview/utils/singleton.py +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/SOURCES.txt +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/dependency_links.txt +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/requires.txt +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/top_level.txt +0 -0
- {processview-1.4.2 → processview-1.4.4}/processview.egg-info/zip-safe +0 -0
- {processview-1.4.2 → processview-1.4.4}/setup.cfg +0 -0
- {processview-1.4.2 → processview-1.4.4}/setup.py +0 -0
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
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(
|
|
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:
|
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
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.
|
|
87
|
-
self.dataset_menu.addAction(self.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.png
RENAMED
|
File without changes
|
{processview-1.4.2 → processview-1.4.4}/processview/resources/gui/icons/magnifying_glass.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|