Skip to content

Commit ac00737

Browse files
committed
Fix eko/qnt/hq and add unit test
1 parent 940b3c3 commit ac00737

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

tests/eko/test_quantities.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from math import nan
2+
3+
import pytest
4+
5+
from eko.quantities import heavy_quarks as hq
6+
7+
8+
def test_HeavyQuarks():
9+
with pytest.raises(ValueError):
10+
hq.MatchingRatios([1, 2, 3, 4])
11+
l = hq.MatchingRatios([0.5, 2.0, 3.0])
12+
assert len(l) == 3
13+
assert l.c == 0.5
14+
assert l.b == 2.0
15+
assert l.t == 3.0
16+
l.c = 0.7
17+
assert len(l) == 3
18+
assert l.c == 0.7
19+
assert l.b == 2.0
20+
assert l.t == 3.0
21+
l.b = 2.7
22+
assert len(l) == 3
23+
assert l.c == 0.7
24+
assert l.b == 2.7
25+
assert l.t == 3.0
26+
l.t = 3.7
27+
assert len(l) == 3
28+
assert l.c == 0.7
29+
assert l.b == 2.7
30+
assert l.t == 3.7
31+
32+
33+
def test_HeavyInfo():
34+
i = hq.HeavyInfo(
35+
num_flavs_init=4,
36+
num_flavs_max_pdf=6,
37+
intrinsic_flavors=[4, 5],
38+
masses=hq.HeavyQuarkMasses(
39+
[
40+
hq.QuarkMassRef(2.0, nan),
41+
hq.QuarkMassRef(5.0, nan),
42+
hq.QuarkMassRef(100.0, nan),
43+
]
44+
),
45+
masses_scheme=hq.QuarkMassScheme.POLE,
46+
matching_ratios=hq.MatchingRatios([1.5, 2.0, 3.0]),
47+
)

0 commit comments

Comments
 (0)