def test_2t_from_nm_zero(self): # boundary condition: 0 result = get_2t_from_nm(0) self.assertIsNotNone(result) self.assertAlmostEquals(result, 0)
def test_2t_from_nm_positive(self): # boundary condition: positive result = get_2t_from_nm(0.716) self.assertIsNotNone(result) self.assertAlmostEquals(result, 12.351779659)
def get_2t_from_nm(self, nm): """ Converts a nanometer value to a 2-theta position""" return get_2t_from_nm(nm, wavelength=self.wavelength)