DiamondLightSource/dodal

Better error on PVI connection failures

Open

#1,188 建立於 2025年4月23日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (12 fork)auto 404
good first issue

倉庫指標

Star
 (4 star)
PR 合併指標
 (PR 指標待抓取)

描述

When doing a dodal connect with PVI devices and one of the PVs fails to connect the message is very verbose. e.g. in the case where beam_center failed I get:

fastcs_eiger: NotConnected:
    drv: NotConnected:
        detector: RuntimeError: fastcs_eiger-drv-detector: cannot provision ['beam_center'] from BL03I-EA-EIGER-02:Detector:PVI: {'abort': {'x': 'BL03I-EA-EIGER-02:Detector:Abort'}, 'arm': {'x': 'BL03I-EA-EIGER-02:Detector:Arm'}, 'auto_summation': {'r': 'BL03I-EA-EIGER-02:Detector:AutoSummation_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:AutoSummation'}, 'beam_center_x': {'r': 'BL03I-EA-EIGER-02:Detector:BeamCenterX_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:BeamCenterX'}, 'beam_center_y': {'r': 'BL03I-EA-EIGER-02:Detector:BeamCenterY_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:BeamCenterY'}, 'bit_depth_image': {'r': 'BL03I-EA-EIGER-02:Detector:BitDepthImage'}, 'bit_depth_readout': {'r': 'BL03I-EA-EIGER-02:Detector:BitDepthReadout'}, 'cancel': {'x': 'BL03I-EA-EIGER-02:Detector:Cancel'}, 'chi_increment': {'r': 'BL03I-EA-EIGER-02:Detector:ChiIncrement_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:ChiIncrement'}, 'chi_start': {'r': 'BL03I-EA-EIGER-02:Detector:ChiStart_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:ChiStart'}, 'compression': {'r': 'BL03I-EA-EIGER-02:Detector:Compression_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Compression'}, 'count_time': {'r': 'BL03I-EA-EIGER-02:Detector:CountTime_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:CountTime'}, 'counting_mode': {'r': 'BL03I-EA-EIGER-02:Detector:CountingMode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:CountingMode'}, 'countrate_correction_applied': {'r': 'BL03I-EA-EIGER-02:Detector:CountrateCorrectionApplied_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:CountrateCorrectionApplied'}, 'countrate_correction_count_cutoff': {'r': 'BL03I-EA-EIGER-02:Detector:CountrateCorrectionCountCutoff'}, 'data_collection_date': {'r': 'BL03I-EA-EIGER-02:Detector:DataCollectionDate'}, 'description': {'r': 'BL03I-EA-EIGER-02:Detector:Description'}, 'detector_distance': {'r': 'BL03I-EA-EIGER-02:Detector:DetectorDistance_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:DetectorDistance'}, 'detector_number': {'r': 'BL03I-EA-EIGER-02:Detector:DetectorNumber'}, 'detector_readout_time': {'r': 'BL03I-EA-EIGER-02:Detector:DetectorReadoutTime'}, 'disarm': {'x': 'BL03I-EA-EIGER-02:Detector:Disarm'}, 'eiger_fw_version': {'r': 'BL03I-EA-EIGER-02:Detector:EigerFwVersion'}, 'element': {'r': 'BL03I-EA-EIGER-02:Detector:Element_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Element'}, 'error': {'r': 'BL03I-EA-EIGER-02:Detector:Error'}, 'extg_mode': {'r': 'BL03I-EA-EIGER-02:Detector:ExtgMode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:ExtgMode'}, 'fast_arm': {'r': 'BL03I-EA-EIGER-02:Detector:FastArm_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:FastArm'}, 'flatfield_correction_applied': {'r': 'BL03I-EA-EIGER-02:Detector:FlatfieldCorrectionApplied_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:FlatfieldCorrectionApplied'}, 'frame_count_time': {'r': 'BL03I-EA-EIGER-02:Detector:FrameCountTime'}, 'frame_time': {'r': 'BL03I-EA-EIGER-02:Detector:FrameTime_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:FrameTime'}, 'humidity': {'r': 'BL03I-EA-EIGER-02:Detector:Humidity'}, 'incident_energy': {'r': 'BL03I-EA-EIGER-02:Detector:IncidentEnergy_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:IncidentEnergy'}, 'incident_particle_type': {'r': 'BL03I-EA-EIGER-02:Detector:IncidentParticleType'}, 'initialize': {'x': 'BL03I-EA-EIGER-02:Detector:Initialize'}, 'instrument_name': {'r': 'BL03I-EA-EIGER-02:Detector:InstrumentName_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:InstrumentName'}, 'kappa_increment': {'r': 'BL03I-EA-EIGER-02:Detector:KappaIncrement_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:KappaIncrement'}, 'kappa_start': {'r': 'BL03I-EA-EIGER-02:Detector:KappaStart_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:KappaStart'}, 'link_0': {'r': 'BL03I-EA-EIGER-02:Detector:Link0'}, 'link_1': {'r': 'BL03I-EA-EIGER-02:Detector:Link1'}, 'mask_to_zero': {'r': 'BL03I-EA-EIGER-02:Detector:MaskToZero_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:MaskToZero'}, 'nexpi': {'r': 'BL03I-EA-EIGER-02:Detector:Nexpi_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Nexpi'}, 'nimages': {'r': 'BL03I-EA-EIGER-02:Detector:Nimages_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Nimages'}, 'ntrigger': {'r': 'BL03I-EA-EIGER-02:Detector:Ntrigger_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Ntrigger'}, 'ntriggers_skipped': {'r': 'BL03I-EA-EIGER-02:Detector:NtriggersSkipped_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:NtriggersSkipped'}, 'number_of_excluded_pixels': {'r': 'BL03I-EA-EIGER-02:Detector:NumberOfExcludedPixels'}, 'omega_increment': {'r': 'BL03I-EA-EIGER-02:Detector:OmegaIncrement_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:OmegaIncrement'}, 'omega_start': {'r': 'BL03I-EA-EIGER-02:Detector:OmegaStart_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:OmegaStart'}, 'phi_increment': {'r': 'BL03I-EA-EIGER-02:Detector:PhiIncrement_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:PhiIncrement'}, 'phi_start': {'r': 'BL03I-EA-EIGER-02:Detector:PhiStart_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:PhiStart'}, 'photon_energy': {'r': 'BL03I-EA-EIGER-02:Detector:PhotonEnergy_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:PhotonEnergy'}, 'pixel_mask_applied': {'r': 'BL03I-EA-EIGER-02:Detector:PixelMaskApplied_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:PixelMaskApplied'}, 'roi_mode': {'r': 'BL03I-EA-EIGER-02:Detector:RoiMode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:RoiMode'}, 'sample_name': {'r': 'BL03I-EA-EIGER-02:Detector:SampleName_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:SampleName'}, 'sensor_material': {'r': 'BL03I-EA-EIGER-02:Detector:SensorMaterial'}, 'sensor_thickness': {'r': 'BL03I-EA-EIGER-02:Detector:SensorThickness'}, 'series_unique_id': {'r': 'BL03I-EA-EIGER-02:Detector:SeriesUniqueId'}, 'software_version': {'r': 'BL03I-EA-EIGER-02:Detector:SoftwareVersion'}, 'source_name': {'r': 'BL03I-EA-EIGER-02:Detector:SourceName_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:SourceName'}, 'stale_parameters': {'r': 'BL03I-EA-EIGER-02:Detector:StaleParameters'}, 'state': {'r': 'BL03I-EA-EIGER-02:Detector:State'}, 'temperature': {'r': 'BL03I-EA-EIGER-02:Detector:Temperature'}, 'threshold_1_energy': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold1Energy_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Threshold1Energy'}, 'threshold_1_mode': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold1Mode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Threshold1Mode'}, 'threshold_1_number_of_excluded_pixels': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold1NumberOfExcludedPixels'}, 'threshold_2_energy': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold2Energy_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Threshold2Energy'}, 'threshold_2_mode': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold2Mode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Threshold2Mode'}, 'threshold_2_number_of_excluded_pixels': {'r': 'BL03I-EA-EIGER-02:Detector:Threshold2NumberOfExcludedPixels'}, 'threshold_difference_lower_threshold': {'r': 'BL03I-EA-EIGER-02:Detector:ThresholdDifferenceLowerThreshold'}, 'threshold_difference_mode': {'r': 'BL03I-EA-EIGER-02:Detector:ThresholdDifferenceMode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:ThresholdDifferenceMode'}, 'threshold_difference_upper_threshold': {'r': 'BL03I-EA-EIGER-02:Detector:ThresholdDifferenceUpperThreshold'}, 'threshold_energy': {'r': 'BL03I-EA-EIGER-02:Detector:ThresholdEnergy_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:ThresholdEnergy'}, 'time': {'r': 'BL03I-EA-EIGER-02:Detector:Time'}, 'total_flux': {'r': 'BL03I-EA-EIGER-02:Detector:TotalFlux_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TotalFlux'}, 'trigger': {'x': 'BL03I-EA-EIGER-02:Detector:Trigger'}, 'trigger_exposure': {'r': 'BL03I-EA-EIGER-02:Detector:TriggerExposure_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TriggerExposure'}, 'trigger_mode': {'r': 'BL03I-EA-EIGER-02:Detector:TriggerMode_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TriggerMode'}, 'trigger_start_delay': {'r': 'BL03I-EA-EIGER-02:Detector:TriggerStartDelay_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TriggerStartDelay'}, 'two_theta_increment': {'r': 'BL03I-EA-EIGER-02:Detector:TwoThetaIncrement_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TwoThetaIncrement'}, 'two_theta_start': {'r': 'BL03I-EA-EIGER-02:Detector:TwoThetaStart_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:TwoThetaStart'}, 'virtual_pixel_correction_applied': {'r': 'BL03I-EA-EIGER-02:Detector:VirtualPixelCorrectionApplied_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:VirtualPixelCorrectionApplied'}, 'wavelength': {'r': 'BL03I-EA-EIGER-02:Detector:Wavelength_RBV', 'w': 'BL03I-EA-EIGER-02:Detector:Wavelength'}, 'x_pixel_size': {'r': 'BL03I-EA-EIGER-02:Detector:XPixelSize'}, 'x_pixels_in_detector': {'r': 'BL03I-EA-EIGER-02:Detector:XPixelsInDetector'}, 'y_pixel_size': {'r': 'BL03I-EA-EIGER-02:Detector:YPixelSize'}, 'y_pixels_in_detector': {'r': 'BL03I-EA-EIGER-02:Detector:YPixelsInDetector'}}

This is in contrast to a usual device where I get something like:

    odin: NotConnected:
        nodes: NotConnected:
            0: NotConnected:
                writing: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP0:HDF:Writing
                connected: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP0:Connected
            1: NotConnected:
                writing: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP1:HDF:Writing
                connected: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP1:Connected
            2: NotConnected:
                writing: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP2:HDF:Writing
                connected: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP2:Connected
            3: NotConnected:
                writing: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP3:HDF:Writing
                connected: NotConnected: ca://BL03I-EA-ODIN-01:FP:FP3:Connected
        capture: NotConnected:

This makes reading the output very hard. For a PVI connection failure we may want all the dict keys but probably not all the other info. Even this may be too much, particularly if multiple PVI connections fail

Acceptance Criteria

  • When a PVI device fails to connect on dodal connect it produces a nicer error message

貢獻者指南