Skip to content

Commit

Permalink
BEHAVIOR: switch from xxh3_64 to xxh64
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Dec 18, 2024
1 parent a667657 commit abb4779
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ampform/sympy/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_system_cache_directory() -> str:

def get_readable_hash(obj) -> str:
b = to_bytes(obj)
h = xxhash.xxh3_64(b)
h = xxhash.xxh64(b)
return h.hexdigest()


Expand Down
12 changes: 6 additions & 6 deletions tests/sympy/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
@pytest.mark.parametrize(
("expected_hash", "assumptions"),
[
("8eb22db72da08d18", dict()),
("40b00fbe1e8ddf6b", dict(real=True)),
("94569e99c6b4ceec", dict(rational=True)),
("87ecd62a4c584b2a", dict()),
("1c4981af01b2fc14", dict(real=True)),
("115ed5f321a7fe96", dict(rational=True)),
],
)
def test_get_readable_hash(
Expand All @@ -47,13 +47,13 @@ def test_get_readable_hash_energy_dependent_width():
meson_radius=d,
)
h = get_readable_hash(expr)
assert h == "eee5788b2adb017c"
assert h == "e722efd64af3d92b"


def test_get_readable_hash_large(amplitude_model: tuple[str, HelicityModel]):
formalism, model = amplitude_model
expected_hash = {
"canonical-helicity": "5d0e0a326b9f7266",
"helicity": "83149d2218ff4aea",
"canonical-helicity": "67a26cb9955c17b8",
"helicity": "5636f9e0f8a20ad4",
}[formalism]
assert get_readable_hash(model.expression) == expected_hash

0 comments on commit abb4779

Please sign in to comment.