Skip to content

Commit 93e0668

Browse files
committed
Make kernel_cache_hit property private.
1 parent 213961b commit 93e0668

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

src/loch/_sampler.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -760,16 +760,8 @@ def pop(self) -> None:
760760
self._backend.pop_context()
761761

762762
@property
763-
def kernel_cache_hit(self) -> bool:
764-
"""
765-
Whether kernel compilation was satisfied from cache.
766-
767-
Returns
768-
-------
769-
770-
cache_hit: bool
771-
True if kernels were loaded from cache, False if freshly compiled.
772-
"""
763+
def _kernel_cache_hit(self) -> bool:
764+
"""Whether kernel compilation was satisfied from cache."""
773765
return self._backend.cache_hit
774766

775767
def system(self) -> _Any:

tests/test_energy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ def _create_and_run(seed):
429429
sampler2 = _create_and_run(seed=42)
430430

431431
# Verify cache behaviour.
432-
assert not sampler1.kernel_cache_hit, "First sampler should compile from source"
433-
assert sampler2.kernel_cache_hit, "Second sampler should use cached kernels"
432+
assert not sampler1._kernel_cache_hit, "First sampler should compile from source"
433+
assert sampler2._kernel_cache_hit, "Second sampler should use cached kernels"
434434

435435
# Verify energy consistency.
436436
energy1_coul = sampler1._debug["energy_coul"]

0 commit comments

Comments
 (0)