implement cache drop
This commit is contained in:
parent
4f7d9d71b3
commit
1a9561bc0d
2 changed files with 22 additions and 0 deletions
|
@ -8,6 +8,7 @@ from typing import Union
|
|||
from pyerrors import Obs, Corr, dump_object, load_object
|
||||
from hashlib import sha256
|
||||
from .tools import cached
|
||||
import shutil
|
||||
|
||||
|
||||
def write_measurement(path, ensemble, measurement, uuid, code, parameter_file=None):
|
||||
|
@ -194,3 +195,8 @@ def drop_record(path: str, meas_path: str):
|
|||
return
|
||||
else:
|
||||
raise ValueError("This measurement does not exist as a file!")
|
||||
|
||||
def drop_cache(path: str):
|
||||
cache_dir = os.path.join(path, ".cache")
|
||||
for f in os.listdir(cache_dir):
|
||||
shutil.rmtree(os.path.join(cache_dir, f))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue