Skip to content

Commit

Permalink
tests: Restore redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Nov 3, 2023
1 parent a731796 commit 701b896
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
2 changes: 1 addition & 1 deletion tests/test_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def test_basic(self):

eqns = [Eq(u.forward, u + 1.), Eq(u2.forward, u2 + 1.), Eq(usave, u)]
op = Operator(eqns)
op.apply(time_M=nt-2)
op.apply()
assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1))
assert np.all([np.allclose(u2.data[i], i) for i in range(nt)])
assert np.all([np.allclose(usave.data[i], i*factor)
Expand Down
26 changes: 0 additions & 26 deletions tests/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2019,29 +2019,3 @@ def test_indirection(self):
assert np.all(f.data[0] == 0.)
assert np.all(f.data[i] == 3. for i in range(1, 10))

def test_indirection_v2(self):
nt = 10
grid = Grid(shape=(4, 4))
time = grid.time_dim
x, y = grid.dimensions

f = TimeFunction(name='f', grid=grid, save=nt)
g = TimeFunction(name='g', grid=grid)

idx = time
s = Indirection(name='ofs0', mapped=idx)

eqns = [
Eq(s, idx),
Eq(f[s, x, y], g + 3.)
]

op = Operator(eqns)

assert op._dspace[time].lower == 0
assert op._dspace[time].upper == 0
assert op.arguments()['time_M'] == nt - 1

op.apply()

assert np.all(f.data[i] == 3. for i in range(1, 10))

0 comments on commit 701b896

Please sign in to comment.