Skip to content

Commit 4d5ee0f

Browse files
authored
Merge pull request #28 from HEP-PBSP/fix-python-version-test
Fix tests
2 parents b6078a1 + b88c218 commit 4d5ee0f

File tree

8 files changed

+27
-19
lines changed

8 files changed

+27
-19
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
fail-fast: false
17-
matrix:
18-
python-version: ["3.11"]
1917

2018
steps:
2119
- uses: actions/checkout@v3

ci_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55

66
dependencies:
7-
- python >= 3.11
7+
- python >= 3.11,<3.14
88
- mpich
99
- lhapdf
1010
- pandoc

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55

66
dependencies:
7-
- python >= 3.11
7+
- python >= 3.11,<3.14
88
- mpich
99
- lhapdf
1010
- pandoc

wmin/runcards/shift_lhadf_members.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
...
88
If a file with index 0000 exists, it will be deleted before renaming to avoid collisions.
99
"""
10+
1011
import os
1112
import re
1213
import argparse

wmin/tests/regression_runcards/test_fit_wmin_mc_dis_L0.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ positivity: # Positivity datasets, used in the positi
2727
posdatasets:
2828
- {dataset: POSF2U, maxlambda: 1e6}
2929

30-
alpha: 1e-7
31-
lambda_positivity: 0
30+
positivity_penalty_settings:
31+
positivity_penalty: False
32+
alpha: 1e-7
33+
lambda_positivity: 0
34+
35+
# Integrability Settings
36+
integrability_settings:
37+
integrability: False
3238

3339
use_fit_t0: True # Whether the t0 covariance is used in the chi2 loss.
3440
t0pdfset: NNPDF40_nnlo_as_01180 # The t0 PDF used to build the t0 covariance matrix.

wmin/tests/regression_runcards/test_fit_wmin_mc_had_L0.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ positivity: # Positivity datasets, used in the positi
2727
posdatasets:
2828
- {dataset: POSF2U, maxlambda: 1e6}
2929

30-
alpha: 1e-7
31-
lambda_positivity: 0
30+
positivity_penalty_settings:
31+
positivity_penalty: False
32+
alpha: 1e-7
33+
lambda_positivity: 0
34+
35+
# Integrability Settings
36+
integrability_settings:
37+
integrability: False
3238

3339
use_fit_t0: True # Whether the t0 covariance is used in the chi2 loss.
3440
t0pdfset: NNPDF40_nnlo_as_01180 # The t0 PDF used to build the t0 covariance matrix.

wmin/tests/test_wmin_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
mock_penalty_posdata = (
1616
lambda pdf, alpha, lambda_positivity, fast_kernel_arrays: jnp.array([0])
1717
)
18-
central_inv_covmat_index = Mock()
19-
central_inv_covmat_index.central_values = jnp.ones(N_MOCK_DATA)
20-
central_inv_covmat_index.inv_covmat = jnp.eye(N_MOCK_DATA)
18+
central_covmat_index = Mock()
19+
central_covmat_index.central_values = jnp.ones(N_MOCK_DATA)
20+
central_covmat_index.covmat = jnp.eye(N_MOCK_DATA)
21+
central_covmat_index.central_values_idx = jnp.arange(N_MOCK_DATA)
2122

2223
fast_kernel_arrays = ((jnp.ones(N_MOCK_DATA)),)
2324
positivity_fast_kernel_arrays = ((jnp.ones(N_MOCK_DATA)),)
@@ -58,7 +59,7 @@ def mock_bayesian_prior(rng):
5859

5960
SETUP = {
6061
"_penalty_posdata": mock_penalty_posdata,
61-
"central_inv_covmat_index": central_inv_covmat_index,
62+
"central_covmat_index": central_covmat_index,
6263
"fast_kernel_arrays": fast_kernel_arrays,
6364
"positivity_fast_kernel_arrays": positivity_fast_kernel_arrays,
6465
"_pred_data": mock_pred_data,

wmin/utils.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@
1010
import jax
1111
import numpy as np
1212
import pandas as pd
13-
from colibri.likelihood import LogLikelihood
14-
from colibri.loss_functions import chi2
1513

1614
from colibri.likelihood import LogLikelihood
1715
from colibri.constants import FLAVOUR_TO_ID_MAPPING, LHAPDF_XGRID
1816
from reportengine.table import table
1917

20-
2118
log = logging.getLogger(__name__)
2219

2320

@@ -85,7 +82,7 @@
8582
@table
8683
def likelihood_time(
8784
_penalty_posdata,
88-
central_inv_covmat_index,
85+
central_covmat_index,
8986
fast_kernel_arrays,
9087
positivity_fast_kernel_arrays,
9188
_pred_data,
@@ -142,17 +139,16 @@ def likelihood_time(
142139
res = RSS_MB()
143140
log.info(f"RSS: {res - init:.2f}MB")
144141

145-
central_values = central_inv_covmat_index.central_values
142+
central_values = central_covmat_index.central_values
146143
ndata = len(central_values)
147144

148145
log_likelihood = LogLikelihood(
149-
central_inv_covmat_index,
146+
central_covmat_index,
150147
pdf_model,
151148
FIT_XGRID,
152149
_pred_data,
153150
fast_kernel_arrays,
154151
positivity_fast_kernel_arrays,
155-
chi2,
156152
_penalty_posdata,
157153
positivity_penalty_settings=positivity_penalty_settings,
158154
integrability_penalty=integrability_penalty,

0 commit comments

Comments
 (0)