Skip to content
Snippets Groups Projects
Commit 93351905 authored by Markus Holzer's avatar Markus Holzer
Browse files

Add cache clearing function

parent 02e0a22d
Branches
Tags
1 merge request!313Add cache clearing function
......@@ -8,6 +8,7 @@ from .datahandling import create_data_handling
from .display_utils import get_code_obj, get_code_str, show_code, to_dot
from .field import Field, FieldType, fields
from .config import CreateKernelConfig
from .cache import clear_cache
from .kernel_decorator import kernel, kernel_config
from .kernelcreation import create_kernel, create_staggered_kernel
from .simp import AssignmentCollection
......@@ -27,6 +28,7 @@ __all__ = ['Field', 'FieldType', 'fields',
'assignment_from_stencil',
'SymbolCreator',
'create_data_handling',
'clear_cache',
'kernel', 'kernel_config',
'x_', 'y_', 'z_',
'x_staggered', 'y_staggered', 'z_staggered',
......
......@@ -59,6 +59,14 @@ def sharedmethodcache(cache_id: str):
return _decorator
def clear_cache():
"""
Clears the pystencils cache created by joblib.
"""
memory = Memory(cache_dir, verbose=0)
memory.clear(warn=False)
# Disable memory cache:
# disk_cache = lambda o: o
# disk_cache_no_fallback = lambda o: o
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment