Skip to content

Commit

Permalink
Add cache_dir checking
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelefevre committed Oct 6, 2023
1 parent 53c0776 commit 5cb80b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "secd"
version = "0.0.5"
version = "0.0.6"
authors = [
{ name="Emil Karlsson", email="emilk2@kth.se" },
{ name="Pierre Le Fevre", email="pierrelf@kth.se" }
Expand Down
11 changes: 10 additions & 1 deletion src/secd/secd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
import os
import hashlib
import inspect
import yaml

CACHE_DIR = "cache"
def get_cache_dir():
with open("secd.yml", "r") as f:
run_meta = yaml.load(f)
if "cache_dir" in run_meta:
return run_meta["cache_dir"]

return "cache"

CACHE_DIR = get_cache_dir()

def generate_cache_key(func, args, kwargs):
# Create a unique cache key based on the function name, args, kwargs, and source code
Expand Down

0 comments on commit 5cb80b1

Please sign in to comment.