tomwer 1.0.3__py3-none-any.whl → 1.1.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.
Files changed (269) hide show
  1. orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
  2. orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
  3. orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
  4. orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
  5. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
  6. orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
  7. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
  9. orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
  10. orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
  11. orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
  12. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
  13. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +3 -5
  14. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
  15. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
  16. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
  17. orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
  18. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
  19. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -129
  20. orangecontrib/tomwer/widgets/control/NotifierOW.py +34 -9
  21. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +19 -13
  23. orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
  24. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
  25. orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
  26. orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
  27. orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
  28. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
  29. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +73 -78
  30. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
  31. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
  32. orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
  33. orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
  34. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
  35. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
  36. orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
  37. orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
  38. orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
  39. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
  40. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -11
  41. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
  42. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
  43. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
  44. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
  45. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
  46. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -20
  47. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -18
  48. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
  49. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
  50. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
  51. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
  52. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
  53. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  54. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
  55. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
  56. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
  57. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
  58. tomwer/__main__.py +10 -5
  59. tomwer/app/canvas_launcher/config.py +10 -10
  60. tomwer/app/canvas_launcher/mainwindow.py +68 -6
  61. tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
  62. tomwer/app/darkref.py +16 -12
  63. tomwer/app/imagekeyeditor.py +2 -2
  64. tomwer/app/imagekeyupgrader.py +104 -0
  65. tomwer/app/intensitynormalization.py +0 -1
  66. tomwer/app/nxtomoeditor.py +103 -0
  67. tomwer/app/rsync.py +1 -1
  68. tomwer/core/cluster/cluster.py +1 -1
  69. tomwer/core/futureobject.py +1 -0
  70. tomwer/core/process/control/datalistener/datalistener.py +7 -1
  71. tomwer/core/process/control/datalistener/rpcserver.py +3 -4
  72. tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
  73. tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
  74. tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
  75. tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
  76. tomwer/core/process/control/nxtomomill.py +33 -58
  77. tomwer/core/process/control/scanlist.py +2 -1
  78. tomwer/core/process/control/scanselector.py +7 -0
  79. tomwer/core/process/control/scantransfer.py +2 -2
  80. tomwer/core/process/control/scanvalidator.py +6 -5
  81. tomwer/core/process/control/singletomoobj.py +2 -1
  82. tomwer/core/process/control/timer.py +2 -1
  83. tomwer/core/process/control/tomoobjserie.py +8 -2
  84. tomwer/core/process/control/volumeselector.py +2 -1
  85. tomwer/core/process/control/volumesymlink.py +2 -1
  86. tomwer/core/process/edit/darkflatpatch.py +2 -1
  87. tomwer/core/process/edit/imagekeyeditor.py +4 -3
  88. tomwer/core/process/reconstruction/axis/axis.py +29 -32
  89. tomwer/core/process/reconstruction/axis/mode.py +3 -2
  90. tomwer/core/process/reconstruction/axis/params.py +35 -16
  91. tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
  92. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
  93. tomwer/core/process/reconstruction/darkref/params.py +62 -67
  94. tomwer/core/process/reconstruction/lamino/tofu.py +1 -2
  95. tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
  96. tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
  97. tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
  98. tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
  99. tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
  100. tomwer/core/process/reconstruction/nabu/utils.py +32 -3
  101. tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
  102. tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
  103. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
  104. tomwer/core/process/reconstruction/test/__init__.py +0 -39
  105. tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
  106. tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
  107. tomwer/core/process/script/python.py +16 -12
  108. tomwer/core/process/task.py +3 -7
  109. tomwer/core/process/test/test_axis.py +1 -1
  110. tomwer/core/process/test/test_dark_and_flat.py +41 -111
  111. tomwer/core/process/test/test_data_listener.py +0 -29
  112. tomwer/core/process/test/test_data_transfer.py +10 -14
  113. tomwer/core/process/test/test_nabu.py +1 -1
  114. tomwer/core/process/test/test_normalization.py +1 -1
  115. tomwer/core/process/visualization/liveslice.py +6 -0
  116. tomwer/core/scan/blissscan.py +37 -2
  117. tomwer/core/scan/edfscan.py +19 -8
  118. tomwer/core/scan/hdf5scan.py +10 -4
  119. tomwer/core/scan/scanbase.py +35 -29
  120. tomwer/core/scan/scanfactory.py +3 -17
  121. tomwer/core/scan/test/test_h5.py +1 -1
  122. tomwer/core/scan/test/test_process_registration.py +0 -11
  123. tomwer/core/scan/test/test_scan.py +32 -30
  124. tomwer/core/settings.py +2 -2
  125. tomwer/core/test/test_utils.py +1 -1
  126. tomwer/core/tomwer_object.py +19 -0
  127. tomwer/core/utils/__init__.py +0 -45
  128. tomwer/core/utils/char.py +2 -0
  129. tomwer/core/utils/gpu.py +5 -5
  130. tomwer/core/utils/nxtomoutils.py +2 -2
  131. tomwer/core/utils/scanutils.py +50 -0
  132. tomwer/core/utils/volumeutils.py +13 -0
  133. tomwer/core/volume/edfvolume.py +4 -0
  134. tomwer/core/volume/hdf5volume.py +4 -0
  135. tomwer/core/volume/jp2kvolume.py +4 -0
  136. tomwer/core/volume/rawvolume.py +22 -5
  137. tomwer/core/volume/tiffvolume.py +4 -0
  138. tomwer/core/volume/volumebase.py +19 -12
  139. tomwer/core/volume/volumefactory.py +20 -1
  140. tomwer/gui/cluster/slurm.py +1 -1
  141. tomwer/gui/cluster/supervisor.py +0 -2
  142. tomwer/gui/cluster/test/test_cluster.py +2 -2
  143. tomwer/gui/control/datalist.py +109 -36
  144. tomwer/gui/control/datatransfert.py +1 -1
  145. tomwer/gui/control/datawatcher/configuration.py +0 -2
  146. tomwer/gui/control/datawatcher/datawatcher.py +23 -13
  147. tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
  148. tomwer/gui/control/observations.py +0 -3
  149. tomwer/gui/control/selectorwidgetbase.py +42 -12
  150. tomwer/gui/control/serie/seriecreator.py +967 -0
  151. tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
  152. tomwer/gui/control/singletomoobj.py +15 -4
  153. tomwer/gui/control/test/test_datalist.py +1 -1
  154. tomwer/gui/control/test/test_datalistener.py +1 -1
  155. tomwer/gui/control/test/test_inputwidget.py +1 -1
  156. tomwer/gui/control/test/test_process_manager.py +1 -13
  157. tomwer/gui/control/test/test_scanselector.py +1 -1
  158. tomwer/gui/control/test/test_scanvalidator.py +1 -1
  159. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  160. tomwer/gui/control/test/test_volume_dialog.py +19 -7
  161. tomwer/gui/control/test/test_volumeselector.py +4 -4
  162. tomwer/gui/debugtools/datasetgenerator.py +1 -9
  163. tomwer/gui/edit/dkrfpatch.py +2 -3
  164. tomwer/gui/edit/imagekeyeditor.py +12 -11
  165. tomwer/gui/edit/nxtomoeditor.py +475 -0
  166. tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
  167. tomwer/gui/edit/test/test_image_key_editor.py +2 -2
  168. tomwer/gui/edit/test/test_nx_editor.py +155 -0
  169. tomwer/gui/icons.py +0 -1
  170. tomwer/gui/qfolderdialog.py +11 -0
  171. tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
  172. tomwer/gui/reconstruction/axis/axis.py +2 -0
  173. tomwer/gui/reconstruction/axis/radioaxis.py +70 -14
  174. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
  175. tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
  176. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  177. tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
  178. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
  179. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -5
  180. tomwer/gui/reconstruction/nabu/castvolume.py +103 -24
  181. tomwer/gui/reconstruction/nabu/check.py +1 -1
  182. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
  183. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
  184. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
  185. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
  186. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
  187. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -15
  188. tomwer/gui/reconstruction/nabu/slices.py +10 -4
  189. tomwer/gui/reconstruction/nabu/slurm.py +1 -1
  190. tomwer/gui/reconstruction/nabu/volume.py +13 -7
  191. tomwer/gui/reconstruction/normalization/intensity.py +1 -5
  192. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -37
  193. tomwer/gui/reconstruction/saaxis/saaxis.py +11 -7
  194. tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
  195. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
  196. tomwer/gui/reconstruction/scores/scoreplot.py +67 -62
  197. tomwer/gui/reconstruction/test/test_axis.py +2 -2
  198. tomwer/gui/reconstruction/test/test_lamino.py +2 -2
  199. tomwer/gui/reconstruction/test/test_nabu.py +14 -1
  200. tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
  201. tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
  202. tomwer/gui/stackplot.py +11 -28
  203. tomwer/gui/test/test_axis_gui.py +4 -4
  204. tomwer/gui/test/test_qfolder_dialog.py +12 -0
  205. tomwer/gui/utils/inputwidget.py +42 -22
  206. tomwer/gui/utils/lineselector/lineselector.py +13 -21
  207. tomwer/gui/utils/scandescription.py +2 -4
  208. tomwer/gui/utils/slider.py +1 -102
  209. tomwer/gui/utils/unitsystem.py +48 -11
  210. tomwer/gui/visualization/dataviewer.py +24 -17
  211. tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
  212. tomwer/gui/visualization/nxtomometadata.py +21 -0
  213. tomwer/gui/visualization/scanoverview.py +0 -1
  214. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
  215. tomwer/gui/visualization/test/test_stacks.py +1 -1
  216. tomwer/gui/visualization/tomoobjoverview.py +49 -0
  217. tomwer/gui/visualization/volumeoverview.py +64 -0
  218. tomwer/gui/visualization/volumeviewer.py +1 -1
  219. tomwer/io/utils/utils.py +2 -2
  220. tomwer/resources/gui/icons/multi-document-save.png +0 -0
  221. tomwer/resources/gui/icons/multi-document-save.svg +101 -0
  222. tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
  223. tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
  224. tomwer/synctools/axis.py +0 -1
  225. tomwer/synctools/darkref.py +0 -1
  226. tomwer/synctools/datalistener.py +5 -1
  227. tomwer/synctools/imageloaderthread.py +2 -2
  228. tomwer/synctools/saaxis.py +0 -1
  229. tomwer/synctools/sadeltabeta.py +0 -1
  230. tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
  231. tomwer/synctools/stacks/processingstack.py +2 -2
  232. tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
  233. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -1
  234. tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
  235. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
  236. tomwer/synctools/test/test_darkRefs.py +32 -149
  237. tomwer/synctools/test/test_foldertransfer.py +1 -1
  238. tomwer/synctools/test/test_scanstages.py +2 -2
  239. tomwer/tests/conftest.py +51 -0
  240. tomwer/{test → tests}/test_scripts.py +1 -1
  241. tomwer/tests/test_utils.py +10 -0
  242. tomwer/{test → tests}/utils/utilstest.py +0 -11
  243. tomwer/version.py +3 -3
  244. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
  245. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/RECORD +255 -235
  246. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
  247. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
  248. orangecontrib/tomwer/setup.py +0 -45
  249. orangecontrib/tomwer/widgets/setup.py +0 -49
  250. tomwer/app/process.py +0 -153
  251. tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
  252. tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
  253. tomwer/core/utils/laminoutils.py +0 -80
  254. tomwer/gui/utils/lineselector/lineselection.py +0 -76
  255. tomwer/setup.py +0 -52
  256. tomwer/slurm/executor.py +0 -36
  257. tomwer/slurm/job.py +0 -349
  258. tomwer/slurm/utils.py +0 -44
  259. tomwer/web/client.py +0 -43
  260. tomwer/web/config.py +0 -36
  261. tomwer/web/test/test_graylog_connection.py +0 -59
  262. {tomwer/slurm → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
  263. /tomwer/{test → gui/control/serie}/__init__.py +0 -0
  264. /tomwer/{web/test → tests}/__init__.py +0 -0
  265. /tomwer/{test → tests}/utils/__init__.py +0 -0
  266. /tomwer-1.0.3-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
  267. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
  268. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
  269. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.36.2)
2
+ Generator: bdist_wheel (0.38.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -7,5 +7,11 @@ html-index = orangecontrib.tomwer.widgets:WIDGET_HELP_PATH
7
7
  [orange.widgets]
8
8
  tomwer = orangecontrib.tomwer.widgets
9
9
 
10
+ [orange.widgets.tutorials]
11
+ FLUO = orangecontrib.tomwer.tutorials
12
+
10
13
  [orange3.addon]
11
14
  tomwer-add-on = orangecontrib.tomwer
15
+
16
+ [orangecanvas.examples]
17
+ FLUO = orangecontrib.tomwer.tutorials
@@ -1,45 +0,0 @@
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__ = "05/07/2017"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("tomwer", parent_package, top_path)
36
- config.add_subpackage("widgets")
37
- config.add_subpackage("test")
38
-
39
- return config
40
-
41
-
42
- if __name__ == "__main__":
43
- from numpy.distutils.core import setup
44
-
45
- setup(configuration=configuration)
@@ -1,49 +0,0 @@
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__ = "05/07/2017"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("widgets", parent_package, top_path)
36
- config.add_subpackage("control")
37
- config.add_subpackage("edit")
38
- config.add_subpackage("other")
39
- config.add_subpackage("reconstruction")
40
- config.add_subpackage("visualization")
41
- config.add_subpackage("test")
42
-
43
- return config
44
-
45
-
46
- if __name__ == "__main__":
47
- from numpy.distutils.core import setup
48
-
49
- setup(configuration=configuration)
tomwer/app/process.py DELETED
@@ -1,153 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- import logging
5
- import sys
6
- import argparse
7
- from ewokscore import load_graph
8
- from ewoksorange.bindings import owsconvert
9
- from tomwer.core.scan.scanfactory import ScanFactory
10
- import tempfile
11
- import os
12
- from pprint import pprint
13
-
14
- logging.basicConfig(level=logging.WARNING)
15
- _logger = logging.getLogger(__name__)
16
-
17
-
18
- def exec_scans(name, ewoks_graph, scans=None, darkref_savedir=None):
19
- """
20
-
21
- :param ewoks_graph:
22
- :param scans: list of scan to execute
23
- :param timeout:
24
- :return:
25
- """
26
-
27
- def launch_():
28
- for scan in scans:
29
- exec_scan(name=name, ewoks_graph=ewoks_graph, scan=scan, save_dir=save_dir)
30
-
31
- if darkref_savedir is not None:
32
- if not os.path.exists(darkref_savedir):
33
- os.makedirs(darkref_savedir)
34
- launch_()
35
- else:
36
- with tempfile.TemporaryDirectory() as save_dir:
37
- launch_()
38
-
39
-
40
- def exec_scan(name, ewoks_graph, scan, save_dir):
41
- # set up workflow
42
- if len(ewoks_graph.start_nodes()) == 0:
43
- _logger.warning("no start nodes found. Enable to process")
44
- return None
45
- mess = f"start processing {name} with {str(scan)}"
46
- _logger.info(mess)
47
-
48
- # update scan parameter to start node
49
- for src_node in ewoks_graph.start_nodes():
50
- # provide the dataset to be used and save_dir
51
- # save_dir is used to provide dark ref with a directory to store
52
- # dark and ref to be copy
53
- ewoks_graph.graph.nodes[src_node]["default_inputs"].add(
54
- {({"name": "data", "value": scan})}
55
- )
56
-
57
- # update node with dark ref
58
- import tomwer.core.process.reconstruction.darkref.darkrefscopy
59
-
60
- qual_name = ".".join(
61
- [
62
- tomwer.core.process.reconstruction.darkref.darkrefscopy.__name__,
63
- tomwer.core.process.reconstruction.darkref.darkrefscopy.DarkRefsCopy.__qualname__,
64
- ]
65
- )
66
- for src_node in ewoks_graph.graph.nodes:
67
- # provide save_dir to 'darkref' class
68
- if ewoks_graph.graph.nodes[src_node]["class"] == qual_name:
69
- ewoks_graph.graph.nodes[src_node]["default_inputs"].add(
70
- {({"name": "save_dir", "value": save_dir})}
71
- )
72
- # insure all arguments are provided for each link because the scan object is hidding some
73
- # parameters
74
- for target_node in ewoks_graph.graph.nodes:
75
- if src_node == target_node:
76
- continue
77
- try:
78
- ewoks_graph.graph[src_node][target_node]["all_arguments"] = True
79
- del ewoks_graph.graph[src_node][target_node]["arguments"]
80
- except KeyError:
81
- pass
82
-
83
- print(f" start execution of graph {name} ".center(80, "#"))
84
- taskgraph = load_graph(ewoks_graph)
85
- pprint(taskgraph.dump())
86
- print(f" end execution of graph {name} ".center(80, "#"))
87
- ewoks_graph.execute()
88
-
89
-
90
- def main(argv):
91
- parser = argparse.ArgumentParser(description=__doc__)
92
- parser.add_argument(
93
- "workflow_file",
94
- help="Path to the .ows file defining the workflow to process with the"
95
- "provided scan",
96
- )
97
- parser.add_argument(
98
- "scan_path",
99
- help="Path to data to be processes (master file if come from an hdf5 "
100
- "acquisition or EDF files folder if come from an EDF acquisition)",
101
- )
102
- parser.add_argument(
103
- "--entry", default=None, help="An entry should be specify for hdf5 files"
104
- )
105
- parser.add_argument(
106
- "--timeout", default=None, help="Timeout for the workflow execution"
107
- )
108
- parser.add_argument(
109
- "--dkref-save-dir",
110
- default=None,
111
- dest="savedir",
112
- help="You can provide a save dir folder for the dark-ref copy task to"
113
- "insure persistency between several call of process.",
114
- )
115
- parser.add_argument(
116
- "--debug",
117
- dest="debug",
118
- action="store_true",
119
- default=False,
120
- help="Set logging system in debug mode",
121
- )
122
- options = parser.parse_args(argv[1:])
123
- if options.entry is not None:
124
- scan = ScanFactory.create_scan_object(
125
- options.scan_path, entry=options.entry, accept_bliss_scan=True
126
- )
127
- scans = (scan,)
128
- else:
129
- scans = ScanFactory.create_scan_objects(
130
- options.scan_path, accept_bliss_scan=True
131
- )
132
- if len(scans) > 1:
133
- _logger.info("More than one scan found. Will process every scans")
134
-
135
- # tune the log level
136
- log_level = logging.INFO
137
- if options.debug is True:
138
- log_level = logging.DEBUG
139
-
140
- for log_ in ("tomwer", "ewoks", "ewoksorange", "ewokscore"):
141
- logging.getLogger(log_).setLevel(log_level)
142
-
143
- scheme = owsconvert.ows_to_ewoks(options.workflow_file)
144
- exec_scans(
145
- name=os.path.basename(options.workflow_file),
146
- ewoks_graph=scheme,
147
- scans=scans,
148
- darkref_savedir=options.savedir,
149
- )
150
-
151
-
152
- if __name__ == "__main__":
153
- main(sys.argv)
@@ -1,36 +0,0 @@
1
- import subprocess
2
- import logging
3
-
4
- _logger = logging.getLogger(__name__)
5
-
6
-
7
- def check_n_gpu():
8
- try:
9
- from pycuda import driver
10
-
11
- driver.init()
12
- n_gpus = driver.Device.count()
13
- except Exception as e:
14
- raise e
15
- else:
16
- if n_gpus == 0:
17
- raise RuntimeError("No gpu detected to run nabu reconstruction")
18
- else:
19
- _logger.info(f"{n_gpus} detected by pycuda")
20
-
21
-
22
- def _exec_nabu_on_slurm(conf_file: str, scan_path: str) -> tuple:
23
- check_n_gpu()
24
-
25
- NABU_FULL_FIELD_APP_PATH = "nabu.app.reconstruct"
26
- # need to be executed in his own context
27
- command = " ".join(("python", "-m", NABU_FULL_FIELD_APP_PATH, conf_file))
28
- process = subprocess.Popen(
29
- command,
30
- shell=True,
31
- cwd=scan_path,
32
- stdout=subprocess.PIPE,
33
- stderr=subprocess.PIPE,
34
- )
35
- res = process.communicate()
36
- return res
@@ -1,10 +0,0 @@
1
- from nabu.pipeline.fullfield.chunked_cuda import CudaChunkedPipeline
2
- from nabu.pipeline.fullfield.processconfig import ProcessConfig
3
-
4
-
5
- def launch_reconstruction(config_file, slice_index):
6
- proc = ProcessConfig(config_file)
7
- worker_process = CudaChunkedPipeline(
8
- proc, sub_region=(None, None, slice_index, slice_index + 1)
9
- )
10
- worker_process.process_chunk()
@@ -1,80 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 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__ = "22/06/2018"
29
-
30
-
31
- import fabio
32
- import os
33
- import logging
34
-
35
- logger = logging.getLogger(__name__)
36
-
37
-
38
- def getMotorInformationFromEDfFile(_file):
39
- """
40
-
41
- :param _file: file to the edf file containing header with information
42
- :return: dictionary with motor name as key and motor position as value
43
- :rtype: dict
44
- """
45
- assert type(_file) is str
46
- assert _file.endswith(".edf")
47
- if not os.path.isfile(_file):
48
- warn = "%s is not a valid file. Cannot retrieve motor information" % _file
49
- logger.warning(warn)
50
- return None
51
- else:
52
- with fabio.open(_file) as dsc:
53
- header = dsc.header
54
-
55
- if "motor_mne" not in header:
56
- logger.warning(
57
- 'key "motor_mne" not found in the file header.'
58
- "Cannot retrieve motor information"
59
- )
60
- return None
61
-
62
- if "motor_pos" not in header:
63
- logger.warning(
64
- 'key "motor_pos" not found in the file header.'
65
- "Cannot retrieve motor information"
66
- )
67
- return None
68
-
69
- motor_mne_lst = header["motor_mne"].split(" ")
70
- motor_pos_lst = header["motor_pos"].split(" ")
71
- if len(motor_mne_lst) != len(motor_pos_lst):
72
- logger.warning(
73
- "Incoherent number of motor_mne and motor_pos."
74
- "Cannot retrieve motor information"
75
- )
76
- return None
77
- res = {}
78
- for mne, pos in zip(motor_mne_lst, motor_pos_lst):
79
- res[mne] = pos
80
- return res
@@ -1,76 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016 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__ = "25/09/2017"
29
-
30
- import re
31
- import numpy
32
-
33
- SELECTION_PATTERN = re.compile(r"\d?[:]?\d?")
34
-
35
-
36
- def selectionIsValid(selection):
37
- """
38
- Return true if the given selection as a string is valid
39
-
40
- :return: bool
41
- """
42
- assert type(selection) is str
43
- _selection = selection.replace(" ", "")
44
- selections = _selection.split(";")
45
- for sel in selections:
46
- if not re.match(SELECTION_PATTERN, sel):
47
- return False
48
- return True
49
-
50
-
51
- def getSelection(projections, selection):
52
- """
53
-
54
- :param str selection:
55
- :return numpy.ndarray:
56
- """
57
-
58
- def evalSelection(projections, sel):
59
- assert type(projections) is numpy.ndarray
60
- return eval("projections[" + sel + "]")
61
-
62
- assert type(selection) is str
63
- if selection == "":
64
- return projections
65
- _selection = selection.replace(" ", "")
66
- selections = _selection.split(";")
67
- if len(selections) == 1:
68
- return evalSelection(projections, selection)
69
- else:
70
- res = None
71
- for iSel, sel in enumerate(range(len(selections))):
72
- if iSel == 0:
73
- res = evalSelection(projections, selections[iSel])
74
- else:
75
- res = numpy.append(res, evalSelection(projections, selections[iSel]))
76
- return res
tomwer/setup.py DELETED
@@ -1,52 +0,0 @@
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__ = "04/01/2018"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("tomwer", parent_package, top_path)
36
- config.add_subpackage("app")
37
- config.add_subpackage("core")
38
- config.add_subpackage("gui")
39
- config.add_subpackage("io")
40
- config.add_subpackage("resources")
41
- config.add_subpackage("synctools")
42
- config.add_subpackage("test")
43
- config.add_subpackage("third_party")
44
- config.add_subpackage("web")
45
-
46
- return config
47
-
48
-
49
- if __name__ == "__main__":
50
- from numpy.distutils.core import setup
51
-
52
- setup(configuration=configuration)
tomwer/slurm/executor.py DELETED
@@ -1,36 +0,0 @@
1
- from asyncio import Future
2
- from concurrent.futures import ThreadPoolExecutor
3
- from typing import Callable
4
- import time
5
- from tomwer.slurm.job import SBatchScriptJob, submit_sbatch_job
6
-
7
- SUBMISSION_TIMEOUT = 10
8
-
9
- _executor = None
10
-
11
-
12
- class Executor(ThreadPoolExecutor):
13
- def submit(self, fn: Callable, *args, **kwargs) -> Future:
14
- future = super().submit(fn, *args, **kwargs)
15
- return future
16
-
17
-
18
- def submit(job: SBatchScriptJob):
19
- global _executor
20
- if _executor is None:
21
- _executor = Executor()
22
-
23
- if not isinstance(job, SBatchScriptJob):
24
- raise TypeError(
25
- f"job is expected to be an instance of {SBatchScriptJob}. {type(job)} provided"
26
- )
27
-
28
- future = _executor.submit(submit_sbatch_job, job)
29
- wait_time = 0
30
- while job.job_id is None and wait_time < SUBMISSION_TIMEOUT:
31
- time.sleep(0.1)
32
- wait_time += 0.1
33
- future.job_id = job.job_id
34
- if job.job_id is None:
35
- future.set_exception("Unable to submit job within allocated time")
36
- return future