mxcubecore 1.393.0__py3-none-any.whl → 1.395.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.
Potentially problematic release.
This version of mxcubecore might be problematic. Click here for more details.
- mxcubecore/HardwareObjects/ALBA/ALBAAutoProcessing.py +4 -7
- mxcubecore/HardwareObjects/ALBA/ALBABackLight.py +6 -7
- mxcubecore/HardwareObjects/ALBA/ALBABeamInfo.py +2 -4
- mxcubecore/HardwareObjects/ALBA/ALBACats.py +19 -25
- mxcubecore/HardwareObjects/ALBA/ALBAClusterJob.py +10 -11
- mxcubecore/HardwareObjects/ALBA/ALBACollect.py +49 -71
- mxcubecore/HardwareObjects/ALBA/ALBADataAnalysis.py +26 -31
- mxcubecore/HardwareObjects/ALBA/ALBAEnergy.py +1 -5
- mxcubecore/HardwareObjects/ALBA/ALBAEpsActuator.py +1 -1
- mxcubecore/HardwareObjects/ALBA/ALBAFastShutter.py +1 -1
- mxcubecore/HardwareObjects/ALBA/ALBAFlux.py +2 -6
- mxcubecore/HardwareObjects/ALBA/ALBAFrontLight.py +5 -9
- mxcubecore/HardwareObjects/ALBA/ALBAISPyBClient.py +4 -4
- mxcubecore/HardwareObjects/ALBA/ALBAMiniDiff.py +20 -27
- mxcubecore/HardwareObjects/ALBA/ALBAPilatus.py +12 -15
- mxcubecore/HardwareObjects/ALBA/ALBASession.py +1 -4
- mxcubecore/HardwareObjects/ALBA/ALBAZoomMotor.py +10 -14
- mxcubecore/HardwareObjects/ALBA/ALBAZoomMotorAutoBrightness.py +7 -11
- mxcubecore/HardwareObjects/ALBA/XalocMiniDiff.py +7 -8
- mxcubecore/HardwareObjects/BeamInfo.py +4 -6
- mxcubecore/HardwareObjects/Beamline.py +6 -7
- mxcubecore/HardwareObjects/BeamlineActions.py +3 -7
- mxcubecore/HardwareObjects/BlissHutchTrigger.py +2 -4
- mxcubecore/HardwareObjects/BlissMotorWPositions.py +4 -7
- mxcubecore/HardwareObjects/Cats90.py +33 -43
- mxcubecore/HardwareObjects/CatsBessy.py +1 -2
- mxcubecore/HardwareObjects/CatsMaint.py +2 -2
- mxcubecore/HardwareObjects/CentringMath.py +5 -4
- mxcubecore/HardwareObjects/DESY/DigitalZoomMotor.py +3 -5
- mxcubecore/HardwareObjects/DESY/MjpgStreamVideo.py +1 -3
- mxcubecore/HardwareObjects/DESY/P11Collect.py +6 -8
- mxcubecore/HardwareObjects/DESY/P11EDNACharacterisation.py +14 -16
- mxcubecore/HardwareObjects/DESY/P11ISPyBClient.py +6 -10
- mxcubecore/HardwareObjects/DESY/P11NanoDiff.py +5 -5
- mxcubecore/HardwareObjects/DataPublisher.py +2 -3
- mxcubecore/HardwareObjects/EDNACharacterisation.py +2 -4
- mxcubecore/HardwareObjects/EMBL/EMBLBeam.py +3 -3
- mxcubecore/HardwareObjects/EMBL/EMBLBeamCentering.py +2 -4
- mxcubecore/HardwareObjects/EMBL/EMBLBeamFocusing.py +3 -3
- mxcubecore/HardwareObjects/EMBL/EMBLDoorInterlock.py +1 -1
- mxcubecore/HardwareObjects/EMBL/EMBLEnergy.py +10 -18
- mxcubecore/HardwareObjects/EMBL/EMBLEnergyScan.py +9 -13
- mxcubecore/HardwareObjects/EMBL/EMBLFlux.py +10 -12
- mxcubecore/HardwareObjects/EMBL/EMBLMachineInfo.py +2 -2
- mxcubecore/HardwareObjects/EMBL/EMBLMiniDiff.py +18 -18
- mxcubecore/HardwareObjects/EMBL/EMBLMotorsGroup.py +6 -9
- mxcubecore/HardwareObjects/EMBL/EMBLOnlineProcessing.py +6 -6
- mxcubecore/HardwareObjects/EMBL/EMBLPPUControl.py +1 -1
- mxcubecore/HardwareObjects/EMBL/EMBLSSXChip.py +1 -4
- mxcubecore/HardwareObjects/EMBL/EMBLSlitBox.py +1 -3
- mxcubecore/HardwareObjects/EMBL/EMBLTableMotor.py +2 -3
- mxcubecore/HardwareObjects/EMBL/EMBLXRFSpectrum.py +4 -4
- mxcubecore/HardwareObjects/EMBL/EMBLXrayImaging.py +1 -1
- mxcubecore/HardwareObjects/EMBL/TINEMotor.py +2 -4
- mxcubecore/HardwareObjects/EMBLFlexHCD.py +5 -5
- mxcubecore/HardwareObjects/EMBLFlexHarvester.py +2 -2
- mxcubecore/HardwareObjects/ESRF/ESRFBeam.py +3 -5
- mxcubecore/HardwareObjects/ESRF/ESRFBeamInfo.py +1 -5
- mxcubecore/HardwareObjects/ESRF/ESRFBeamlineActions.py +2 -3
- mxcubecore/HardwareObjects/ESRF/ESRFEnergyScan.py +3 -3
- mxcubecore/HardwareObjects/ESRF/ESRFMultiCollect.py +7 -7
- mxcubecore/HardwareObjects/ESRF/ESRFPhotonFlux.py +2 -8
- mxcubecore/HardwareObjects/ESRF/ESRFSC3.py +11 -18
- mxcubecore/HardwareObjects/ESRF/ID29HutchTrigger.py +2 -4
- mxcubecore/HardwareObjects/ESRF/MD2MultiCollect.py +4 -4
- mxcubecore/HardwareObjects/ESRF/SSXICATLIMS.py +9 -6
- mxcubecore/HardwareObjects/EdnaWorkflow.py +9 -11
- mxcubecore/HardwareObjects/Energy.py +11 -15
- mxcubecore/HardwareObjects/ExporterMotor.py +1 -2
- mxcubecore/HardwareObjects/FlexHCD.py +7 -8
- mxcubecore/HardwareObjects/FlexHCDMaintenance.py +1 -2
- mxcubecore/HardwareObjects/GenericDiffractometer.py +26 -46
- mxcubecore/HardwareObjects/Gphl/CollectEmulator.py +6 -7
- mxcubecore/HardwareObjects/Gphl/GphlQueueEntry.py +2 -2
- mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py +29 -43
- mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py +25 -35
- mxcubecore/HardwareObjects/ICATLIMS.py +17 -13
- mxcubecore/HardwareObjects/LNLS/EPICSMotor.py +1 -4
- mxcubecore/HardwareObjects/LNLS/LNLSAperture.py +2 -5
- mxcubecore/HardwareObjects/LNLS/LNLSCamera.py +14 -16
- mxcubecore/HardwareObjects/LNLS/LNLSCollect.py +20 -30
- mxcubecore/HardwareObjects/LNLS/LNLSDetDistMotor.py +7 -11
- mxcubecore/HardwareObjects/LNLS/LNLSEnergy.py +4 -6
- mxcubecore/HardwareObjects/LNLS/LNLSPilatusDet.py +49 -57
- mxcubecore/HardwareObjects/LNLS/LNLSTransmission.py +4 -7
- mxcubecore/HardwareObjects/LdapAuthenticator.py +11 -15
- mxcubecore/HardwareObjects/Lima2Detector.py +1 -1
- mxcubecore/HardwareObjects/LimaEigerDetector.py +1 -1
- mxcubecore/HardwareObjects/LimaPilatusDetector.py +1 -4
- mxcubecore/HardwareObjects/MAXIV/MAXIVAutoProcessing.py +3 -5
- mxcubecore/HardwareObjects/MD3UP.py +1 -2
- mxcubecore/HardwareObjects/MachCurrent.py +5 -5
- mxcubecore/HardwareObjects/Marvin.py +23 -35
- mxcubecore/HardwareObjects/Microdiff.py +6 -8
- mxcubecore/HardwareObjects/MicrodiffActuator.py +1 -1
- mxcubecore/HardwareObjects/MicrodiffBeamstop.py +1 -3
- mxcubecore/HardwareObjects/MicrodiffInOut.py +1 -1
- mxcubecore/HardwareObjects/MicrodiffKappaMotor.py +3 -4
- mxcubecore/HardwareObjects/MiniDiff.py +35 -57
- mxcubecore/HardwareObjects/MotorWPositions.py +3 -3
- mxcubecore/HardwareObjects/PlateManipulator.py +2 -2
- mxcubecore/HardwareObjects/ProposalTypeISPyBLims.py +8 -16
- mxcubecore/HardwareObjects/PyISPyBClient.py +8 -5
- mxcubecore/HardwareObjects/QtGraphicsLib.py +2 -2
- mxcubecore/HardwareObjects/QtGraphicsManager.py +13 -19
- mxcubecore/HardwareObjects/QtInstanceServer.py +27 -55
- mxcubecore/HardwareObjects/QtLimaVideo.py +1 -5
- mxcubecore/HardwareObjects/QueueManager.py +7 -9
- mxcubecore/HardwareObjects/QueueModel.py +6 -8
- mxcubecore/HardwareObjects/RedisClient.py +12 -16
- mxcubecore/HardwareObjects/SC3.py +1 -2
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Attenuator.py +1 -3
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1BeamInfo.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1CatsMaint.py +3 -4
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Collect.py +11 -11
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Cryotong.py +8 -18
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Energy.py +6 -7
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1EnergyScan.py +21 -31
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Environment.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1MiniDiff.py +11 -21
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Pilatus.py +9 -9
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Pss.py +1 -2
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Resolution.py +1 -5
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1TangoLight.py +3 -8
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Attenuator.py +9 -13
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Collect.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Diffractometer.py +22 -22
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Energy.py +4 -6
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Guillotine.py +2 -2
- mxcubecore/HardwareObjects/SOLEIL/SOLEILCatsMaint.py +6 -8
- mxcubecore/HardwareObjects/SOLEIL/SOLEILEnergyScan.py +44 -56
- mxcubecore/HardwareObjects/SOLEIL/SOLEILGuillotine.py +2 -2
- mxcubecore/HardwareObjects/SOLEIL/SOLEILISPyBClient.py +10 -10
- mxcubecore/HardwareObjects/SOLEIL/SOLEILMachineInfo.py +4 -8
- mxcubecore/HardwareObjects/SOLEIL/SOLEILPss.py +3 -4
- mxcubecore/HardwareObjects/SOLEIL/SOLEILRuche.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/TangoDCMotor.py +10 -16
- mxcubecore/HardwareObjects/SardanaMotor.py +4 -5
- mxcubecore/HardwareObjects/Session.py +1 -2
- mxcubecore/HardwareObjects/SpecMotorWPositions.py +5 -9
- mxcubecore/HardwareObjects/SpecMotorWSpecPositions.py +2 -4
- mxcubecore/HardwareObjects/SpecShell.py +7 -9
- mxcubecore/HardwareObjects/SpecState.py +5 -7
- mxcubecore/HardwareObjects/StateMachine.py +9 -10
- mxcubecore/HardwareObjects/TangoLimaMpegVideo.py +2 -3
- mxcubecore/HardwareObjects/TangoLimaVideo.py +3 -4
- mxcubecore/HardwareObjects/TangoMachineInfo.py +1 -3
- mxcubecore/HardwareObjects/TangoMotor.py +1 -3
- mxcubecore/HardwareObjects/UserTypeISPyBLims.py +7 -9
- mxcubecore/HardwareObjects/XMLRPCServer.py +20 -22
- mxcubecore/HardwareObjects/abstract/AbstractAperture.py +6 -11
- mxcubecore/HardwareObjects/abstract/AbstractCollect.py +6 -16
- mxcubecore/HardwareObjects/abstract/AbstractDetector.py +2 -7
- mxcubecore/HardwareObjects/abstract/AbstractEnergyScan.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractLims.py +3 -4
- mxcubecore/HardwareObjects/abstract/AbstractNState.py +1 -2
- mxcubecore/HardwareObjects/abstract/AbstractProcedure.py +3 -4
- mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractVideoDevice.py +4 -4
- mxcubecore/HardwareObjects/abstract/AbstractXRFSpectrum.py +1 -1
- mxcubecore/HardwareObjects/abstract/ISPyBAbstractLims.py +11 -13
- mxcubecore/HardwareObjects/mockup/BeamlineTestMockup.py +11 -14
- mxcubecore/HardwareObjects/mockup/EnergyScanMockup.py +10 -11
- mxcubecore/HardwareObjects/mockup/ISPyBClientMockup.py +6 -6
- mxcubecore/HardwareObjects/mockup/ISPyBRestClientMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/LimaDetectorMockup.py +1 -2
- mxcubecore/HardwareObjects/mockup/MDCameraMockup.py +5 -6
- mxcubecore/HardwareObjects/mockup/MicrodiffInOutMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/MultiCollectMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/ShapeHistoryMockup.py +1 -2
- mxcubecore/HardwareObjects/mockup/XRFMockup.py +3 -6
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.395.0.dist-info}/METADATA +1 -1
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.395.0.dist-info}/RECORD +176 -176
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.395.0.dist-info}/COPYING +0 -0
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.395.0.dist-info}/COPYING.LESSER +0 -0
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.395.0.dist-info}/WHEEL +0 -0
|
@@ -106,7 +106,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
106
106
|
for undulator in self.config.undulators:
|
|
107
107
|
undulators.append(undulator)
|
|
108
108
|
except Exception:
|
|
109
|
-
|
|
109
|
+
self.log.exception("")
|
|
110
110
|
|
|
111
111
|
beam_div_hor, beam_div_ver = HWR.beamline.beam.get_beam_divergence()
|
|
112
112
|
|
|
@@ -192,9 +192,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
192
192
|
"%Y-%m-%d %H:%M:%S"
|
|
193
193
|
)
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
"Collection parameters: %s" % str(self.current_dc_parameters)
|
|
197
|
-
)
|
|
195
|
+
self.log.info("Collection parameters: %s" % str(self.current_dc_parameters))
|
|
198
196
|
|
|
199
197
|
log.info("Collection: Storing data collection in LIMS")
|
|
200
198
|
self.store_data_collection_in_lims()
|
|
@@ -621,9 +619,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
621
619
|
if detector_id:
|
|
622
620
|
self.current_dc_parameters["detector_id"] = detector_id
|
|
623
621
|
except BaseException:
|
|
624
|
-
|
|
625
|
-
"Could not store data collection in LIMS"
|
|
626
|
-
)
|
|
622
|
+
self.log.exception("Could not store data collection in LIMS")
|
|
627
623
|
|
|
628
624
|
def update_data_collection_in_lims(self) -> None:
|
|
629
625
|
"""Update current data collection information in LIMS database."""
|
|
@@ -658,9 +654,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
658
654
|
try:
|
|
659
655
|
HWR.beamline.lims.update_data_collection(params)
|
|
660
656
|
except BaseException:
|
|
661
|
-
|
|
662
|
-
"Could not update data collection in LIMS"
|
|
663
|
-
)
|
|
657
|
+
self.log.exception("Could not update data collection in LIMS")
|
|
664
658
|
|
|
665
659
|
def store_sample_info_in_lims(self):
|
|
666
660
|
"""Store current sample information in LIMS database."""
|
|
@@ -742,9 +736,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
742
736
|
)
|
|
743
737
|
HWR.beamline.lims.update_data_collection(self.current_dc_parameters)
|
|
744
738
|
except BaseException:
|
|
745
|
-
|
|
746
|
-
"Could not store data collection into ISPyB"
|
|
747
|
-
)
|
|
739
|
+
self.log.exception("Could not store data collection into ISPyB")
|
|
748
740
|
|
|
749
741
|
def get_sample_info(self) -> None:
|
|
750
742
|
"""Get current sample information in LIMS database.
|
|
@@ -816,9 +808,7 @@ class AbstractCollect(HardwareObject, object):
|
|
|
816
808
|
try:
|
|
817
809
|
self.create_directories(snapshot_directory)
|
|
818
810
|
except BaseException:
|
|
819
|
-
|
|
820
|
-
"Collection: Error creating snapshot directory"
|
|
821
|
-
)
|
|
811
|
+
self.log.exception("Collection: Error creating snapshot directory")
|
|
822
812
|
if number_of_snapshots > 0 and not self.current_dc_parameters["in_interleave"]:
|
|
823
813
|
logging.getLogger("user_level_log").info(
|
|
824
814
|
"Collection: Taking %d sample snapshot(s)" % number_of_snapshots
|
|
@@ -50,7 +50,6 @@ Hardware objects used: energy
|
|
|
50
50
|
|
|
51
51
|
import abc
|
|
52
52
|
import ast
|
|
53
|
-
import logging
|
|
54
53
|
import math
|
|
55
54
|
|
|
56
55
|
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
@@ -105,16 +104,12 @@ class AbstractDetector(HardwareObject):
|
|
|
105
104
|
max_exp_time = self.get_property("maximum_exposure_time", None)
|
|
106
105
|
|
|
107
106
|
if min_exp_time is None:
|
|
108
|
-
|
|
109
|
-
"Minimum exposure time not set for detector, using None"
|
|
110
|
-
)
|
|
107
|
+
self.log.warning("Minimum exposure time not set for detector, using None")
|
|
111
108
|
else:
|
|
112
109
|
min_exp_time = float(min_exp_time)
|
|
113
110
|
|
|
114
111
|
if max_exp_time is None:
|
|
115
|
-
|
|
116
|
-
"Maximum exposure time not set for detector, using None"
|
|
117
|
-
)
|
|
112
|
+
self.log.warning("Maximum exposure time not set for detector, using None")
|
|
118
113
|
else:
|
|
119
114
|
max_exp_time = float(max_exp_time)
|
|
120
115
|
|
|
@@ -115,7 +115,7 @@ class AbstractEnergyScan(HardwareObject):
|
|
|
115
115
|
HWR.beamline.safety_shutter.open(timeout=10)
|
|
116
116
|
self.choose_attenuation()
|
|
117
117
|
self.close_fast_shutter()
|
|
118
|
-
|
|
118
|
+
self.log.debug("Doing the scan, please wait...")
|
|
119
119
|
self.execute_energy_scan(self.energy_scan_parameters)
|
|
120
120
|
self.escan_postscan()
|
|
121
121
|
self.close_fast_shutter()
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
""" """
|
|
21
21
|
|
|
22
22
|
import abc
|
|
23
|
-
import logging
|
|
24
23
|
from datetime import datetime
|
|
25
24
|
from typing import (
|
|
26
25
|
Dict,
|
|
@@ -451,7 +450,7 @@ class AbstractLims(HardwareObject, abc.ABC):
|
|
|
451
450
|
:param session: lims session value
|
|
452
451
|
:return:
|
|
453
452
|
"""
|
|
454
|
-
|
|
453
|
+
self.log.debug(
|
|
455
454
|
"%s sessions available for users %s"
|
|
456
455
|
% (len(sessions), self.session_manager.users.keys())
|
|
457
456
|
)
|
|
@@ -504,7 +503,7 @@ class AbstractLims(HardwareObject, abc.ABC):
|
|
|
504
503
|
def remove_user(self, user_name: str):
|
|
505
504
|
if user_name in self.session_manager.users:
|
|
506
505
|
del self.session_manager.users[user_name]
|
|
507
|
-
|
|
506
|
+
self.log.debug("User %s has been removed" % user_name)
|
|
508
507
|
self.__set_sessions(self.get_shared_sessions())
|
|
509
508
|
|
|
510
509
|
def add_user_and_shared_sessions(self, user_name: str, sessions: List[Session]):
|
|
@@ -516,7 +515,7 @@ class AbstractLims(HardwareObject, abc.ABC):
|
|
|
516
515
|
self.session_manager.users[user_name] = LimsUser(
|
|
517
516
|
user_name=user_name, sessions=sessions
|
|
518
517
|
)
|
|
519
|
-
|
|
518
|
+
self.log.debug(
|
|
520
519
|
"User added to session manager, user_name=%s sessions=%s"
|
|
521
520
|
% (user_name, len(sessions))
|
|
522
521
|
)
|
|
@@ -24,7 +24,6 @@ Implements validate_value, set/update limits.
|
|
|
24
24
|
|
|
25
25
|
import abc
|
|
26
26
|
import ast
|
|
27
|
-
import logging
|
|
28
27
|
from enum import (
|
|
29
28
|
Enum,
|
|
30
29
|
unique,
|
|
@@ -93,7 +92,7 @@ class AbstractNState(AbstractActuator):
|
|
|
93
92
|
values_dict.update(values)
|
|
94
93
|
self.VALUES = Enum("ValueEnum", values_dict)
|
|
95
94
|
except (ValueError, TypeError):
|
|
96
|
-
|
|
95
|
+
self.log.exception("")
|
|
97
96
|
|
|
98
97
|
def value_to_enum(self, value, idx=0):
|
|
99
98
|
"""Transform a value to Enum
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#
|
|
17
17
|
# You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
-
import logging
|
|
20
19
|
from enum import (
|
|
21
20
|
IntEnum,
|
|
22
21
|
unique,
|
|
@@ -184,14 +183,14 @@ class AbstractProcedure(ConfiguredObject):
|
|
|
184
183
|
except Exception as ex:
|
|
185
184
|
self._state = ProcedureState.ERROR
|
|
186
185
|
self._msg = "Procedure execution error (%s)" % str(ex)
|
|
187
|
-
|
|
186
|
+
self.log.exception(self._msg)
|
|
188
187
|
finally:
|
|
189
188
|
try:
|
|
190
189
|
self._post_execute(data_model)
|
|
191
190
|
except Exception as ex:
|
|
192
191
|
self._state = ProcedureState.ERROR
|
|
193
192
|
self._msg = "Procedure post_execute error (%s)" % str(ex)
|
|
194
|
-
|
|
193
|
+
self.log.exception(self._msg)
|
|
195
194
|
|
|
196
195
|
self._ready_event.set()
|
|
197
196
|
|
|
@@ -265,7 +264,7 @@ class AbstractProcedure(ConfiguredObject):
|
|
|
265
264
|
"""
|
|
266
265
|
if self._state != ProcedureState.READY:
|
|
267
266
|
self._msg = "Procedure (%s) is already running" % str(self)
|
|
268
|
-
|
|
267
|
+
self.log.error(self._msg)
|
|
269
268
|
else:
|
|
270
269
|
self._task = gevent.spawn(self._start, data_model)
|
|
271
270
|
|
|
@@ -237,7 +237,7 @@ class SampleChanger(Container, HardwareObject):
|
|
|
237
237
|
use_update_timer = self.get_property("useUpdateTimer", True)
|
|
238
238
|
|
|
239
239
|
msg = f"SampleChanger: Using update timer is {use_update_timer}"
|
|
240
|
-
|
|
240
|
+
self.log.info(msg)
|
|
241
241
|
|
|
242
242
|
if use_update_timer:
|
|
243
243
|
task1s = self.__timer_1s_task(wait=False)
|
|
@@ -120,7 +120,7 @@ class AbstractVideoDevice(HardwareObject):
|
|
|
120
120
|
try:
|
|
121
121
|
self.cam_gain = float(self.get_property("gain"))
|
|
122
122
|
except TypeError:
|
|
123
|
-
|
|
123
|
+
self.log.exception("")
|
|
124
124
|
|
|
125
125
|
try:
|
|
126
126
|
self.cam_exposure = float(self.get_property("exposure"))
|
|
@@ -152,7 +152,7 @@ class AbstractVideoDevice(HardwareObject):
|
|
|
152
152
|
self.set_video_live(True)
|
|
153
153
|
self.change_owner()
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
self.log.info("Starting polling for camera")
|
|
156
156
|
self.image_polling = gevent.spawn(
|
|
157
157
|
self.do_image_polling, self.poll_interval / 1000.0
|
|
158
158
|
)
|
|
@@ -167,10 +167,10 @@ class AbstractVideoDevice(HardwareObject):
|
|
|
167
167
|
return self.cam_name
|
|
168
168
|
|
|
169
169
|
def polling_ended(self, gl=None):
|
|
170
|
-
|
|
170
|
+
self.log.info("Polling ended for qt camera")
|
|
171
171
|
|
|
172
172
|
def polling_ended_exc(self, gl=None):
|
|
173
|
-
|
|
173
|
+
self.log.info("Polling ended exception for qt camera")
|
|
174
174
|
|
|
175
175
|
# -------- Generic methods --------
|
|
176
176
|
|
|
@@ -40,7 +40,7 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
40
40
|
# Initialize ldap
|
|
41
41
|
self.ldapConnection = self.get_object_by_role("ldapServer")
|
|
42
42
|
if self.ldapConnection is None:
|
|
43
|
-
|
|
43
|
+
self.log.debug("LDAP Server is not available")
|
|
44
44
|
|
|
45
45
|
self.loginTranslate = self.get_property("loginTranslate", default_value=True)
|
|
46
46
|
|
|
@@ -58,10 +58,10 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
58
58
|
try:
|
|
59
59
|
self.base_result_url = self.get_property("base_result_url").strip()
|
|
60
60
|
except AttributeError:
|
|
61
|
-
|
|
61
|
+
self.log.exception("")
|
|
62
62
|
|
|
63
63
|
self.adapter = self._create_data_adapter()
|
|
64
|
-
|
|
64
|
+
self.log.debug("[ISPYB] Proxy address: %s" % self.proxy)
|
|
65
65
|
|
|
66
66
|
# Add the proposal codes defined in the configuration xml file
|
|
67
67
|
# to a directory. Used by translate()
|
|
@@ -72,15 +72,15 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
72
72
|
try:
|
|
73
73
|
self._translations[code]["ldap"] = proposal.ldap
|
|
74
74
|
except AttributeError:
|
|
75
|
-
|
|
75
|
+
self.log.exception("")
|
|
76
76
|
try:
|
|
77
77
|
self._translations[code]["ispyb"] = proposal.ispyb
|
|
78
78
|
except AttributeError:
|
|
79
|
-
|
|
79
|
+
self.log.exception("")
|
|
80
80
|
try:
|
|
81
81
|
self._translations[code]["gui"] = proposal.gui
|
|
82
82
|
except AttributeError:
|
|
83
|
-
|
|
83
|
+
self.log.exception("")
|
|
84
84
|
|
|
85
85
|
def _create_data_adapter(self) -> ISPyBDataAdapter:
|
|
86
86
|
return ISPyBDataAdapter(
|
|
@@ -175,12 +175,10 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
175
175
|
for sample in self.samples:
|
|
176
176
|
try:
|
|
177
177
|
if str(sample.get("limsID")) == str(sample_id):
|
|
178
|
-
|
|
179
|
-
"Sample found by limsID=%s" % (sample_id)
|
|
180
|
-
)
|
|
178
|
+
self.log.debug("Sample found by limsID=%s" % (sample_id))
|
|
181
179
|
return sample
|
|
182
180
|
except (TypeError, KeyError):
|
|
183
|
-
|
|
181
|
+
self.log.exception("")
|
|
184
182
|
return None
|
|
185
183
|
|
|
186
184
|
def get_samples(self, lims_name):
|
|
@@ -189,7 +187,7 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
189
187
|
self.samples = self.adapter.get_samples(
|
|
190
188
|
self.session_manager.active_session.proposal_id
|
|
191
189
|
)
|
|
192
|
-
|
|
190
|
+
self.log.debug(
|
|
193
191
|
"get_samples. %s samples retrieved. proposal_id=%s lims_name=%s"
|
|
194
192
|
% (
|
|
195
193
|
len(self.samples),
|
|
@@ -200,9 +198,9 @@ class ISPyBAbstractLIMS(AbstractLims):
|
|
|
200
198
|
return self.samples
|
|
201
199
|
|
|
202
200
|
def create_session(self, proposal_id: str):
|
|
203
|
-
|
|
201
|
+
self.log.debug("create_session. proposal_id=%s" % proposal_id)
|
|
204
202
|
session_manager = self.adapter.create_session(proposal_id, self.beamline_name)
|
|
205
|
-
|
|
203
|
+
self.log.debug("Session created. proposal_id=%s" % proposal_id)
|
|
206
204
|
return session_manager
|
|
207
205
|
|
|
208
206
|
def store_energy_scan(self, energyscan_dict):
|
|
@@ -22,7 +22,6 @@ BeamlineTestMockup
|
|
|
22
22
|
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
-
import logging
|
|
26
25
|
import os
|
|
27
26
|
import tempfile
|
|
28
27
|
from datetime import datetime
|
|
@@ -79,7 +78,7 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
79
78
|
self.test_directory = os.path.join(
|
|
80
79
|
tempfile.gettempdir(), "mxcube", "beamline_test"
|
|
81
80
|
)
|
|
82
|
-
|
|
81
|
+
self.log.debug(
|
|
83
82
|
"BeamlineTest: directory for test "
|
|
84
83
|
"reports not defined. Set to: %s" % self.test_directory
|
|
85
84
|
)
|
|
@@ -93,7 +92,7 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
93
92
|
for test in eval(self.get_property("available_tests")):
|
|
94
93
|
self.available_tests_dict[test] = TEST_DICT[test]
|
|
95
94
|
except Exception:
|
|
96
|
-
|
|
95
|
+
self.log.debug(
|
|
97
96
|
"BeamlineTest: Available tests are "
|
|
98
97
|
+ "not defined in xml. Setting all tests as available."
|
|
99
98
|
)
|
|
@@ -103,7 +102,7 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
103
102
|
try:
|
|
104
103
|
self.startup_test_list = eval(self.get_property("startup_tests"))
|
|
105
104
|
except Exception:
|
|
106
|
-
|
|
105
|
+
self.log.debug("BeamlineTest: Test list not defined.")
|
|
107
106
|
|
|
108
107
|
if self.get_property("run_tests_at_startup") is True:
|
|
109
108
|
self.start_test_queue(self.startup_test_list)
|
|
@@ -114,24 +113,22 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
114
113
|
"""
|
|
115
114
|
if create_report:
|
|
116
115
|
try:
|
|
117
|
-
|
|
116
|
+
self.log.debug(
|
|
118
117
|
"BeamlineTest: Creating directory %s" % self.test_directory
|
|
119
118
|
)
|
|
120
119
|
if not os.path.exists(self.test_directory):
|
|
121
120
|
os.makedirs(self.test_directory)
|
|
122
121
|
|
|
123
|
-
|
|
122
|
+
self.log.debug(
|
|
124
123
|
"BeamlineTest: Creating source directory %s"
|
|
125
124
|
% self.test_source_directory
|
|
126
125
|
)
|
|
127
126
|
if not os.path.exists(self.test_source_directory):
|
|
128
127
|
os.makedirs(self.test_source_directory)
|
|
129
128
|
except Exception:
|
|
130
|
-
|
|
131
|
-
"BeamlineTest: Unable to create test directories"
|
|
132
|
-
)
|
|
129
|
+
self.log.warning("BeamlineTest: Unable to create test directories")
|
|
133
130
|
|
|
134
|
-
|
|
131
|
+
self.log.exception("")
|
|
135
132
|
return
|
|
136
133
|
|
|
137
134
|
self.results_list = []
|
|
@@ -140,7 +137,7 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
140
137
|
test_method_name = "test_" + test_name.lower()
|
|
141
138
|
if hasattr(self, test_method_name):
|
|
142
139
|
if test_name in TEST_DICT:
|
|
143
|
-
|
|
140
|
+
self.log.debug(
|
|
144
141
|
"BeamlineTest: Executing test %s (%s)"
|
|
145
142
|
% (test_name, TEST_DICT[test_name])
|
|
146
143
|
)
|
|
@@ -198,7 +195,7 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
198
195
|
msg
|
|
199
196
|
% (TEST_COLORS_FONT[False], test_method_name, TEST_DICT[test_name])
|
|
200
197
|
)
|
|
201
|
-
|
|
198
|
+
self.log.error(
|
|
202
199
|
"BeamlineTest: Test method %s not available" % test_method_name
|
|
203
200
|
)
|
|
204
201
|
self.results_html_list.append("</p>\n<hr>")
|
|
@@ -290,11 +287,11 @@ class BeamlineTestMockup(HardwareObject):
|
|
|
290
287
|
output_file.close()
|
|
291
288
|
|
|
292
289
|
self.emit("htmlGenerated", html_filename)
|
|
293
|
-
|
|
290
|
+
self.log.info(
|
|
294
291
|
"BeamlineTest: Test result written in file %s" % html_filename
|
|
295
292
|
)
|
|
296
293
|
except Exception:
|
|
297
|
-
|
|
294
|
+
self.log.error(
|
|
298
295
|
"BeamlineTest: Unable to generate html report file %s" % html_filename
|
|
299
296
|
)
|
|
300
297
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import os
|
|
3
2
|
import time
|
|
4
3
|
|
|
@@ -241,7 +240,7 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
241
240
|
if not os.path.exists(archive_directory):
|
|
242
241
|
os.makedirs(archive_directory)
|
|
243
242
|
except Exception:
|
|
244
|
-
|
|
243
|
+
self.log.exception(
|
|
245
244
|
"EnergyScan: could not create energy scan result directory."
|
|
246
245
|
)
|
|
247
246
|
self.store_energy_scan()
|
|
@@ -252,7 +251,7 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
252
251
|
scan_file_raw = open(scan_file_raw_filename, "w")
|
|
253
252
|
archive_file_raw = open(archive_file_raw_filename, "w")
|
|
254
253
|
except Exception:
|
|
255
|
-
|
|
254
|
+
self.log.exception(
|
|
256
255
|
"EnergyScan: could not create energy scan result raw file"
|
|
257
256
|
)
|
|
258
257
|
self.store_energy_scan()
|
|
@@ -283,7 +282,7 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
283
282
|
comm = "Mockup results"
|
|
284
283
|
self.energy_scan_parameters["edgeEnergy"] = 0.1
|
|
285
284
|
self.thEdge = self.energy_scan_parameters["edgeEnergy"]
|
|
286
|
-
|
|
285
|
+
self.log.info(
|
|
287
286
|
"th. Edge %s ; chooch results are pk=%f, ip=%f, rm=%f"
|
|
288
287
|
% (self.thEdge, pk, ip, rm)
|
|
289
288
|
)
|
|
@@ -336,25 +335,25 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
336
335
|
archive_file_png_filename
|
|
337
336
|
)
|
|
338
337
|
try:
|
|
339
|
-
|
|
338
|
+
self.log.info(
|
|
340
339
|
"Rendering energy scan and Chooch " + "graphs to PNG file : %s",
|
|
341
340
|
scan_file_png_filename,
|
|
342
341
|
)
|
|
343
342
|
canvas.print_figure(scan_file_png_filename, dpi=80)
|
|
344
343
|
except Exception:
|
|
345
|
-
|
|
344
|
+
self.log.exception("could not print figure")
|
|
346
345
|
try:
|
|
347
|
-
|
|
346
|
+
self.log.info(
|
|
348
347
|
"Saving energy scan to archive " + "directory for ISPyB : %s",
|
|
349
348
|
archive_file_png_filename,
|
|
350
349
|
)
|
|
351
350
|
canvas.print_figure(archive_file_png_filename, dpi=80)
|
|
352
351
|
except Exception:
|
|
353
|
-
|
|
352
|
+
self.log.exception("could not save figure")
|
|
354
353
|
|
|
355
354
|
self.store_energy_scan()
|
|
356
355
|
|
|
357
|
-
|
|
356
|
+
self.log.info("<chooch> returning")
|
|
358
357
|
self.emit(
|
|
359
358
|
"choochFinished",
|
|
360
359
|
(
|
|
@@ -392,7 +391,7 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
392
391
|
for el in self.config.elements["element"]:
|
|
393
392
|
elements.append({"symbol": el["symbol"], "energy": el["energy"]})
|
|
394
393
|
except IndexError:
|
|
395
|
-
|
|
394
|
+
self.log.exception("")
|
|
396
395
|
return elements
|
|
397
396
|
|
|
398
397
|
#
|
|
@@ -436,7 +435,7 @@ class EnergyScanMockup(AbstractEnergyScan):
|
|
|
436
435
|
"""
|
|
437
436
|
with cleanup(self.ready_event.set):
|
|
438
437
|
self.energy_scan_parameters["endTime"] = time.strftime("%Y-%m-%d %H:%M:%S")
|
|
439
|
-
|
|
438
|
+
self.log.debug("Energy Scan: finished")
|
|
440
439
|
self.scanning = False
|
|
441
440
|
self.energy_scan_parameters["startEnergy"] = self.scan_data[-1][0] / 1000.0
|
|
442
441
|
self.energy_scan_parameters["endEnergy"] = self.scan_data[-1][1] / 1000.0
|
|
@@ -35,7 +35,7 @@ class ISPyBClientMockup(ProposalTypeISPyBLims):
|
|
|
35
35
|
try:
|
|
36
36
|
self.base_result_url = self.get_property("base_result_url").strip()
|
|
37
37
|
except AttributeError:
|
|
38
|
-
|
|
38
|
+
self.log.exception("")
|
|
39
39
|
|
|
40
40
|
self.__test_proposal = {
|
|
41
41
|
"status": {"code": "ok"},
|
|
@@ -111,7 +111,9 @@ class ISPyBClientMockup(ProposalTypeISPyBLims):
|
|
|
111
111
|
"is_scheduled_time": True,
|
|
112
112
|
"is_scheduled_beamline": True,
|
|
113
113
|
"user_portal_URL": "",
|
|
114
|
-
"data_portal_URL":
|
|
114
|
+
"data_portal_URL": (
|
|
115
|
+
"https://data2.esrf.fr/investigation/1565334143/datasets"
|
|
116
|
+
),
|
|
115
117
|
"logbook_URL": "https://data2.esrf.fr/investigation/1565334143/logbook",
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -219,12 +221,10 @@ class ISPyBClientMockup(ProposalTypeISPyBLims):
|
|
|
219
221
|
:returns: None
|
|
220
222
|
|
|
221
223
|
"""
|
|
222
|
-
|
|
224
|
+
self.log.debug(
|
|
223
225
|
"Data collection parameters stored " + "in ISPyB: %s" % str(mx_collection)
|
|
224
226
|
)
|
|
225
|
-
|
|
226
|
-
"Beamline setup stored in ISPyB: %s" % str(bl_config)
|
|
227
|
-
)
|
|
227
|
+
self.log.debug("Beamline setup stored in ISPyB: %s" % str(bl_config))
|
|
228
228
|
|
|
229
229
|
return None, None
|
|
230
230
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# pylint: skip-file
|
|
2
2
|
|
|
3
|
-
import logging
|
|
4
3
|
import time
|
|
5
4
|
|
|
6
5
|
from PyTango import DeviceProxy
|
|
@@ -125,7 +124,7 @@ class LimaDetectorMockup:
|
|
|
125
124
|
|
|
126
125
|
@task
|
|
127
126
|
def start_acquisition(self):
|
|
128
|
-
|
|
127
|
+
self.log.info("Mockup detector starts acquisition")
|
|
129
128
|
return
|
|
130
129
|
|
|
131
130
|
def stop(self):
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Class for cameras connected to framegrabbers run by Taco Device Servers"""
|
|
2
2
|
|
|
3
3
|
import atexit
|
|
4
|
-
import logging
|
|
5
4
|
import os
|
|
6
5
|
import signal
|
|
7
6
|
import subprocess
|
|
@@ -40,7 +39,7 @@ class MDCameraMockup(BaseHardwareObjects.HardwareObject):
|
|
|
40
39
|
self._current_stream_size = (0, 0)
|
|
41
40
|
|
|
42
41
|
def init(self):
|
|
43
|
-
|
|
42
|
+
self.log.info("initializing camera object")
|
|
44
43
|
if self.get_property("interval"):
|
|
45
44
|
self.pollInterval = self.get_property("interval")
|
|
46
45
|
self.stopper = False # self.polling_timer(self.pollInterval, self.poll)
|
|
@@ -60,14 +59,14 @@ class MDCameraMockup(BaseHardwareObjects.HardwareObject):
|
|
|
60
59
|
return self.connected
|
|
61
60
|
|
|
62
61
|
def poll(self) -> None:
|
|
63
|
-
|
|
62
|
+
self.log.info("going to poll images")
|
|
64
63
|
while not self.stopper:
|
|
65
64
|
time.sleep(1)
|
|
66
65
|
try:
|
|
67
66
|
img = open(self.image, "rb").read()
|
|
68
67
|
self.emit("imageReceived", img, 659, 493)
|
|
69
68
|
except Exception:
|
|
70
|
-
|
|
69
|
+
self.log.exception("Could not read image")
|
|
71
70
|
|
|
72
71
|
def imageUpdated(self, value) -> None:
|
|
73
72
|
print("<HW> got new image")
|
|
@@ -119,7 +118,7 @@ class MDCameraMockup(BaseHardwareObjects.HardwareObject):
|
|
|
119
118
|
return (width, height, scale)
|
|
120
119
|
|
|
121
120
|
def clean_up(self):
|
|
122
|
-
|
|
121
|
+
self.log.info("Shutting down video_stream...")
|
|
123
122
|
os.kill(self._video_stream_process.pid, signal.SIGTERM)
|
|
124
123
|
|
|
125
124
|
def start_video_stream_process(self) -> None:
|
|
@@ -160,7 +159,7 @@ class MDCameraMockup(BaseHardwareObjects.HardwareObject):
|
|
|
160
159
|
for p in ps:
|
|
161
160
|
p.kill()
|
|
162
161
|
except psutil.NoSuchProcess:
|
|
163
|
-
|
|
162
|
+
self.log.exception("")
|
|
164
163
|
|
|
165
164
|
self._video_stream_process = None
|
|
166
165
|
|
|
@@ -45,7 +45,7 @@ class MicrodiffInOutMockup(HardwareObject):
|
|
|
45
45
|
tt = float(self.get_property("timeout"))
|
|
46
46
|
self.timeout = tt
|
|
47
47
|
except Exception:
|
|
48
|
-
|
|
48
|
+
self.log.exception("")
|
|
49
49
|
|
|
50
50
|
self.moves = dict((self.states[k], k) for k in self.states)
|
|
51
51
|
|
|
@@ -101,7 +101,7 @@ class MultiCollectMockup(AbstractMultiCollect, HardwareObject):
|
|
|
101
101
|
not failed,
|
|
102
102
|
failed_msg if failed else "Data collection successful",
|
|
103
103
|
)
|
|
104
|
-
|
|
104
|
+
self.log.info("data collection successful in loop")
|
|
105
105
|
self.emit("collectReady", (True,))
|
|
106
106
|
|
|
107
107
|
@task
|
|
@@ -17,7 +17,6 @@ between two Point objects.
|
|
|
17
17
|
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
import logging
|
|
21
20
|
import os
|
|
22
21
|
|
|
23
22
|
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
@@ -50,7 +49,7 @@ class ShapeHistoryMockup(HardwareObject):
|
|
|
50
49
|
:returns: None
|
|
51
50
|
"""
|
|
52
51
|
if self._drawing:
|
|
53
|
-
|
|
52
|
+
self.log.info(
|
|
54
53
|
"Setting previous drawing:" + str(self._drawing) + " to " + str(drawing)
|
|
55
54
|
)
|
|
56
55
|
|