Commit f7b12e3b authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'streamlining' into 'NIFTy_6'

Resolve "Streamline arguments position"

See merge request !474
parents 9abb8a34 1af9ab0f
Pipeline #75223 failed with stages
in 3 minutes and 16 seconds
......@@ -52,7 +52,7 @@ def test_split_operator_first_axes_without_intersections(
)
assert consistency_check(split) is None
r = ift.from_random("normal", dom)
r = ift.from_random(dom, "normal")
split_r = split(r)
# This relies on the keys of the target domain either being in the order of
# insertion or being alphabetically sorted
......@@ -81,7 +81,7 @@ def test_split_operator_first_axes_with_intersections(
print(split_idx)
assert consistency_check(split) is None
r = ift.from_random("normal", dom)
r = ift.from_random(dom, "normal")
split_r = split(r)
# This relies on the keys of the target domain either being in the order of
# insertion or being alphabetically sorted
......
......@@ -45,8 +45,8 @@ def test_property(space, sigma):
def test_adjoint_times(space, sigma):
op = ift.HarmonicSmoothingOperator(space, sigma=sigma)
rand1 = ift.Field.from_random('normal', domain=space)
rand2 = ift.Field.from_random('normal', domain=space)
rand1 = ift.Field.from_random(domain=space, random_type='normal')
rand2 = ift.Field.from_random(domain=space, random_type='normal')
tt1 = rand1.s_vdot(op.times(rand2))
tt2 = rand2.s_vdot(op.adjoint_times(rand1))
assert_allclose(tt1, tt2)
......@@ -67,8 +67,7 @@ def test_smooth_regular1(sz, d, sigma, tp):
tol = _get_rtol(tp)
sp = ift.RGSpace(sz, distances=d)
smo = ift.HarmonicSmoothingOperator(sp, sigma=sigma)
inp = ift.Field.from_random(
domain=sp, random_type='normal', std=1, mean=4, dtype=tp)
inp = ift.Field.from_random(domain=sp, random_type='normal', dtype=tp, std=1, mean=4)
out = smo(inp)
assert_allclose(inp.s_sum(), out.s_sum(), rtol=tol, atol=tol)
......@@ -81,7 +80,6 @@ def test_smooth_regular2(sz1, sz2, d1, d2, sigma, tp):
tol = _get_rtol(tp)
sp = ift.RGSpace([sz1, sz2], distances=[d1, d2])
smo = ift.HarmonicSmoothingOperator(sp, sigma=sigma)
inp = ift.Field.from_random(
domain=sp, random_type='normal', std=1, mean=4, dtype=tp)
inp = ift.Field.from_random(domain=sp, random_type='normal', dtype=tp, std=1, mean=4)
out = smo(inp)
assert_allclose(inp.s_sum(), out.s_sum(), rtol=tol, atol=tol)
......@@ -35,7 +35,7 @@ def test_value_inserter(sp, seed):
with ift.random.Context(seed):
ind = tuple([int(ift.random.current_rng().integers(0, ss - 1)) for ss in sp.shape])
op = ift.ValueInserter(sp, ind)
f = ift.from_random('normal', op.domain)
f = ift.from_random(op.domain, 'normal')
inp = f.val
ret = op(f).val
assert_(ret[ind] == inp)
......
......@@ -35,11 +35,11 @@ def test_plots():
fft = ift.FFTOperator(rg_space2)
field_rg1_1 = ift.from_random('normal', rg_space1)
field_rg1_2 = ift.from_random('normal', rg_space1)
field_rg2 = ift.from_random('normal', rg_space2)
field_hp = ift.from_random('normal', hp_space)
field_gl = ift.from_random('normal', gl_space)
field_rg1_1 = ift.from_random(rg_space1, 'normal')
field_rg1_2 = ift.from_random(rg_space1, 'normal')
field_rg2 = ift.from_random(rg_space2, 'normal')
field_hp = ift.from_random(hp_space, 'normal')
field_gl = ift.from_random(gl_space, 'normal')
field_ps = ift.power_analyze(fft.times(field_rg2))
plot = ift.Plot()
......@@ -69,7 +69,7 @@ def test_mf_plot():
d1 = ift.DomainTuple.make([x_space, f_space])
d2 = ift.DomainTuple.make([f_space, x_space])
f1 = ift.from_random('normal', d1)
f1 = ift.from_random(d1, 'normal')
f2 = ift.makeField(d2, np.moveaxis(f1.val, -1, 0))
plot = ift.Plot()
......
......@@ -55,6 +55,6 @@ def test_exec_time():
def test_calc_pos():
dom = ift.RGSpace(12, harmonic=True)
op = ift.HarmonicTransformOperator(dom).ptw("exp")
fld = op(0.1*ift.from_random('normal', op.domain))
fld = op(0.1 * ift.from_random(op.domain, 'normal'))
pos = ift.calculate_position(op, fld)
ift.extra.assert_allclose(op(pos), fld, 1e-1, 1e-1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment