Example #1
0
def test_profile_modelling():
    grs = pytest.importorskip("dials.algorithms.profile_model.gaussian_rs")

    profile1 = grs.Model(None, 3, 0.1, 0.2, deg=True)
    dictionary = profile1.to_dict()
    profile2 = ProfileModelFactory.from_dict(dictionary)
    assert profile1.sigma_b() == pytest.approx(profile2.sigma_b(), abs=1e-7)
    assert profile1.sigma_m() == pytest.approx(profile2.sigma_m(), abs=1e-7)
Example #2
0
def test_profile_modelling():
    grs = pytest.importorskip("dials.algorithms.profile_model.gaussian_rs")
    if not hasattr(grs, "__file__"):
        pytest.skip("test requires DIALS")
        # this may pretend to be present in Python 3 without dials actually being there

    profile1 = grs.Model(None, 3, 0.1, 0.2, deg=True)
    dictionary = profile1.to_dict()
    profile2 = ProfileModelFactory.from_dict(dictionary)
    assert profile1.sigma_b() == pytest.approx(profile2.sigma_b(), abs=1e-7)
    assert profile1.sigma_m() == pytest.approx(profile2.sigma_m(), abs=1e-7)
 def _profile_from_dict(obj):
     ''' Get the profile from a dictionary. '''
     from dxtbx.model import ProfileModelFactory
     return ProfileModelFactory.from_dict(obj)
 def run(self):
   profile1 = NullProfile(10)
   dictionary = profile1.to_dict()
   profile2 = ProfileModelFactory.from_dict(dictionary)
   assert(profile1.parameter == profile2.parameter)
   print 'OK'
Example #5
0
 def _profile_from_dict(obj):
   ''' Get the profile from a dictionary. '''
   from dxtbx.model import ProfileModelFactory
   return ProfileModelFactory.from_dict(obj)
Example #6
0
 def run(self):
     profile1 = NullProfile(10)
     dictionary = profile1.to_dict()
     profile2 = ProfileModelFactory.from_dict(dictionary)
     assert (profile1.parameter == profile2.parameter)
     print 'OK'
Example #7
0
 def _profile_from_dict(obj):
     """ Get the profile from a dictionary. """
     return ProfileModelFactory.from_dict(obj)