Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Seitz
pystencils
Commits
93351905
Commit
93351905
authored
2 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Add cache clearing function
parent
02e0a22d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/__init__.py
+2
-0
2 additions, 0 deletions
pystencils/__init__.py
pystencils/cache.py
+8
-0
8 additions, 0 deletions
pystencils/cache.py
with
10 additions
and
0 deletions
pystencils/__init__.py
+
2
−
0
View file @
93351905
...
...
@@ -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
'
,
...
...
This diff is collapsed.
Click to expand it.
pystencils/cache.py
+
8
−
0
View file @
93351905
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment