Skip to content

Commit 0b3dff7

Browse files
committed
add a functools.cache decorator to predictions / central predictions, as
the higher-level functions that are (usually called) by chi2/plotting/t0 functions
1 parent 4db4438 commit 0b3dff7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

validphys2/src/validphys/convolution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
import numpy as np
4444
import pandas as pd
4545

46-
from validphys.pdfbases import evolution
4746
import validphys
47+
from validphys.pdfbases import evolution
4848

4949
FK_FLAVOURS = evolution.to_known_elements(
5050
[
@@ -176,6 +176,7 @@ def _predictions(dataset, pdf, fkfunc):
176176
return opfunc(*all_predictions)
177177

178178

179+
@functools.cache
179180
def predictions(dataset, pdf):
180181
""" "Compute theory predictions for a given PDF and dataset. Information
181182
regading the dataset, on cuts, CFactors and combinations of FKTables is
@@ -227,6 +228,7 @@ def predictions(dataset, pdf):
227228
return _predictions(dataset, pdf, fk_predictions)
228229

229230

231+
@functools.cache
230232
def central_predictions(
231233
dataset: validphys.core.DataSetSpec, pdf: validphys.core.PDF
232234
) -> pd.DataFrame:

0 commit comments

Comments
 (0)