Skip to content

Commit 5a84b91

Browse files
committed
added single imports in __init__ multiclosure, removed extra central predictions function
1 parent 500ce4d commit 5a84b91

3 files changed

Lines changed: 14 additions & 21 deletions

File tree

validphys2/examples/true_pos_neg_closuretests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dataspecs:
1111
fits:
1212
- {id: 241227_dis_ict_lam0_weighted_hera575_fs_828872, label: "DIS weighted HERA 575, fs: 1"}
1313
- {id: 241227_dis_ict_lam0_weighted_hera575_fs_239494, label: "DIS weighted HERA 575, fs: 2"}
14-
- {id: 241227_dis_ict_lam0_weighted_hera575_fs_444227, label: "DIS weighted HERA 575, fs: 3"}
14+
# - {id: 241227_dis_ict_lam0_weighted_hera575_fs_444227, label: "DIS weighted HERA 575, fs: 3"}
1515
# - {id: 241227_dis_ict_lam0_weighted_hera575_fs_623856, label: "DIS weighted HERA 575, fs: 4"}
1616
# - {id: 241227_dis_ict_lam0_weighted_hera575_fs_227492, label: "DIS weighted HERA 575, fs: 5"}
1717
# - {id: 241227_dis_ict_lam0_weighted_hera575_fs_745924, label: "DIS weighted HERA 575, fs: 6"}
@@ -40,7 +40,7 @@ dataspecs:
4040
fits:
4141
- {id: 8_6_2023_21_55_4_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_828872, label: "DIS lambda 0, fs: 1"}
4242
- {id: 8_6_2023_21_38_13_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_239494, label: "DIS lambda 0, fs: 2"}
43-
- {id: 8_6_2023_21_41_39_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_444227, label: "DIS lambda 0, fs: 3"}
43+
# - {id: 8_6_2023_21_41_39_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_444227, label: "DIS lambda 0, fs: 3"}
4444
# - {id: 8_6_2023_21_42_26_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_623856, label: "DIS lambda 0, fs: 4"}
4545
# - {id: 8_6_2023_21_43_13_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_227492, label: "DIS lambda 0, fs: 5"}
4646
# - {id: 8_6_2023_21_44_1_mnc_dis_pt1_type2_inconsistent_HERANC_commit_a6f0b1539_filterseed_745924, label: "DIS lambda 0, fs: 6"}

validphys2/src/validphys/closuretest/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,27 @@
1414
from validphys.closuretest.multiclosure_pseudodata import *
1515
from validphys.closuretest.inconsistent_closuretest.multiclosure_inconsistent_output import *
1616
from validphys.closuretest.multiclosure_nsigma_helpers import (
17+
central_member_chi2,
18+
chi2_nsigma_deviation,
19+
datasets_chi2_nsigma_deviation,
1720
fits_datasets_chi2_nsigma_deviation,
1821
fits_data,
1922
is_weighted,
2023
n_fits,
2124
)
2225
from validphys.closuretest.multiclosure_nsigma import (
26+
multiclosurefits_nsigma,
27+
dataspecs_multiclosurefits_nsigma,
28+
comp_nsigma_alpha,
29+
dataspecs_comp_nsigma_alpha,
2330
set_1,
2431
set_2,
2532
comp_set_1,
2633
set_3,
2734
probability_inconsistent,
35+
dataspecs_nsigma_alpha,
36+
nsigma_alpha,
37+
multiclosurefits_nsigma,
2838
)
2939
from validphys.closuretest.multiclosure_nsigma_output import (
3040
plot_all_sets,

validphys2/src/validphys/closuretest/multiclosure_nsigma_helpers.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
from nnpdf_data.coredata import CommonData
1313
from reportengine import collect
14-
from validphys import convolution
1514
from validphys.calcutils import calc_chi2
16-
from validphys.core import PDF, DataSetSpec
15+
from validphys.convolution import central_predictions
16+
from validphys.core import DataSetSpec
1717

1818
log = logging.getLogger(__name__)
1919

@@ -29,23 +29,6 @@ def reduced(self):
2929
return self.value / self.ndata
3030

3131

32-
def central_predictions(dataset: DataSetSpec, pdf: PDF) -> pd.DataFrame:
33-
"""
34-
Computes the central prediction (central PDF member) for a dataset.
35-
36-
Parameters
37-
----------
38-
dataset: validphys.core.DataSetSpec
39-
pdf: validphys.core.PDF
40-
41-
Returns
42-
-------
43-
pd.DataFrame
44-
index is datapoints, column is the central prediction.
45-
"""
46-
return convolution.central_predictions(dataset, pdf)
47-
48-
4932
def central_member_chi2(
5033
central_predictions: pd.DataFrame,
5134
sqrt_covmat: np.ndarray,

0 commit comments

Comments
 (0)