Skip to content

Commit e92d994

Browse files
committed
test: Compelte fk table test adaption from the grid one
1 parent e88db0c commit e92d994

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pineappl_py/tests/test_fk_table.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55

66
class TestFkTable:
77
def fake_grid(self, bins=None):
8-
lumis = [pineappl.lumi.LumiEntry([(1, 21, 0.1)])]
8+
lumis = [pineappl.lumi.LumiEntry([(1, 21, 1.0)])]
99
orders = [pineappl.grid.Order(0, 0, 0, 0)]
1010
bin_limits = np.array([1e-7, 1e-3, 1] if bins is None else bins, dtype=float)
1111
subgrid_params = pineappl.subgrid.SubgridParams()
1212
g = pineappl.grid.Grid.create(lumis, orders, bin_limits, subgrid_params)
13+
g.set_key_value("lumi_id_types", "pdg_mc_ids")
1314
return g
1415

1516
def test_convolute_with_one(self):
@@ -27,14 +28,10 @@ def test_convolute_with_one(self):
2728
g.set_subgrid(0, 0, 0, subgrid)
2829
fk = pineappl.fk_table.FkTable.from_grid(g)
2930
np.testing.assert_allclose(
30-
fk.convolute_with_one(2212, lambda pid, x, q2: 0.0, lambda q2: 0.0),
31+
fk.convolute_with_one(2212, lambda pid, x, q2: 0.0),
3132
[0.0] * 2,
3233
)
3334
np.testing.assert_allclose(
34-
fk.convolute_with_one(2212, lambda pid, x, q2: 1, lambda q2: 1.0),
35-
[5e6 / 9999, 0.0],
36-
)
37-
np.testing.assert_allclose(
38-
fk.convolute_with_one(2212, lambda pid, x, q2: 1, lambda q2: 2.0),
39-
[2**3 * 5e6 / 9999, 0.0],
35+
fk.convolute_with_one(2212, lambda pid, x, q2: 1),
36+
[5e7 / 9999, 0.0],
4037
)

0 commit comments

Comments
 (0)