diff --git a/mumble/mumble.py b/mumble/mumble.py index 73e7831..7fc4c06 100644 --- a/mumble/mumble.py +++ b/mumble/mumble.py @@ -9,6 +9,7 @@ import pandas as pd import pickle +import platformdirs from psm_utils.io import read_file, write_file from psm_utils import PSMList, PSM, Peptidoform from psm_utils.utils import mz_to_mass @@ -781,9 +782,7 @@ def _get_cache_file_path(self): return: str: path to cache file """ - current_dir = os.path.dirname(os.path.realpath(__file__)) - parent_dir = os.path.dirname(current_dir) - cache_dir = os.path.join(parent_dir, "modification_cache") + cache_dir = platformdirs.user_cache_dir(appname="mumble") # Create the cache directory if it doesn't exist os.makedirs(cache_dir, exist_ok=True) diff --git a/pyproject.toml b/pyproject.toml index 42c1471..813f298 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,8 @@ dependencies = [ "pandas >= 1.5.0", "psm_utils >= 0.9.0", "numpy >= 1.23.0", - "rustyms >= 0.8.0" + "rustyms >= 0.8.0", + "platformdirs >= 3.0.0", ] requires-python = ">=3.10"