WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 114ad7d

Browse files
committed
use user cache dir
1 parent f435e91 commit 114ad7d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mumble/mumble.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import pandas as pd
1111
import pickle
12+
import platformdirs
1213
from psm_utils.io import read_file, write_file
1314
from psm_utils import PSMList, PSM, Peptidoform
1415
from psm_utils.utils import mz_to_mass
@@ -781,9 +782,7 @@ def _get_cache_file_path(self):
781782
return:
782783
str: path to cache file
783784
"""
784-
current_dir = os.path.dirname(os.path.realpath(__file__))
785-
parent_dir = os.path.dirname(current_dir)
786-
cache_dir = os.path.join(parent_dir, "modification_cache")
785+
cache_dir = platformdirs.user_cache_dir(appname="mumble")
787786

788787
# Create the cache directory if it doesn't exist
789788
os.makedirs(cache_dir, exist_ok=True)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ dependencies = [
2727
"pandas >= 1.5.0",
2828
"psm_utils >= 0.9.0",
2929
"numpy >= 1.23.0",
30-
"rustyms >= 0.8.0"
30+
"rustyms >= 0.8.0",
31+
"platformdirs >= 3.0.0",
3132
]
3233
requires-python = ">=3.10"
3334

0 commit comments

Comments
 (0)