mxcubecore 1.329.0__py3-none-any.whl → 1.331.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 (219) hide show
  1. mxcubecore/BaseHardwareObjects.py +1 -1
  2. mxcubecore/Command/Epics.py +1 -1
  3. mxcubecore/Command/Exporter.py +1 -1
  4. mxcubecore/Command/Mockup.py +1 -1
  5. mxcubecore/Command/Pool.py +1 -1
  6. mxcubecore/Command/Sardana.py +1 -1
  7. mxcubecore/Command/Spec.py +1 -1
  8. mxcubecore/Command/Taco.py +1 -1
  9. mxcubecore/Command/Tango.py +1 -1
  10. mxcubecore/Command/Tine.py +1 -1
  11. mxcubecore/Command/exporter/ExporterClient.py +1 -1
  12. mxcubecore/Command/exporter/ExporterStates.py +1 -1
  13. mxcubecore/Command/exporter/StandardClient.py +1 -1
  14. mxcubecore/CommandContainer.py +1 -1
  15. mxcubecore/HardwareObjectFileParser.py +1 -1
  16. mxcubecore/HardwareObjects/ALBA/ALBACalibration.py +1 -1
  17. mxcubecore/HardwareObjects/ALBA/ALBACollect.py +1 -1
  18. mxcubecore/HardwareObjects/ALBA/ALBAMachineInfo.py +1 -1
  19. mxcubecore/HardwareObjects/ALBA/ALBAMiniDiff.py +1 -1
  20. mxcubecore/HardwareObjects/ALBA/ALBAPilatus.py +1 -1
  21. mxcubecore/HardwareObjects/ALBA/ALBAZoomMotor.py +1 -1
  22. mxcubecore/HardwareObjects/ALBA/ALBAZoomMotorAutoBrightness.py +1 -1
  23. mxcubecore/HardwareObjects/ALBA/XalocMachineInfo.py +1 -1
  24. mxcubecore/HardwareObjects/Attenuators.py +1 -1
  25. mxcubecore/HardwareObjects/Beamline.py +1 -1
  26. mxcubecore/HardwareObjects/BeamlineTools.py +1 -1
  27. mxcubecore/HardwareObjects/Bliss.py +1 -1
  28. mxcubecore/HardwareObjects/BlissEnergy.py +1 -1
  29. mxcubecore/HardwareObjects/BlissMotor.py +1 -1
  30. mxcubecore/HardwareObjects/BlissNState.py +1 -1
  31. mxcubecore/HardwareObjects/BlissShutter.py +1 -1
  32. mxcubecore/HardwareObjects/DESY/Centring.py +1 -1
  33. mxcubecore/HardwareObjects/DESY/DigitalZoomMotor.py +1 -1
  34. mxcubecore/HardwareObjects/DESY/MjpgStreamVideo.py +1 -1
  35. mxcubecore/HardwareObjects/DESY/P11AlbulaView.py +1 -1
  36. mxcubecore/HardwareObjects/DESY/P11BackLight.py +1 -1
  37. mxcubecore/HardwareObjects/DESY/P11Beam.py +1 -1
  38. mxcubecore/HardwareObjects/DESY/P11BeamStop.py +1 -1
  39. mxcubecore/HardwareObjects/DESY/P11Collect.py +1 -1
  40. mxcubecore/HardwareObjects/DESY/P11Collimator.py +1 -1
  41. mxcubecore/HardwareObjects/DESY/P11DetectorCover.py +1 -1
  42. mxcubecore/HardwareObjects/DESY/P11DetectorDistance.py +1 -1
  43. mxcubecore/HardwareObjects/DESY/P11DoorInterlock.py +1 -1
  44. mxcubecore/HardwareObjects/DESY/P11EDNACharacterisation.py +1 -1
  45. mxcubecore/HardwareObjects/DESY/P11EigerDetector.py +1 -1
  46. mxcubecore/HardwareObjects/DESY/P11Energy.py +1 -1
  47. mxcubecore/HardwareObjects/DESY/P11FastShutter.py +1 -1
  48. mxcubecore/HardwareObjects/DESY/P11Flux.py +1 -1
  49. mxcubecore/HardwareObjects/DESY/P11ISPyBClient.py +1 -1
  50. mxcubecore/HardwareObjects/DESY/P11MachineInfo.py +1 -1
  51. mxcubecore/HardwareObjects/DESY/P11NanoDiff.py +1 -1
  52. mxcubecore/HardwareObjects/DESY/P11Pinhole.py +1 -1
  53. mxcubecore/HardwareObjects/DESY/P11SampleChanger.py +1 -1
  54. mxcubecore/HardwareObjects/DESY/P11Session.py +1 -1
  55. mxcubecore/HardwareObjects/DESY/P11Shutter.py +1 -1
  56. mxcubecore/HardwareObjects/DESY/P11Transmission.py +1 -1
  57. mxcubecore/HardwareObjects/DESY/P11YagDiode.py +1 -1
  58. mxcubecore/HardwareObjects/DESY/P11Zoom.py +1 -1
  59. mxcubecore/HardwareObjects/DESY/ValueStateChannel.py +1 -1
  60. mxcubecore/HardwareObjects/DataPublisher.py +1 -1
  61. mxcubecore/HardwareObjects/DozorOnlineProcessing.py +1 -1
  62. mxcubecore/HardwareObjects/EMBL/EMBLAperture.py +1 -1
  63. mxcubecore/HardwareObjects/EMBL/EMBLBSD.py +1 -1
  64. mxcubecore/HardwareObjects/EMBL/EMBLBeam.py +1 -1
  65. mxcubecore/HardwareObjects/EMBL/EMBLBeamCentering.py +1 -1
  66. mxcubecore/HardwareObjects/EMBL/EMBLBeamFocusing.py +1 -1
  67. mxcubecore/HardwareObjects/EMBL/EMBLBeamlineTest.py +1 -1
  68. mxcubecore/HardwareObjects/EMBL/EMBLBeamstop.py +1 -1
  69. mxcubecore/HardwareObjects/EMBL/EMBLCRL.py +1 -1
  70. mxcubecore/HardwareObjects/EMBL/EMBLCollect.py +1 -1
  71. mxcubecore/HardwareObjects/EMBL/EMBLDetector.py +1 -1
  72. mxcubecore/HardwareObjects/EMBL/EMBLDoorInterlock.py +1 -1
  73. mxcubecore/HardwareObjects/EMBL/EMBLEnergy.py +1 -1
  74. mxcubecore/HardwareObjects/EMBL/EMBLEnergyScan.py +1 -1
  75. mxcubecore/HardwareObjects/EMBL/EMBLExporterClient.py +1 -1
  76. mxcubecore/HardwareObjects/EMBL/EMBLFlux.py +1 -1
  77. mxcubecore/HardwareObjects/EMBL/EMBLImageTracking.py +1 -1
  78. mxcubecore/HardwareObjects/EMBL/EMBLMachineInfo.py +1 -1
  79. mxcubecore/HardwareObjects/EMBL/EMBLMiniDiff.py +1 -1
  80. mxcubecore/HardwareObjects/EMBL/EMBLMotorsGroup.py +1 -1
  81. mxcubecore/HardwareObjects/EMBL/EMBLOfflineProcessing.py +1 -1
  82. mxcubecore/HardwareObjects/EMBL/EMBLOnlineProcessing.py +1 -1
  83. mxcubecore/HardwareObjects/EMBL/EMBLPiezoMotor.py +1 -1
  84. mxcubecore/HardwareObjects/EMBL/EMBLQueueEntry.py +1 -1
  85. mxcubecore/HardwareObjects/EMBL/EMBLResolution.py +1 -1
  86. mxcubecore/HardwareObjects/EMBL/EMBLSSXChip.py +1 -1
  87. mxcubecore/HardwareObjects/EMBL/EMBLSafetyShutter.py +1 -1
  88. mxcubecore/HardwareObjects/EMBL/EMBLSession.py +1 -1
  89. mxcubecore/HardwareObjects/EMBL/EMBLSlitBox.py +1 -1
  90. mxcubecore/HardwareObjects/EMBL/EMBLTableMotor.py +1 -1
  91. mxcubecore/HardwareObjects/EMBL/EMBLTransfocator.py +1 -1
  92. mxcubecore/HardwareObjects/EMBL/EMBLTransmission.py +1 -1
  93. mxcubecore/HardwareObjects/EMBL/EMBLXRFSpectrum.py +1 -1
  94. mxcubecore/HardwareObjects/EMBL/EMBLXrayImaging.py +1 -1
  95. mxcubecore/HardwareObjects/EMBL/MDFastShutter.py +1 -1
  96. mxcubecore/HardwareObjects/EMBL/TINEMotor.py +1 -1
  97. mxcubecore/HardwareObjects/EMBLFlexHCD.py +1 -1
  98. mxcubecore/HardwareObjects/EMBLFlexHarvester.py +1 -1
  99. mxcubecore/HardwareObjects/ESRF/BlissHutchTrigger.py +1 -1
  100. mxcubecore/HardwareObjects/ESRF/ESRFBeam.py +1 -1
  101. mxcubecore/HardwareObjects/ESRF/ESRFBeamDefiner.py +1 -1
  102. mxcubecore/HardwareObjects/ESRF/ESRFBeamlineActions.py +1 -1
  103. mxcubecore/HardwareObjects/ESRF/ESRFPhotonFlux.py +1 -1
  104. mxcubecore/HardwareObjects/ESRF/ESRFXRFSpectrum.py +76 -55
  105. mxcubecore/HardwareObjects/ESRF/ID232BeamDefiner.py +1 -1
  106. mxcubecore/HardwareObjects/ESRF/ID30A3BeamDefiner.py +1 -1
  107. mxcubecore/HardwareObjects/ESRF/OxfordCryostream.py +1 -1
  108. mxcubecore/HardwareObjects/ESRF/Transmission.py +1 -1
  109. mxcubecore/HardwareObjects/ESRFLIMS.py +7 -5
  110. mxcubecore/HardwareObjects/ExporterMotor.py +1 -1
  111. mxcubecore/HardwareObjects/ExporterNState.py +1 -1
  112. mxcubecore/HardwareObjects/GenericDiffractometer.py +1 -1
  113. mxcubecore/HardwareObjects/Gphl/GphlQueueEntry.py +1 -1
  114. mxcubecore/HardwareObjects/Harvester.py +1 -1
  115. mxcubecore/HardwareObjects/HarvesterMaintenance.py +1 -1
  116. mxcubecore/HardwareObjects/ICATLIMS.py +104 -34
  117. mxcubecore/HardwareObjects/LNLS/LNLSAperture.py +1 -1
  118. mxcubecore/HardwareObjects/LNLS/LNLSBeam.py +1 -1
  119. mxcubecore/HardwareObjects/LNLS/LNLSDiffractometer.py +1 -1
  120. mxcubecore/HardwareObjects/LNLS/LNLSEnergy.py +1 -1
  121. mxcubecore/HardwareObjects/LNLS/LNLSSlits.py +1 -1
  122. mxcubecore/HardwareObjects/LNLS/LNLSTransmission.py +1 -1
  123. mxcubecore/HardwareObjects/MAXIV/MAXIVAutoProcessing.py +1 -1
  124. mxcubecore/HardwareObjects/MachCurrent.py +1 -1
  125. mxcubecore/HardwareObjects/Marvin.py +1 -1
  126. mxcubecore/HardwareObjects/MicrodiffAperture.py +1 -1
  127. mxcubecore/HardwareObjects/MicrodiffZoom.py +1 -1
  128. mxcubecore/HardwareObjects/MotorWPositions.py +1 -1
  129. mxcubecore/HardwareObjects/MotorsNPosition.py +1 -1
  130. mxcubecore/HardwareObjects/NState.py +1 -1
  131. mxcubecore/HardwareObjects/QtAxisCamera.py +1 -1
  132. mxcubecore/HardwareObjects/QtGraphicsLib.py +1 -1
  133. mxcubecore/HardwareObjects/QtGraphicsManager.py +1 -1
  134. mxcubecore/HardwareObjects/QtLimaVideo.py +1 -1
  135. mxcubecore/HardwareObjects/QtTangoLimaVideo.py +1 -1
  136. mxcubecore/HardwareObjects/QueueModel.py +1 -1
  137. mxcubecore/HardwareObjects/RedisClient.py +1 -1
  138. mxcubecore/HardwareObjects/Resolution.py +1 -1
  139. mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Pilatus.py +1 -1
  140. mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Collect.py +1 -1
  141. mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Diffractometer.py +1 -1
  142. mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Qt4_LimaVideo.py +1 -1
  143. mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Video.py +1 -1
  144. mxcubecore/HardwareObjects/SOLEIL/SOLEILMachineInfo.py +1 -1
  145. mxcubecore/HardwareObjects/SampleView.py +1 -1
  146. mxcubecore/HardwareObjects/StateMachine.py +1 -1
  147. mxcubecore/HardwareObjects/TangoLimaVideoDevice.py +1 -1
  148. mxcubecore/HardwareObjects/TangoMotor.py +1 -1
  149. mxcubecore/HardwareObjects/TangoShutter.py +1 -1
  150. mxcubecore/HardwareObjects/UnitTest.py +1 -1
  151. mxcubecore/HardwareObjects/abstract/AbstractActuator.py +1 -1
  152. mxcubecore/HardwareObjects/abstract/AbstractAperture.py +1 -1
  153. mxcubecore/HardwareObjects/abstract/AbstractAuthenticator.py +1 -1
  154. mxcubecore/HardwareObjects/abstract/AbstractBeam.py +1 -1
  155. mxcubecore/HardwareObjects/abstract/AbstractCharacterisation.py +1 -1
  156. mxcubecore/HardwareObjects/abstract/AbstractCollect.py +1 -1
  157. mxcubecore/HardwareObjects/abstract/AbstractDetector.py +1 -1
  158. mxcubecore/HardwareObjects/abstract/AbstractEnergy.py +1 -1
  159. mxcubecore/HardwareObjects/abstract/AbstractFlux.py +1 -1
  160. mxcubecore/HardwareObjects/abstract/AbstractLims.py +1 -1
  161. mxcubecore/HardwareObjects/abstract/AbstractMachineInfo.py +1 -1
  162. mxcubecore/HardwareObjects/abstract/AbstractMotor.py +1 -1
  163. mxcubecore/HardwareObjects/abstract/AbstractNState.py +1 -1
  164. mxcubecore/HardwareObjects/abstract/AbstractOnlineProcessing.py +1 -1
  165. mxcubecore/HardwareObjects/abstract/AbstractProcedure.py +1 -1
  166. mxcubecore/HardwareObjects/abstract/AbstractResolution.py +1 -1
  167. mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py +1 -1
  168. mxcubecore/HardwareObjects/abstract/AbstractSampleView.py +1 -1
  169. mxcubecore/HardwareObjects/abstract/AbstractShutter.py +1 -1
  170. mxcubecore/HardwareObjects/abstract/AbstractSlits.py +1 -1
  171. mxcubecore/HardwareObjects/abstract/AbstractTransmission.py +1 -1
  172. mxcubecore/HardwareObjects/abstract/AbstractVideoDevice.py +1 -1
  173. mxcubecore/HardwareObjects/abstract/AbstractXRFSpectrum.py +44 -36
  174. mxcubecore/HardwareObjects/mockup/ActuatorMockup.py +1 -1
  175. mxcubecore/HardwareObjects/mockup/ApertureMockup.py +1 -1
  176. mxcubecore/HardwareObjects/mockup/BeamDefinerMockup.py +1 -1
  177. mxcubecore/HardwareObjects/mockup/BeamMockup.py +1 -1
  178. mxcubecore/HardwareObjects/mockup/BeamlineTestMockup.py +1 -1
  179. mxcubecore/HardwareObjects/mockup/BeamstopMockup.py +1 -1
  180. mxcubecore/HardwareObjects/mockup/CollectMockup.py +1 -1
  181. mxcubecore/HardwareObjects/mockup/DiffractometerMockup.py +1 -1
  182. mxcubecore/HardwareObjects/mockup/DoorInterlockMockup.py +1 -1
  183. mxcubecore/HardwareObjects/mockup/EDNACharacterisationMockup.py +1 -1
  184. mxcubecore/HardwareObjects/mockup/EnergyMockup.py +1 -1
  185. mxcubecore/HardwareObjects/mockup/ExporterNStateMockup.py +1 -1
  186. mxcubecore/HardwareObjects/mockup/FluxMockup.py +1 -1
  187. mxcubecore/HardwareObjects/mockup/HarvesterMockup.py +1 -1
  188. mxcubecore/HardwareObjects/mockup/MotorMockup.py +1 -1
  189. mxcubecore/HardwareObjects/mockup/MotorMockupBis.py +1 -1
  190. mxcubecore/HardwareObjects/mockup/OfflineProcessingMockup.py +1 -1
  191. mxcubecore/HardwareObjects/mockup/OnlineProcessingMockup.py +1 -1
  192. mxcubecore/HardwareObjects/mockup/PlateManipulatorMockup.py +1 -1
  193. mxcubecore/HardwareObjects/mockup/QtVideoMockup.py +1 -1
  194. mxcubecore/HardwareObjects/mockup/ScanMockup.py +1 -1
  195. mxcubecore/HardwareObjects/mockup/ShutterMockup.py +1 -1
  196. mxcubecore/HardwareObjects/mockup/SlitsMockup.py +1 -1
  197. mxcubecore/HardwareObjects/mockup/TransmissionMockup.py +1 -1
  198. mxcubecore/HardwareObjects/mockup/XRFSpectrumMockup.py +1 -1
  199. mxcubecore/HardwareRepository.py +1 -1
  200. mxcubecore/model/queue_model_enumerables.py +1 -1
  201. mxcubecore/model/queue_model_objects.py +1 -1
  202. mxcubecore/queue_entry/__init__.py +1 -1
  203. mxcubecore/queue_entry/advanced_connector.py +1 -1
  204. mxcubecore/queue_entry/base_queue_entry.py +1 -1
  205. mxcubecore/queue_entry/characterisation.py +1 -1
  206. mxcubecore/queue_entry/data_collection.py +1 -1
  207. mxcubecore/queue_entry/energy_scan.py +1 -1
  208. mxcubecore/queue_entry/generic_workflow.py +1 -1
  209. mxcubecore/queue_entry/import_helper.py +1 -1
  210. mxcubecore/queue_entry/optical_centring.py +1 -1
  211. mxcubecore/queue_entry/sample_centring.py +1 -1
  212. mxcubecore/queue_entry/xray_centering.py +1 -1
  213. mxcubecore/queue_entry/xray_centering2.py +1 -1
  214. mxcubecore/queue_entry/xrf_spectrum.py +7 -7
  215. {mxcubecore-1.329.0.dist-info → mxcubecore-1.331.0.dist-info}/METADATA +1 -1
  216. {mxcubecore-1.329.0.dist-info → mxcubecore-1.331.0.dist-info}/RECORD +219 -219
  217. {mxcubecore-1.329.0.dist-info → mxcubecore-1.331.0.dist-info}/COPYING +0 -0
  218. {mxcubecore-1.329.0.dist-info → mxcubecore-1.331.0.dist-info}/COPYING.LESSER +0 -0
  219. {mxcubecore-1.329.0.dist-info → mxcubecore-1.331.0.dist-info}/WHEEL +0 -0
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube.
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -22,8 +22,8 @@
22
22
 
23
23
  import abc
24
24
  import logging
25
- import os
26
25
  import time
26
+ from pathlib import Path
27
27
 
28
28
  import gevent
29
29
 
@@ -73,29 +73,31 @@ class AbstractXRFSpectrum(HardwareObject):
73
73
 
74
74
  def start_spectrum(
75
75
  self,
76
- integration_time=None,
77
- data_dir=None,
78
- prefix=None,
79
- archive_dir=None,
80
- session_id=None,
81
- blsample_id=None,
82
- cpos=None,
76
+ integration_time: float | None = None,
77
+ data_dir: str | None = None,
78
+ prefix: str | None = None,
79
+ archive_dir: str | None = None,
80
+ session_id: int | None = None,
81
+ blsample_id: int | None = None,
82
+ cpos: dict | None = None,
83
83
  ):
84
84
  """Start the procedure. Called by the queue_model.
85
85
 
86
86
  Args:
87
- integration_time (float): Inregration time [s].
88
- data_dir (str): Directory to save the data (full path).
89
- archive_dir (str): Directory to save the archive data (full path).
90
- prefix (str): File prefix
91
- session_id (int): Session ID number (from ISpyB)
92
- blsample_id (int): Sample ID number (from ISpyB)
87
+ integration_time: Inregration time [s].
88
+ data_dir: Directory to save the data (full path).
89
+ archive_dir: Directory to save the archive data (full path).
90
+ prefix: File prefix
91
+ session_id: Session ID number (from ISpyB)
92
+ blsample_id: Sample ID number (from ISpyB)
93
+ cpos: The centred position motors and their values.
93
94
  """
94
95
  self.cpos = cpos
95
96
  self.spectrum_info_dict = {"sessionId": session_id, "blSampleId": blsample_id}
96
97
  integration_time = integration_time or self.default_integration_time
97
98
  self.spectrum_info_dict["exposureTime"] = integration_time
98
99
  self.spectrum_info_dict["filename"] = ""
100
+
99
101
  # Create the data and the archive directory (if needed) and files
100
102
  if data_dir:
101
103
  if not self.create_directory(data_dir):
@@ -125,12 +127,16 @@ class AbstractXRFSpectrum(HardwareObject):
125
127
  )
126
128
  return True
127
129
 
128
- def execute_spectrum(self, integration_time=None, filename=None):
130
+ def execute_spectrum(
131
+ self,
132
+ integration_time: float | None = None,
133
+ filename: str | None = None,
134
+ ):
129
135
  """Do the acquisition.
130
136
 
131
137
  Args:
132
- integration_time (float): MCA integration time [s].
133
- filename (str): Data file (full path).
138
+ integration_time: MCA integration time [s].
139
+ filename: Data file (full path).
134
140
  Raises:
135
141
  RuntimeError: Cannot acquire data.
136
142
  """
@@ -149,23 +155,27 @@ class AbstractXRFSpectrum(HardwareObject):
149
155
  self.update_state(self.STATES.FAULT)
150
156
 
151
157
  @abc.abstractmethod
152
- def _execute_spectrum(self, integration_time=None, filename=None):
158
+ def _execute_spectrum(
159
+ self,
160
+ integration_time: float | None = None,
161
+ filename: str | None = None,
162
+ ) -> bool:
153
163
  """Specific XRF acquisition procedure"""
154
164
  return True
155
165
 
156
- def create_directory(self, directory):
166
+ def create_directory(self, directory: str) -> bool:
157
167
  """Create a directory, if needed.
158
168
  Args:
159
- directory (str): Directory to save the data (full path).
169
+ directory: Directory to save the data (full path).
160
170
  Returns:
161
- (bool): Tue if directory created or already exists, False if error.
171
+ ``True`` if directory created or already exists, ``False`` if error.
162
172
  """
163
- if not os.path.isdir(directory):
173
+ if not Path(directory).is_dir():
164
174
  msg = f"XRFSpectrum: directory creating {directory}"
165
175
  try:
166
- if not os.path.exists(directory):
176
+ if not Path(directory).exists():
167
177
  logging.getLogger("user_level_log").debug(msg)
168
- os.makedirs(directory)
178
+ Path(directory).mkdir(parents=True)
169
179
  return True
170
180
  except OSError as err:
171
181
  msg += f": {err}"
@@ -175,7 +185,7 @@ class AbstractXRFSpectrum(HardwareObject):
175
185
  return False
176
186
  return True
177
187
 
178
- def get_filename(self, directory, prefix):
188
+ def get_filename(self, directory: str, prefix: str) -> str:
179
189
  """Create file template.
180
190
  Args:
181
191
  directory(str): directory name (full path)
@@ -183,19 +193,16 @@ class AbstractXRFSpectrum(HardwareObject):
183
193
  (str): File template
184
194
  """
185
195
  _pattern = f"{prefix}_{time.strftime('%d_%b_%Y')}_%02d_xrf"
186
- filename_pattern = os.path.join(directory, _pattern)
187
- filename = filename_pattern % 1
188
- # fileprefix = _pattern % 1
196
+ filename = Path(directory) / (_pattern % 1)
189
197
 
190
198
  i = 2
191
- while os.path.isfile(filename):
192
- filename = filename_pattern % i
193
- # fileprefix = _pattern % i
194
- i = i + 1
199
+ while Path(filename).is_file():
200
+ filename = Path(directory) / (_pattern % i)
201
+ i += 1
195
202
 
196
- return filename
203
+ return str(filename)
197
204
 
198
- def spectrum_status_change(self, status_msg):
205
+ def spectrum_status_change(self, status_msg: str):
199
206
  """Emit the signal xrfSpectrumStatusChanged with appropriate message.
200
207
  Args:
201
208
  status_msg(str): Message to send.
@@ -224,7 +231,8 @@ class AbstractXRFSpectrum(HardwareObject):
224
231
 
225
232
  def spectrum_analyse(self):
226
233
  """Get the spectrum data. Do analysis and save fitted data.
227
- The method has to be implemented as specific for each site.
234
+ The method has to be implemented as specific for each site, but
235
+ is only optional.
228
236
  """
229
237
 
230
238
  def spectrum_command_aborted(self):
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube.
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Project: MXCuBE
2
+ # Project name: MXCuBE
3
3
  # https://github.com/mxcube
4
4
  #
5
5
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  #
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- # Project: MXCuBE
3
+ # Project name: MXCuBE
4
4
  # https://github.com/mxcube
5
5
  #
6
6
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -1,4 +1,4 @@
1
- # Project: MXCuBE
1
+ # Project name: MXCuBE
2
2
  # https://github.com/mxcube
3
3
  #
4
4
  # This file is part of MXCuBE software.
@@ -43,12 +43,12 @@ class XrfSpectrumQueueEntry(BaseQueueEntry):
43
43
  super().__init__(view, data_model)
44
44
  self._failed = False
45
45
 
46
- def __getstate__(self):
46
+ def __getstate__(self) -> dict:
47
47
  d = dict(self.__dict__)
48
48
  d["xrf_spectrum_task"] = None
49
49
  return d
50
50
 
51
- def __setstate__(self, d):
51
+ def __setstate__(self, d: dict):
52
52
  self.__dict__.update(d)
53
53
 
54
54
  def execute(self):
@@ -67,7 +67,7 @@ class XrfSpectrumQueueEntry(BaseQueueEntry):
67
67
  archive_dir=xrf_spectrum.path_template.get_archive_directory(),
68
68
  prefix=f"{path_template.get_prefix()}_{path_template.run_number}",
69
69
  session_id=HWR.beamline.session.session_id,
70
- blsample_id=xrf_spectrum._node_id,
70
+ blsample_id=xrf_spectrum.sample.lims_id,
71
71
  cpos=xrf_spectrum.centred_position,
72
72
  )
73
73
  HWR.beamline.xrf_spectrum._ready_event.wait()
@@ -108,10 +108,10 @@ class XrfSpectrumQueueEntry(BaseQueueEntry):
108
108
  self.get_view().set_checkable(False)
109
109
  super().post_execute()
110
110
 
111
- def xrf_spectrum_status_changed(self, msg):
111
+ def xrf_spectrum_status_changed(self, msg: str):
112
112
  """xrfSpectrumStatusChanged handler.
113
113
  Args:
114
- msg (str): Message when xrfSpectrumStatusChanged emitted.
114
+ msg: Message when ``xrfSpectrumStatusChanged`` emitted.
115
115
  """
116
116
  logging.getLogger("user_level_log").info(msg)
117
117
 
@@ -136,5 +136,5 @@ class XrfSpectrumQueueEntry(BaseQueueEntry):
136
136
  logging.getLogger("user_level_log").error("XRF spectrum failed.")
137
137
  raise QueueExecutionException("XRF spectrum failed", self)
138
138
 
139
- def get_type_str(self):
139
+ def get_type_str(self) -> str:
140
140
  return "XRF spectrum"