You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from devito import Eq, Grid, TimeFunction, Operator
grid = Grid(shape=(4, 4))
u = TimeFunction(name='u', grid=grid)
usave = TimeFunction(name='usave', grid=grid, save=5)
eqns = [Eq(u.forward, u + 1),
Eq(usave, u)]
op = Operator(eqns)
assert op.arguments()['time_M'] == 4
op.apply()
assert all(np.all(usave.data[i] == i) for i in range(5))
The issue stems from the fact that op._dspace sets [0,1] as the time dimension's data space bounds, and that "1" will cause the default value to become 3. Which is clearly wrong, since 4 is perfectly fine here.
This violates the principle of least surprise.
The text was updated successfully, but these errors were encountered:
Reproducer
The issue stems from the fact that
op._dspace
sets [0,1] as the time dimension's data space bounds, and that "1" will cause the default value to become 3. Which is clearly wrong, since 4 is perfectly fine here.This violates the principle of least surprise.
The text was updated successfully, but these errors were encountered: