def test_that_general_isis_default_values_are_set_up(self): state = StateMove() state.detectors = { DetectorType.LAB.value: StateMoveDetectors(), DetectorType.HAB.value: StateMoveDetectors() } self.assertEqual(state.sample_offset, 0.0) self.assertEqual(state.sample_offset_direction, CanonicalCoordinates.Z) self.assertEqual( state.detectors[DetectorType.HAB.value].x_translation_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].y_translation_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].z_translation_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].rotation_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].side_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].radius_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].x_tilt_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].y_tilt_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].z_tilt_correction, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].sample_centre_pos1, 0.0) self.assertEqual( state.detectors[DetectorType.HAB.value].sample_centre_pos2, 0.0)
def __init__(self): super(AllStates, self).__init__() self.data : StateData = StateData() self.move: StateMove = StateMove() self.reduction: StateReductionMode = StateReductionMode() self.slice: StateSliceEvent = StateSliceEvent() self.mask: StateMask = StateMask() self.wavelength: StateWavelength = StateWavelength() self.save: StateSave = StateSave() self.scale: StateScale = StateScale() self.adjustment: StateAdjustment = StateAdjustment() self.convert_to_q: StateConvertToQ = StateConvertToQ() self.compatibility: StateCompatibility = StateCompatibility()
def test_that_raises_if_the_short_detector_name_is_not_set_up(self): state = StateMove() state.detectors = {DetectorType.LAB.value: StateMoveDetectors(), DetectorType.HAB.value: StateMoveDetectors()} state.detectors[DetectorType.HAB.value].detector_name = "test" state.detectors[DetectorType.LAB.value].detector_name = "test" state.detectors[DetectorType.HAB.value].detector_name_short = "test" with self.assertRaises(ValueError): state.validate() state.detectors[DetectorType.LAB.value].detector_name_short = "test" self.assertIsNone(state.validate())