def test_goniometer(): # Construct the object g1 = Goniometer(rotation_axis=(1, 2, 3), fixed_rotation_matrix=(1, 2, 3, 4, 5, 6, 7, 8, 9)) # Create a dictionary and get the object back d = g1.to_dict() g2 = Goniometer.from_dict(d) assert g2 == g1
def __call__(self): from dxtbx.model import Goniometer # Construct the object g1 = Goniometer(rotation_axis=(1, 2, 3), fixed_rotation_matrix=(1, 2, 3, 4, 5, 6, 7, 8, 9)) # Create a dictionary and get the object back d = g1.to_dict() g2 = Goniometer.from_dict(d) assert (g2 == g1) print 'OK'
def __call__(self): from dxtbx.model import Goniometer # Construct the object g1 = Goniometer( rotation_axis=(1, 2, 3), fixed_rotation_matrix=(1, 2, 3, 4, 5, 6, 7, 8, 9)) # Create a dictionary and get the object back d = g1.to_dict() g2 = Goniometer.from_dict(d) assert(g2 == g1) print 'OK'
def tst_goniometer(self): from dxtbx.model import Goniometer, GoniometerFactory g1 = Goniometer((1, 0, 0), (1, 0, 0, 0, 1, 0, 0, 0, 1)) d = g1.to_dict() g2 = GoniometerFactory.from_dict(d) assert (d['rotation_axis'] == (1, 0, 0)) assert (d['fixed_rotation'] == (1, 0, 0, 0, 1, 0, 0, 0, 1)) assert (g1 == g2) # Test with a template and partial dictionary d2 = {'rotation_axis': (0, 1, 0)} g3 = GoniometerFactory.from_dict(d2, d) assert (g3.get_rotation_axis() == (0, 1, 0)) assert (g3.get_fixed_rotation() == (1, 0, 0, 0, 1, 0, 0, 0, 1)) assert (g2 != g3)
def test_goniometer(): g1 = Goniometer((1, 0, 0), (1, 0, 0, 0, 1, 0, 0, 0, 1)) d = g1.to_dict() g2 = GoniometerFactory.from_dict(d) assert d["rotation_axis"] == (1, 0, 0) assert d["fixed_rotation"] == (1, 0, 0, 0, 1, 0, 0, 0, 1) assert g1 == g2 assert "setting_rotation_at_scan_points" not in d # Test with a template and partial dictionary d2 = {"rotation_axis": (0, 1, 0)} g3 = GoniometerFactory.from_dict(d2, d) assert g3.get_rotation_axis() == (0, 1, 0) assert g3.get_fixed_rotation() == (1, 0, 0, 0, 1, 0, 0, 0, 1) assert g2 != g3
def test_goniometer(): from dxtbx.model import Goniometer, GoniometerFactory g1 = Goniometer((1, 0, 0), (1, 0, 0, 0, 1, 0, 0, 0, 1)) d = g1.to_dict() g2 = GoniometerFactory.from_dict(d) assert d['rotation_axis'] == (1, 0, 0) assert d['fixed_rotation'] == (1, 0, 0, 0, 1, 0, 0, 0, 1) assert g1 == g2 assert 'setting_rotation_at_scan_points' not in d # Test with a template and partial dictionary d2 = {'rotation_axis': (0, 1, 0)} g3 = GoniometerFactory.from_dict(d2, d) assert g3.get_rotation_axis() == (0, 1, 0) assert g3.get_fixed_rotation() == (1, 0, 0, 0, 1, 0, 0, 0, 1) assert g2 != g3