Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Mar 7, 2024
1 parent b9c6dbd commit 63f0cd0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
12 changes: 6 additions & 6 deletions extras/data/machinery/generate/E142.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .utils import load, obs_template


def dump(src_path, target):
'''Generate the input card for E142 measurements.
"""Generate the input card for E142 measurements.
Parameters
----------
Expand All @@ -12,15 +14,13 @@ def dump(src_path, target):
dict
observables dictionary, corresponding to the runcard
'''
"""
obs = obs_template.copy()
data = load(src_path, 0, ["x", "Q2"])
dict_kins = [
dict(x=d["x"]["mid"], y=d["y"]["mid"], Q2=d["Q2"]["mid"])
for d in data
dict(x=d["x"]["mid"], y=d["y"]["mid"], Q2=d["Q2"]["mid"]) for d in data
]


obs["PolarizationDIS"] = 0.0 if "_F1" in target.parent.name else 1.0
observable_name = "F1_total" if "_F1" in target.parent.name else "g1_total"
obs["observables"] = {observable_name: dict_kins}
Expand All @@ -40,5 +40,5 @@ def dump(src_path, target):

# renaming
new_names = {
'e142_en_g1': 'E142_NC_58GEV_EN_G1',
"e142_en_g1": "E142_NC_58GEV_EN_G1",
}
16 changes: 8 additions & 8 deletions extras/data/machinery/generate/E143.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .utils import load, obs_template


def dump(src_path, target):
'''Generate the input card for E143 measurements.
"""Generate the input card for E143 measurements.
Parameters
----------
Expand All @@ -12,15 +14,13 @@ def dump(src_path, target):
dict
observables dictionary, corresponding to the runcard
'''
"""
obs = obs_template.copy()
data = load(src_path, 0, ["x", "Q2"])
dict_kins = [
dict(x=d["x"]["mid"], y=d["y"]["mid"], Q2=d["Q2"]["mid"])
for d in data
dict(x=d["x"]["mid"], y=d["y"]["mid"], Q2=d["Q2"]["mid"]) for d in data
]


obs["PolarizationDIS"] = 0.0 if "_F1" in target.parent.name else 1.0
observable_name = "F1_total" if "_F1" in target.parent.name else "g1_total"
obs["observables"] = {observable_name: dict_kins}
Expand All @@ -39,7 +39,7 @@ def dump(src_path, target):


# renaming
new_names = {
'e143_ep_g1': 'E143_NC_4GEV_EP_G1',
'e143_ed_g1': 'E143_NC_8GEV_ED_G1',
new_names = {
"e143_ep_g1": "E143_NC_4GEV_EP_G1",
"e143_ed_g1": "E143_NC_8GEV_ED_G1",
}
10 changes: 5 additions & 5 deletions extras/data/machinery/generate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
from . import (
BCDMS,
CHORUS,
COMPASS,
COMPASS15,
E142,
E143,
E154,
E155,
EMC,
SMC,
SMCSX,
COMPASS,
COMPASS15,
HERA,
HERMES,
HERMES97,
JLABE06,
JLABE97,
JLABE99,
JLABEG1B,
JLABEG1DVCS,
HERA,
NMC,
NUTEV,
POS,
SLAC,
SMC,
SMCSX,
utils,
)

Expand Down
1 change: 0 additions & 1 deletion extras/data/machinery/generate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np
import yaml

from yadmark.data import pineappl_xgrid

here = pathlib.Path(__file__).parent
Expand Down

0 comments on commit 63f0cd0

Please sign in to comment.