Skip to content

Commit fef81c6

Browse files
author
George Bisbas
committed
compiler: Fix occurence of NullInterval after rebase
refresh revert unrelated changes from fix_2235 branch refresh
1 parent d4f6311 commit fef81c6

6 files changed

Lines changed: 17 additions & 41 deletions

File tree

devito/deprecations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ class DevitoDeprecation:
66

77
@cached_property
88
def coeff_warn(self):
9-
warn("The Coefficient API is deprecated and will be removed, coefficients should"
10-
" be passed directly to the derivative object `u.dx(weights=...)",
9+
warn("The Coefficient API is deprecated and will be removed, coefficients should "
10+
"be passed directly to the derivative object `u.dx(weights=...)",
1111
DeprecationWarning, stacklevel=2)
1212
return
1313

1414
@cached_property
1515
def symbolic_warn(self):
16-
warn("coefficients='symbolic' is deprecated, coefficients should"
17-
" be passed directly to the derivative object `u.dx(weights=...)",
16+
warn("coefficients='symbolic' is deprecated, coefficients should "
17+
"be passed directly to the derivative object `u.dx(weights=...)",
1818
DeprecationWarning, stacklevel=2)
1919
return
2020

devito/ir/clusters/cluster.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,12 @@ def dspace(self):
476476
# intersecting intervals with matching only dimensions
477477
for f, v in parts.items():
478478
for i in v:
479-
# oobs check is not required but helps reduce
480-
# interval reconstruction
481-
if i.dim in oobs and i.dim in f.dimensions:
479+
if i.dim in self.ispace and i.dim in f.dimensions:
480+
# oobs check is not required but helps reduce
481+
# interval reconstruction
482482
ii = intervals[i.dim].intersection(v[i.dim])
483-
intervals = intervals.set_upper(i.dim, ii.upper)
483+
if not ii.is_Null:
484+
intervals = intervals.set_upper(i.dim, ii.upper)
484485

485486
# E.g., `db0 -> time`, but `xi NOT-> x`
486487
intervals = intervals.promote(lambda d: not d.is_Sub)

devito/types/dimension.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ def _arg_check(self, args, size, interval):
354354
from devito.symbolics import normalize_args
355355
upper = interval.upper.subs(normalize_args(args))
356356
if args[self.max_name] + upper >= size:
357-
raise InvalidArgument("OOB detected due to %s=%d" % (self.max_name,
358-
args[self.max_name]))
357+
raise InvalidArgument(f"OOB detected due to "
358+
f"{self.max_name}={args[self.max_name]}")
359359

360360
# Allow the specific case of max=min-1, which disables the loop
361361
if args[self.max_name] < args[self.min_name]-1:

examples/userapi/02_apply.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@
143143
" 'y_m': 0,\n",
144144
" 'y_size': 4,\n",
145145
" 'y_M': 3,\n",
146-
" 'h_x': 0.33333334,\n",
147-
" 'h_y': 0.33333334,\n",
148-
" 'o_x': 0.0,\n",
149-
" 'o_y': 0.0,\n",
150-
" 'timers': <cparam 'P' (0x7f3ce4f15110)>}"
146+
" 'h_x': np.float32(0.33333334),\n",
147+
" 'h_y': np.float32(0.33333334),\n",
148+
" 'o_x': np.float32(0.0),\n",
149+
" 'o_y': np.float32(0.0),\n",
150+
" 'timers': <cparam 'P' (0x75b734deb6a0)>}"
151151
]
152152
},
153153
"execution_count": 5,

tests/test_buffering.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -785,23 +785,3 @@ def test_multi_cond():
785785

786786
for i in range(nt):
787787
assert np.allclose(f.data[i], i*2)
788-
789-
def test_default_timeM():
790-
"""
791-
MFE for issue #2235
792-
"""
793-
grid = Grid(shape=(4, 4))
794-
795-
u = TimeFunction(name='u', grid=grid)
796-
usave = TimeFunction(name='usave', grid=grid, save=5)
797-
798-
eqns = [Eq(u.forward, u + 1),
799-
Eq(usave, u)]
800-
801-
op = Operator(eqns)
802-
803-
assert op.arguments()['time_M'] == 4
804-
805-
op.apply()
806-
807-
assert all(np.all(usave.data[i] == i) for i in range(4))

tests/test_operator.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,11 +2159,6 @@ def test_indirection(self, nt, offset, epass):
21592159
assert op._dspace[time].lower == 0
21602160
assert op._dspace[time].upper == offset
21612161

2162-
op()
2163-
2164-
assert np.all(f.data[0] == 0.)
2165-
assert np.all(f.data[i] == 3. for i in range(1, 10))
2166-
21672162
if epass:
21682163
assert op.arguments()['time_M'] == nt - offset - 1
21692164
op()
@@ -2396,4 +2391,4 @@ def test_to_json(self):
23962391
assert json_object['device'] == summary['device']
23972392

23982393
# Clean up
2399-
os.remove("memory_estimate_output.json")
2394+
os.remove("memory_estimate_output.json")

0 commit comments

Comments
 (0)