def test_build_initial_display_table_for_four_circle(self): self.cm = YouConstraintManager(None, {'mu': 0, NUNAME: 0}) print self.cm.build_display_table_lines() eq_(self.cm.build_display_table_lines(), [ ' REF SAMP', ' ------ ------', ' a_eq_b eta', ' alpha chi', ' beta phi', ' psi' ])
def test_build_initial_display_table_with_fixed_detector(self): self.cm = YouConstraintManager(None, {NUNAME: 0}) print self.cm.build_display_table_lines() eq_(self.cm.build_display_table_lines(), [ ' REF SAMP', ' ------ ------', ' a_eq_b mu', ' alpha eta', ' beta chi', ' psi phi' ])
def setup_method(self): diffcalc.util.COLOURISE_TERMINAL_OUTPUT = False self.hardware_monitor = Mock() self.hardware_monitor.get_position.return_value = (1., ) * 6 self.hardware_monitor.get_axes_names.return_value = [ 'mu', 'delta', NUNAME, 'eta', 'chi', 'phi' ] self.cm = YouConstraintManager(self.hardware_monitor)
def test_build_initial_display_table_with_fixed_sample(self): self.cm = YouConstraintManager(None, {'mu': 0}) print self.cm.build_display_table_lines() eq_(self.cm.build_display_table_lines(), [ ' DET REF SAMP', ' ------ ------ ------', ' delta a_eq_b eta', ' %s alpha chi' % NUNAME.ljust(6), ' qaz beta phi', ' naz psi' ])
def setup_method(self): self.mock_ubcalc = createMockUbcalc(None) self.mock_geometry = createMockDiffractometerGeometry() names = ['delta', NUNAME, 'mu', 'eta', 'chi', 'phi'] self.mock_hardware = SimpleHardwareAdapter(names) self.constraints = YouConstraintManager(self.mock_hardware) self.calc = YouHklCalculator(self.mock_ubcalc, self.mock_geometry, self.mock_hardware, self.constraints) self.mock_hardware.set_lower_limit('delta', 0) self.mock_hardware.set_upper_limit('delta', 179.999) self.mock_hardware.set_lower_limit(NUNAME, 0) self.mock_hardware.set_upper_limit(NUNAME, 179.999) self.mock_hardware.set_lower_limit('mu', 0) self.mock_hardware.set_lower_limit('eta', 0) self.mock_hardware.set_lower_limit('chi', -10) self.places = 11
from __future__ import absolute_import from diffcalc.hkl.common import getNameFromScannableOrString from diffcalc.util import command from diffcalc.hkl.you.calc import YouHklCalculator from diffcalc import settings import diffcalc.ub.ub from diffcalc.hkl.you.constraints import YouConstraintManager __all__ = ['allhkl', 'con', 'uncon', 'hklcalc', 'constraint_manager'] _fixed_constraints = settings.geometry.fixed_constraints # @UndefinedVariable constraint_manager = YouConstraintManager(_fixed_constraints) hklcalc = YouHklCalculator(diffcalc.ub.ub.ubcalc, constraint_manager) def __str__(self): return hklcalc.__str__() @command def con(*args): """ con -- list available constraints and values con <name> {val} -- constrains and optionally sets one constraint con <name> {val} <name> {val} <name> {val} -- clears and then fully constrains
def setup_method(self): self.cm = YouConstraintManager(None, {NUNAME: 0, 'mu': 0})
def setup_method(self): diffcalc.util.COLOURISE_TERMINAL_OUTPUT = False self.cm = YouConstraintManager() settings.geometry = SixCircle()
from __future__ import absolute_import from diffcalc.hkl.common import getNameFromScannableOrString from diffcalc.util import command from diffcalc.hkl.you.calc import YouHklCalculator from diffcalc import settings import diffcalc.ub.ub from diffcalc.hkl.you.constraints import YouConstraintManager __all__ = ['allhkl', 'con', 'uncon', 'hklcalc', 'constraint_manager'] _fixed_constraints = settings.geometry.fixed_constraints # @UndefinedVariable constraint_manager = YouConstraintManager(settings.hardware, _fixed_constraints) hklcalc = YouHklCalculator(diffcalc.ub.ub.ubcalc, settings.geometry, settings.hardware, constraint_manager) def __str__(self): return hklcalc.__str__() @command def con(*args): """ con -- list available constraints and values con <name> {val} -- constrains and optionally sets one constraint con <name> {val} <name> {val} <name> {val} -- clears and then fully constrains