Skip to content

Commit

Permalink
tests: Update caching test and fix minor decomposition bug
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Nov 6, 2024
1 parent 405ed78 commit abb0b72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devito/data/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def index_glb_to_loc(self, *args, rel=True):
if self.loc_empty:
return None
abs_ofs, side = args
if side is LEFT:
if side == LEFT:
rel_ofs = self.glb_min + abs_ofs - base
if abs_ofs >= base and abs_ofs <= top:
return rel_ofs
Expand Down
5 changes: 5 additions & 0 deletions tests/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,11 @@ def test_sparse_function(self, operate_on_empty_cache):
# Now we should be back to the original state plus the dimension bounds
# (x_m, x_M, y_m, y_M)
assert len(_SymbolCache) == init_cache_size + 4
# Delete the grid and check that all symbols are subsequently garbage collected
del grid
for n in (10, 3, 0):
clear_cache()
assert len(_SymbolCache) == n

def test_after_indexification(self):
"""
Expand Down

0 comments on commit abb0b72

Please sign in to comment.