tomwer 0.7.1__tar.gz → 0.7.2__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 (50) hide show
  1. home/payno/.local/share/virtualenvs/tomwer_venv/bin/tomwer +3 -3
  2. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +42 -0
  3. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/orangecontrib/tomwer/widgets/edit/__pycache__/DarkFlatPatchOW.cpython-37.pyc +0 -0
  4. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/orangecontrib/tomwer/widgets/reconstruction/__pycache__/AxisOW.cpython-37.pyc +0 -0
  5. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/orangecontrib/tomwer/widgets/reconstruction/__pycache__/SAAxisOW.cpython-37.pyc +0 -0
  6. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/__pycache__/__main__.cpython-37.pyc +0 -0
  7. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/__pycache__/version.cpython-37.pyc +0 -0
  8. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/app/__pycache__/axis.cpython-37.pyc +0 -0
  9. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/app/__pycache__/saaxis.cpython-37.pyc +0 -0
  10. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/control/__pycache__/datatransfert.cpython-37.pyc +0 -0
  11. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/axis/__pycache__/axis.cpython-37.pyc +0 -0
  12. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/axis/__pycache__/params.cpython-37.pyc +0 -0
  13. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/nabu/__pycache__/nabuslices.cpython-37.pyc +0 -0
  14. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/nabu/__pycache__/nabuvolume.cpython-37.pyc +0 -0
  15. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/nabu/__pycache__/utils.cpython-37.pyc +0 -0
  16. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/pyhst/__pycache__/pyhstcaller.cpython-37.pyc +0 -0
  17. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/saaxis/__pycache__/params.cpython-37.pyc +0 -0
  18. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/reconstruction/saaxis/__pycache__/saaxis.cpython-37.pyc +0 -0
  19. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/process/test/__pycache__/test_axis.cpython-37.pyc +0 -0
  20. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/scan/__pycache__/hdf5scan.cpython-37.pyc +0 -0
  21. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/core/scan/__pycache__/scanbase.cpython-37.pyc +0 -0
  22. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/edit/__pycache__/dkrfpatch.cpython-37.pyc +0 -0
  23. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/edit/dkrfpatch.py +54 -3
  24. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/axis/__pycache__/axis.cpython-37.pyc +0 -0
  25. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/axis/__pycache__/radioaxis.cpython-37.pyc +0 -0
  26. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/nabu/__pycache__/slices.cpython-37.pyc +0 -0
  27. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/nabu/__pycache__/volume.cpython-37.pyc +0 -0
  28. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/nabu/nabuconfig/__pycache__/base.cpython-37.pyc +0 -0
  29. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/nabu/nabuconfig/__pycache__/nabuconfig.cpython-37.pyc +0 -0
  30. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/nabu/nabuconfig/__pycache__/reconstruction.cpython-37.pyc +0 -0
  31. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/saaxis/__pycache__/saaxis.cpython-37.pyc +0 -0
  32. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/saaxis/__pycache__/scoreplot.cpython-37.pyc +0 -0
  33. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/saaxis/__pycache__/sliceselector.cpython-37.pyc +0 -0
  34. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/reconstruction/test/__pycache__/test_saaxis.cpython-37.pyc +0 -0
  35. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/test/__pycache__/test_scanselector.cpython-37.pyc +0 -0
  36. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/utils/__pycache__/buttons.cpython-37.pyc +0 -0
  37. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/gui/utils/__pycache__/scrollarea.cpython-37.pyc +0 -0
  38. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/synctools/stacks/edit/__pycache__/darkflatpatch.cpython-37.pyc +0 -0
  39. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/synctools/stacks/edit/darkflatpatch.py +1 -1
  40. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/synctools/stacks/reconstruction/__pycache__/axis.cpython-37.pyc +0 -0
  41. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/tomwer/version.py +1 -1
  42. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/PKG-INFO +1 -1
  43. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7-nspkg.pth → tomwer-0.7.2-py3.7-nspkg.pth} +0 -0
  44. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/SOURCES.txt +0 -0
  45. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/dependency_links.txt +0 -0
  46. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/entry_points.txt +0 -0
  47. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/namespace_packages.txt +0 -0
  48. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/not-zip-safe +0 -0
  49. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/requires.txt +0 -0
  50. /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{tomwer-0.7.1-py3.7.egg-info → tomwer-0.7.2-py3.7.egg-info}/top_level.txt +0 -0
@@ -1,10 +1,10 @@
1
1
  #!/home/payno/.local/share/virtualenvs/tomwer_venv/bin/python
2
- # EASY-INSTALL-ENTRY-SCRIPT: 'tomwer==0.7.1','console_scripts','tomwer'
2
+ # EASY-INSTALL-ENTRY-SCRIPT: 'tomwer==0.7.2','console_scripts','tomwer'
3
3
  import re
4
4
  import sys
5
5
 
6
6
  # for compatibility with easy_install; see #2198
7
- __requires__ = 'tomwer==0.7.1'
7
+ __requires__ = 'tomwer==0.7.2'
8
8
 
9
9
  try:
10
10
  from importlib.metadata import distribution
@@ -30,4 +30,4 @@ globals().setdefault('load_entry_point', importlib_load_entry_point)
30
30
 
31
31
  if __name__ == '__main__':
32
32
  sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
33
- sys.exit(load_entry_point('tomwer==0.7.1', 'console_scripts', 'tomwer')())
33
+ sys.exit(load_entry_point('tomwer==0.7.2', 'console_scripts', 'tomwer')())
@@ -29,12 +29,14 @@ __license__ = "MIT"
29
29
  __date__ = "02/11/2020"
30
30
 
31
31
 
32
+ from silx.io.url import DataUrl
32
33
  from Orange.widgets.widget import Input, Output
33
34
  from Orange.widgets import widget, gui
34
35
  from tomwer.gui.edit.dkrfpatch import DarkRefPatchWidget
35
36
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
36
37
  from tomwer.core.scan.scanbase import TomwerScanBase
37
38
  from tomwer.synctools.stacks.edit.darkflatpatch import DarkFlatPatchProcessStack
39
+ from Orange.widgets.settings import Setting
38
40
  from ...orange.managedprocess import SuperviseOW
39
41
  from ..utils import WidgetLongProcessing
40
42
  from tomwer.utils import docstring
@@ -71,6 +73,8 @@ class DarkFlatPatchOW(WidgetLongProcessing, SuperviseOW):
71
73
  resizing_enabled = True
72
74
  compress_signal = False
73
75
 
76
+ _urlsSetting = Setting(dict())
77
+
74
78
  class Inputs:
75
79
  data_in = Input(name="data", type=TomwerScanBase)
76
80
 
@@ -88,9 +92,12 @@ class DarkFlatPatchOW(WidgetLongProcessing, SuperviseOW):
88
92
  self.widget = DarkRefPatchWidget(parent=self)
89
93
  layout.addWidget(self.widget)
90
94
 
95
+ self.setConfiguration(self._urlsSetting)
96
+
91
97
  # connect signal / slot
92
98
  self._processingStack.sigComputationStarted.connect(self._startProcessing)
93
99
  self._processingStack.sigComputationEnded.connect(self._endProcessing)
100
+ self.widget.sigConfigurationChanged.connect(self._updateSettings)
94
101
 
95
102
  @Inputs.data_in
96
103
  def process(self, scan):
@@ -113,7 +120,42 @@ class DarkFlatPatchOW(WidgetLongProcessing, SuperviseOW):
113
120
  "flats_end": self.widget.getEndFlatUrl(),
114
121
  }
115
122
 
123
+ def setConfiguration(self, config):
124
+ url_keys = ("darks_start", "flats_start", "darks_end", "flats_end")
125
+ url_index_keys = (
126
+ "darks_start_index",
127
+ "flats_start_index",
128
+ "darks_end_index",
129
+ "flats_end_index",
130
+ )
131
+ setters = (
132
+ self.widget.setStartDarkUrl,
133
+ self.widget.setStartFlatUrl,
134
+ self.widget.setEndDarkUrl,
135
+ self.widget.setEndFlatUrl,
136
+ )
137
+ for url_key, url_idx_key, setter in zip(url_keys, url_index_keys, setters):
138
+ if url_key in config:
139
+ index = config.get(url_idx_key, 0)
140
+ url = config[url_key]
141
+ if url not in (None, ""):
142
+ try:
143
+ setter(url=url, serie_index=index)
144
+ except Exception as e:
145
+ _logger.error(e)
146
+
116
147
  def _endProcessing(self, scan):
117
148
  WidgetLongProcessing._endProcessing(self, scan)
118
149
  if scan is not None:
119
150
  self.Outputs.data_out.send(scan)
151
+
152
+ def _updateSettings(self):
153
+ self._urlsSetting = self.getConfiguration()
154
+ self._urlsSetting.update(
155
+ {
156
+ "darks_start_index": self.widget.getStartDarkIndex(),
157
+ "flats_start_index": self.widget.getStartFlatIndex(),
158
+ "darks_end_index": self.widget.getEndDarkIndex(),
159
+ "flats_end_index": self.widget.getEndFlatIndex(),
160
+ }
161
+ )
@@ -36,6 +36,7 @@ from silx.io.url import DataUrl
36
36
  from tomoscan.io import HDF5File
37
37
  from tomwer.core.scan.hdf5scan import HDF5TomoScan
38
38
  from silx.gui.dialog.DataFileDialog import DataFileDialog
39
+ from tomwer.io.utils import get_default_directory
39
40
 
40
41
  from typing import Union
41
42
  import logging
@@ -44,6 +45,10 @@ _logger = logging.getLogger(__name__)
44
45
 
45
46
 
46
47
  class _DarkOrFlatUrl(qt.QWidget):
48
+
49
+ editingFinished = qt.Signal()
50
+ """Signal emit when the url changes"""
51
+
47
52
  def __init__(self, parent, type_: ImageKey, when: str):
48
53
  assert when in ("start", "end")
49
54
  qt.QWidget.__init__(self, parent)
@@ -60,6 +65,11 @@ class _DarkOrFlatUrl(qt.QWidget):
60
65
 
61
66
  # connect signal / slot
62
67
  self._qle.editingFinished.connect(self._tryUpdateOptions)
68
+ self._qle.editingFinished.connect(self._editingFinished)
69
+ self._optionsCB.currentIndexChanged.connect(self._editingFinished)
70
+
71
+ def _editingFinished(self):
72
+ self.editingFinished.emit()
63
73
 
64
74
  def setUrl(self, url):
65
75
  """
@@ -86,9 +96,11 @@ class _DarkOrFlatUrl(qt.QWidget):
86
96
  msg.setText(text)
87
97
  msg.exec_()
88
98
  return
89
-
99
+ old = self.blockSignals(True)
90
100
  self._qle.setText(url.path())
91
101
  self._updateOptions(url)
102
+ self.blockSignals(old)
103
+ self._editingFinished()
92
104
 
93
105
  def setSerie(self, serie):
94
106
  type_name = self._type.name.lower().replace("_", " ")
@@ -97,6 +109,9 @@ class _DarkOrFlatUrl(qt.QWidget):
97
109
  if idx >= 0:
98
110
  self._optionsCB.setCurrentIndex(idx)
99
111
 
112
+ def getSerieIndex(self):
113
+ return self._optionsCB.currentIndex()
114
+
100
115
  def _redirectDataPath(self, url, logger=None):
101
116
  try:
102
117
  with HDF5File(url.file_path(), mode="r") as h5s:
@@ -225,10 +240,13 @@ class _DarkOrFlatUrl(qt.QWidget):
225
240
  serie_index=serie_index,
226
241
  )
227
242
  data_path = url_no_slices.data_path()
243
+ url_slices = slices
244
+ if url_slices is not None:
245
+ url_slices = list(range(slices.start, slices.stop))
228
246
  url = DataUrl(
229
247
  file_path=url_no_slices.file_path(),
230
248
  data_path=data_path,
231
- data_slice=list(range(slices.start, slices.stop)),
249
+ data_slice=url_slices,
232
250
  scheme="silx",
233
251
  )
234
252
  except Exception as e:
@@ -243,6 +261,9 @@ class DarkRefPatchWidget(qt.QWidget):
243
261
  Widget to add dark and flat
244
262
  """
245
263
 
264
+ sigConfigurationChanged = qt.Signal()
265
+ """Signal emit when the configuration changed (url update)"""
266
+
246
267
  def __init__(self, parent):
247
268
  qt.QWidget.__init__(self, parent)
248
269
  self.setLayout(qt.QGridLayout())
@@ -305,6 +326,19 @@ class DarkRefPatchWidget(qt.QWidget):
305
326
  self._edCB.toggled.connect(self._toggleED)
306
327
  self._efCB.toggled.connect(self._toggleEF)
307
328
 
329
+ # connect QLE modifications
330
+ self._sdQLE.editingFinished.connect(self._configurationChanged)
331
+ self._sdCB.toggled.connect(self._configurationChanged)
332
+ self._sfQLE.editingFinished.connect(self._configurationChanged)
333
+ self._sfCB.toggled.connect(self._configurationChanged)
334
+ self._efQLE.editingFinished.connect(self._configurationChanged)
335
+ self._efCB.toggled.connect(self._configurationChanged)
336
+ self._edQLE.editingFinished.connect(self._configurationChanged)
337
+ self._edCB.toggled.connect(self._configurationChanged)
338
+
339
+ def _configurationChanged(self):
340
+ self.sigConfigurationChanged.emit()
341
+
308
342
  def _selectSDDataset(self):
309
343
  self._selectDataset("start dark", self._sdQLE)
310
344
 
@@ -337,15 +371,20 @@ class DarkRefPatchWidget(qt.QWidget):
337
371
  # we can select a dataset or an entry. If this is an entry then we
338
372
  # will copy the target dark / flat...
339
373
  # ou ajouter un from: to
374
+ assert isinstance(outputQLE, _DarkOrFlatUrl)
340
375
  dialog = DataFileDialog()
341
376
  dialog.setWindowTitle(what)
377
+ dialog.setDirectory(get_default_directory())
378
+
342
379
  if dialog.exec_() and dialog.selectedDataUrl() is not None:
343
380
  old = outputQLE.blockSignals(True)
381
+ url = dialog.selectedDataUrl()
344
382
  try:
345
- outputQLE.setUrl(dialog.selectedDataUrl())
383
+ outputQLE.setUrl(url)
346
384
  except Exception as e:
347
385
  _logger.error(e)
348
386
  outputQLE.blockSignals(old)
387
+ outputQLE.editingFinished.emit()
349
388
 
350
389
  def getStartDarkUrl(self) -> Union[None, DataUrl]:
351
390
  """
@@ -358,6 +397,9 @@ class DarkRefPatchWidget(qt.QWidget):
358
397
  else:
359
398
  return None
360
399
 
400
+ def getStartDarkIndex(self):
401
+ return self._sdQLE.getSerieIndex()
402
+
361
403
  def setStartDarkUrl(self, url, serie_index=None) -> None:
362
404
  """
363
405
 
@@ -380,6 +422,9 @@ class DarkRefPatchWidget(qt.QWidget):
380
422
  else:
381
423
  return None
382
424
 
425
+ def getStartFlatIndex(self):
426
+ return self._sfQLE.getSerieIndex()
427
+
383
428
  def setStartFlatUrl(self, url, serie_index=None) -> None:
384
429
  """
385
430
 
@@ -402,6 +447,9 @@ class DarkRefPatchWidget(qt.QWidget):
402
447
  else:
403
448
  return None
404
449
 
450
+ def getEndDarkIndex(self):
451
+ return self._edQLE.getSerieIndex()
452
+
405
453
  def setEndDarkUrl(self, url, serie_index=None) -> None:
406
454
  """
407
455
 
@@ -424,6 +472,9 @@ class DarkRefPatchWidget(qt.QWidget):
424
472
  else:
425
473
  return None
426
474
 
475
+ def getEndFlatIndex(self):
476
+ return self._efQLE.getSerieIndex()
477
+
427
478
  def setEndFlatUrl(self, url, serie_index=None) -> None:
428
479
  """
429
480
 
@@ -72,7 +72,7 @@ class DarkFlatPatchProcessStack(FIFO, qt.QObject):
72
72
  self._computationThread.init(scan=scan, configuration=configuration)
73
73
  # need to manage connect before starting it because
74
74
  ProcessManager().notify_dataset_state(
75
- dataset=self._scan,
75
+ dataset=self._scan_currently_computed,
76
76
  process=self,
77
77
  state=DatasetState.ON_GOING,
78
78
  details=None,
@@ -77,7 +77,7 @@ RELEASE_LEVEL_VALUE = {
77
77
 
78
78
  MAJOR = 0
79
79
  MINOR = 7
80
- MICRO = 1
80
+ MICRO = 2
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: tomwer
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Library for tomography workflow
5
5
  Home-page: https://gitlab.esrf.fr/tomotools/tomwer
6
6
  Author: data analysis unit