예제 #1
0
 def test_isowidths(self):
     """check ConstantPeakWidth properties bisowidth, uisowidth.
     """
     from numpy import pi
     cnpw = self.pwconst
     dwpw = DebyeWallerPeakWidth()
     bnds = self._genbonds(1, 2)
     w0 = dwpw.calculate(bnds)
     cnpw.uisowidth = self.tio2stru[[0, -1]].Uisoequiv.mean()
     self.assertAlmostEqual(w0, cnpw.calculate(bnds), 12)
     self.assertAlmostEqual(cnpw.bisowidth, 8 * pi**2 * cnpw.uisowidth, 12)
     return
예제 #2
0
class TestDebyeWallerPeakWidth(unittest.TestCase):
    def setUp(self):
        self.pwm = DebyeWallerPeakWidth()
        return

    def test_type(self):
        """check DebyeWallerPeakWidth.type
        """
        self.assertEqual('debye-waller', self.pwm.type())
        self.assertEqual(0, len(self.pwm._namesOfDoubleAttributes()))
        return

    def test_pickling(self):
        """check pickling of DebyeWallerPeakWidth class.
        """
        self.assertEqual('debye-waller', self.pwm.type())
        pwm = self.pwm
        pwm2 = cPickle.loads(cPickle.dumps(pwm))
        self.assertEqual(DebyeWallerPeakWidth, type(pwm2))
        return
예제 #3
0
class TestDebyeWallerPeakWidth(unittest.TestCase):

    def setUp(self):
        self.pwm = DebyeWallerPeakWidth()
        return


    def test_type(self):
        """check DebyeWallerPeakWidth.type
        """
        self.assertEqual('debye-waller', self.pwm.type())
        self.assertEqual(0, len(self.pwm._namesOfDoubleAttributes()))
        return


    def test_pickling(self):
        """check pickling of DebyeWallerPeakWidth class.
        """
        self.assertEqual('debye-waller', self.pwm.type())
        pwm = self.pwm
        pwm2 = cPickle.loads(cPickle.dumps(pwm))
        self.assertEqual(DebyeWallerPeakWidth, type(pwm2))
        return
예제 #4
0
 def setUp(self):
     self.pwm = DebyeWallerPeakWidth()
     return
예제 #5
0
 def setUp(self):
     self.pwm = DebyeWallerPeakWidth()
     return