Skip to content

Commit

Permalink
small cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Jun 3, 2024
1 parent 57dff37 commit 6091b7e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
29 changes: 20 additions & 9 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@ def sv_scheme(tcard):
return modsv


def get_ekos_convolution_type_2(kv):
"""Temporary finction to retrive the ekos convolution type.
Parameters
----------
kv: dict
pineappl grid metadata
"""
if "convolution_type_1" in kv:
eko1 = kv["convolution_type_1"]
# TODO: this case is now deprecated and should be remved from yadism and pinefarm
elif "polarized" in kv:
eko1 = "polPDF"
else:
eko1 = "PDF"
eko2 = kv.get("convolution_type_2", "PDF")
return eko1, eko2


def write_operator_card_from_file(
pineappl_path: os.PathLike,
default_card_path: os.PathLike,
Expand Down Expand Up @@ -155,15 +174,7 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):

# switch on polarization ?
kv = pineappl_grid.key_values()
if "convolution_type_1" in kv:
eko1 = kv["convolution_type_1"]
# TODO: this case is now deprecated and should be remved from yadism and pinefarm
elif "polarized" in kv:
eko1 = "polPDF"
else:
eko1 = "PDF"

eko2 = kv.get("convolution_type_2", "PDF")
eko1, eko2 = get_ekos_convolution_type_2(kv)

# fragmentation function grid?
if "timelike" in kv:
Expand Down
9 changes: 1 addition & 8 deletions src/pineko/theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,7 @@ def fk(self, name, grid_path, tcard, pdf):

# Do you need one or multiple ekos?
kv = grid.key_values()
if "convolution_type_1" in kv:
eko1 = kv["convolution_type_1"]
# TODO: this case is now deprecated and should be remved from yadism and pinefarm
elif "polarized" in kv:
eko1 = "polPDF"
else:
eko1 = "PDF"
eko2 = kv.get("convolution_type_2", "PDF")
eko1, eko2 = evolve.get_ekos_convolution_type_2(kv)

# setup data
if eko1 == eko2:
Expand Down

0 comments on commit 6091b7e

Please sign in to comment.