def test_acceleration_voltage_to_wavelength_array(): av = np.array([100000, 200000, 300000]) # In Volt wavelength = acceleration_voltage_to_wavelength(av) wl = np.array([3.701e-12, 2.507e-12, 1.968e-12]) # In pm assert np.allclose(wl, wavelength, rtol=0.001, atol=0.0)
def test_acceleration_voltage_to_wavelength(av, wl): wavelength = acceleration_voltage_to_wavelength(av) assert np.allclose(wl, wavelength, rtol=0.001, atol=0.0)