Skip to content

Commit 7e99af4

Browse files
felixhekhornalecandido
authored andcommitted
Fix actually eko/qnt/hq and add unit test
1 parent 36d2e1b commit 7e99af4

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

src/eko/quantities/heavy_quarks.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,6 @@ def t(self, value: T):
6565
MatchingScales = HeavyQuarks[MatchingScale]
6666

6767

68-
def scales_from_ratios(
69-
ratios: MatchingRatios, masses: HeavyQuarkMasses
70-
) -> MatchingScales:
71-
"""Convert ratios to squared scales.
72-
73-
.. todo::
74-
75-
make this a method
76-
77-
"""
78-
return MatchingScales(*(np.power(ratios, 2.0) * np.power(masses, 2.0)).tolist())
79-
80-
8168
# TODO: upgrade the following to StrEnum (requires py>=3.11) with that, it is
8269
# possible to replace all non-alias right sides with calls to enum.auto()
8370

@@ -120,11 +107,6 @@ class HeavyInfo(DictLike):
120107
matching_ratios: MatchingRatios
121108
"""Matching scale of heavy quark masses"""
122109

123-
@property
124-
def matching_scales(self) -> MatchingScales:
125-
"""Compute matching scales."""
126-
return scales_from_ratios(self.matching_ratios, self.masses)
127-
128110
@property
129111
def squared_ratios(self) -> List[float]:
130112
"""Squared ratios of matching scales."""

tests/eko/test_quantities.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from math import nan
22

3+
import numpy as np
34
import pytest
45

56
from eko.quantities import heavy_quarks as hq
@@ -37,11 +38,12 @@ def test_HeavyInfo():
3738
intrinsic_flavors=[4, 5],
3839
masses=hq.HeavyQuarkMasses(
3940
[
40-
hq.QuarkMassRef(2.0, nan),
41-
hq.QuarkMassRef(5.0, nan),
42-
hq.QuarkMassRef(100.0, nan),
41+
hq.QuarkMassRef([2.0, nan]),
42+
hq.QuarkMassRef([5.0, nan]),
43+
hq.QuarkMassRef([100.0, nan]),
4344
]
4445
),
4546
masses_scheme=hq.QuarkMassScheme.POLE,
4647
matching_ratios=hq.MatchingRatios([1.5, 2.0, 3.0]),
4748
)
49+
np.testing.assert_allclose(i.squared_ratios, [2.25, 4.0, 9.0])

0 commit comments

Comments
 (0)