@pytest.mark.parametrize((u'in_val', u'in_unit'), [([0.1, 5000.0, 10000.0], u.AA), ([100000.0, 2.0, 1.0], (u.micron ** (-1))), ([2.99792458e+19, 599584916000000.0, 299792458000000.0], u.Hz), ([1.98644568e-14, 3.97289137e-19, 1.98644568e-19], u.J)])
def test_spectral4(in_val, in_unit):
 out_units = [(u.micron ** (-1)), (u.radian / u.micron)]
 answers = [[100000.0, 2.0, 1.0], [628318.531, 12.5663706, 6.28318531]]
 for (out_unit, ans) in zip(out_units, answers):
  a = in_unit.to(out_unit, in_val, u.spectral())
  assert_allclose(a, ans)
  b = out_unit.to(in_unit, ans, u.spectral())
  assert_allclose(b, in_val)

@ pytest . mark . parametrize ( ( u'in_val' , u'in_unit' ) , [ ( [ 0.1 , 5000.0 , 10000.0 ] , u . AA ) , ( [ 100000.0 , 2.0 , 1.0 ] , ( u . micron ** ( - 1 ) ) ) , ( [ 2.99792458e+19 , 599584916000000.0 , 299792458000000.0 ] , u . Hz ) , ( [ 1.98644568e-14 , 3.97289137e-19 , 1.98644568e-19 ] , u . J ) ] ) def test_spectral4 ( in_val , in_unit ) : out_units = [ ( u . micron ** ( - 1 ) ) , ( u . radian / u . micron ) ] answers = [ [ 100000.0 , 2.0 , 1.0 ] , [ 628318.531 , 12.5663706 , 6.28318531 ] ] for ( out_unit , ans ) in zip ( out_units , answers ) : a = in_unit . to ( out_unit , in_val , u . spectral ( ) ) assert_allclose ( a , ans ) b = out_unit . to ( in_unit , ans , u . spectral ( ) ) assert_allclose ( b , in_val )
wave number conversion w .