def test_nm_from_t_zero(self): # boundary condition: 0 result = get_nm_from_t(0) self.assertIsNotNone(result) self.assertAlmostEquals(result, 1e+16) result = get_nm_from_t(0, zero_for_inf=True) self.assertIsNotNone(result) self.assertAlmostEquals(result, 0)
def test_nm_from_t_negative(self): # boundary condition: negative result = get_nm_from_t(-6.17588983) self.assertIsNotNone(result) self.assertAlmostEquals(result, -0.716)
def get_nm_from_t(self, theta): """Converts a theta position to a nanometer value""" return get_nm_from_t(theta, wavelength=self.wavelength, zero_for_inf=True)
def get_nm_from_t(self, theta): """Converts a theta position to a nanometer value""" return get_nm_from_t( theta, wavelength=self.wavelength, zero_for_inf=True )