Skip to content

Commit 8f0f1a0

Browse files
committed
Better encapsulation
1 parent b6ed291 commit 8f0f1a0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

bench_runner/result.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def _load_contents(filename: Path) -> dict[str, Any]:
4040
return json.load(fd)
4141

4242

43+
def clear_contents_cache() -> None:
44+
_load_contents.cache_clear()
45+
46+
4347
def _clean(string: str) -> str:
4448
"""
4549
Clean an arbitrary string to be suitable for a filename.

bench_runner/scripts/bisect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def parse_result(benchmark_json: PathLike) -> float:
4545
# The name of the benchmark in the JSON file may be different from the one
4646
# used to select the benchmark. Therefore, just take the mean of all the
4747
# benchmarks in the JSON file.
48-
result._load_contents.cache_clear()
48+
result.clear_contents_cache()
4949
r = result.Result.from_arbitrary_filename(benchmark_json)
5050
timing_data = r.get_timing_data()
5151
return float(np.mean([x.mean() for x in timing_data.values()]))

0 commit comments

Comments
 (0)