Skip to content

Commit

Permalink
Change simFONLL to num_fonll
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Oct 3, 2023
1 parent 5bca6e7 commit a2998a3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion benchmarks/bench_evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@pytest.mark.parametrize("theoryid,is_mixed", [(400, False), (208, True)])
def benchmark_write_operator_card_from_file_simFONLL(
def benchmark_write_operator_card_from_file_num_fonll(
tmp_path, test_files, test_configs, theoryid, is_mixed
):
tcard = pineko.theory_card.load(theoryid)
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/bench_fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def benchmark_produce_fonll_tcards(
for path in tcard_paths_list:
with open(path, encoding="UTF-8") as f:
theorycards.append(yaml.safe_load(f))
for simFONLL_tcard, fns, nfff, po, part in zip(
for num_fonll_tcard, fns, nfff, po, part in zip(
theorycards,
pineko.fonll.MIXED_FNS_LIST if is_mixed else pineko.fonll.FNS_LIST,
pineko.fonll.MIXED_NFFF_LIST if is_mixed else pineko.fonll.NFFF_LIST,
pineko.fonll.produce_ptos(tcard["FNS"], is_mixed),
pineko.fonll.MIXED_PARTS_LIST if is_mixed else pineko.fonll.PARTS_LIST,
):
assert simFONLL_tcard["FNS"] == fns
assert simFONLL_tcard["NfFF"] == nfff
assert simFONLL_tcard["PTO"] == po
assert simFONLL_tcard["FONLLParts"] == part
assert num_fonll_tcard["FNS"] == fns
assert num_fonll_tcard["NfFF"] == nfff
assert num_fonll_tcard["PTO"] == po
assert num_fonll_tcard["FONLLParts"] == part
4 changes: 2 additions & 2 deletions src/pineko/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def is_fonll_b(fns, lumi):
return False


def issimFONLL(FNS):
"""Check if the FNS is a simFONLL FNS."""
def is_num_fonll(FNS):
"""Check if the FNS is a num_fonll FNS."""
return FNS in ["FONLL-FFNS", "FONLL-FFN0"]


Expand Down
4 changes: 2 additions & 2 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
matching_scales=heavy_quarks.MatchingScales(masses * thresholds_ratios),
origin=(tcard["Q0"] ** 2, tcard["nf0"]),
)
# If we are producing simFONLL FKs we need to look to NfFF...
if check.issimFONLL(tcard["FNS"]):
# If we are producing num_fonll FKs we need to look to NfFF...
if check.is_num_fonll(tcard["FNS"]):
nfff = tcard["NfFF"]
operators_card["mugrid"] = [(float(np.sqrt(q2)), int(nfff)) for q2 in q2_grid]
else:
Expand Down
2 changes: 1 addition & 1 deletion src/pineko/theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def fk(self, name, grid_path, tcard, pdf):
grid.lumi(),
):
max_as += 1
# NB: This would not happen for simFONLL
# NB: This would not happen for num_fonll
max_al = 0
# check for sv
if not np.isclose(xir, 1.0):
Expand Down
10 changes: 5 additions & 5 deletions tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def test_is_fonll_b():
assert pineko.check.is_fonll_b(fns, lumi_crazy) is False


def test_issimFONLL():
simFONLL_FNS = "FONLL-FFN0"
nonsimFONLL_FNS = "FONLL-B"
assert pineko.check.issimFONLL(simFONLL_FNS) is True
assert pineko.check.issimFONLL(nonsimFONLL_FNS) is False
def test_is_num_fonll():
num_fonll_FNS = "FONLL-FFN0"
non_num_fonll_FNS = "FONLL-B"
assert pineko.check.is_num_fonll(num_fonll_FNS) is True
assert pineko.check.is_num_fonll(non_num_fonll_FNS) is False


class Fake_grid:
Expand Down

0 comments on commit a2998a3

Please sign in to comment.