Skip to content

Commit

Permalink
ENH: integrate SymPy version in cache path
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Mar 9, 2024
1 parent 65c4465 commit 6051b43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ampform/sympy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from typing import TYPE_CHECKING, Iterable, Sequence, SupportsFloat

import sympy as sp
from importlib_metadata import version
from sympy.printing.conventions import split_super_sub
from sympy.printing.precedence import PRECEDENCE
from sympy.printing.pycode import _unpack_integral_limits # noqa: PLC2701
Expand Down Expand Up @@ -356,7 +357,8 @@ def perform_cached_doit(
"""
if cache_directory is None:
system_cache_dir = get_system_cache_directory()
cache_directory = Path(system_cache_dir) / "ampform"
sympy_version = version("sympy")
cache_directory = Path(system_cache_dir) / "ampform" / f"sympy-v{sympy_version}"
if not isinstance(cache_directory, Path):
cache_directory = Path(cache_directory)
cache_directory.mkdir(exist_ok=True, parents=True)
Expand Down

0 comments on commit 6051b43

Please sign in to comment.