units refactor
This commit is contained in:
@@ -33,7 +33,7 @@ def test_simple():
|
||||
evaluator.set(wavelength=800e-9, t_num=1024, dt=5e-15)
|
||||
|
||||
assert evaluator.compute("t") == pytest.approx(math.tspace(t_num=1024, dt=5e-15))
|
||||
assert evaluator.compute("w0") == pytest.approx(units.nm(800))
|
||||
assert evaluator.compute("w0") == pytest.approx(units.nm_rads(800))
|
||||
|
||||
|
||||
def test_default_args_simple():
|
||||
|
||||
@@ -17,7 +17,7 @@ def test_scaling():
|
||||
def test_wl_dispersion():
|
||||
t = sc.tspace(t_num=1 << 15, dt=3.8e-15)
|
||||
w = sc.wspace(t)
|
||||
wl = sc.units.m.inv(w + sc.units.nm(1546))
|
||||
wl = sc.units.nm_rads(w + sc.units.nm_rads(1546)) * 1e-9
|
||||
wl_disp, ind_disp = sc.fiber.lambda_for_envelope_dispersion(wl, (950e-9, 4000e-9))
|
||||
assert all(np.diff(wl_disp) > 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user