Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsl: Move SubDimension thickness evaluation to the thicknesses themselves #2470

Merged
merged 20 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests: Update caching test and fix minor decomposition bug
  • Loading branch information
EdCaunt committed Nov 11, 2024
commit abf00f861fd54e1d03361828c47d9c527f4096ab
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
mloubout marked this conversation as resolved.
Show resolved Hide resolved
# Delete the grid and check that all symbols are subsequently garbage collected
del grid
for n in (10, 3, 0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 10 init_cache_size ? If so just

del grid
assert len(_SymbolCache) == init_cache_size

And everything was deleted that's that's needed to check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Init cache size is 11 (and consists of a different set of symbols)

clear_cache()
assert len(_SymbolCache) == n

def test_after_indexification(self):
"""
Expand Down