Skip to content

Commit

Permalink
Merge pull request #259 from NNPDF/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
felixhekhorn authored Jan 30, 2024
2 parents cf50107 + 9a81b11 commit c06562d
Show file tree
Hide file tree
Showing 39 changed files with 56 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: debug-statements
exclude: "debug.py"
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/runners/apfel_.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- process + FNS(3) + SV
- process + IC + FNS(2) + SV
"""

import pathlib

import numpy as np
Expand Down Expand Up @@ -273,9 +274,7 @@ def obs_updates_ffn0():
for x in observables.default_card["interpolation_xgrid"][12::3]
]
)
kins.extend(
[dict(x=0.001, Q2=Q**2) for Q in np.geomspace(1, 1e4, 5).tolist()]
)
kins.extend([dict(x=0.001, Q2=Q**2) for Q in np.geomspace(1, 1e4, 5).tolist()])
obs_updates = observables.build(
[
"F2_charm",
Expand Down
1 change: 1 addition & 0 deletions benchmarks/runners/apfelpy_.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Compare the Yadism results with APFEL++'s.
"""

import pathlib

import numpy as np
Expand Down
6 changes: 3 additions & 3 deletions docs/source/implementation/kernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The actual physical combination are not as many as flavors, indeed |QCD| is
flavor blind (in the massless case, and the only difference in the massive case
are the value of the masses themselves).

In particular there are 3 relevant combinations, for polarized and
In particular there are 3 relevant combinations, for polarized and
unpolarized |DIS| as described in :doc:`../theory/coeff-funcs`.

.. todo::
Expand All @@ -40,5 +40,5 @@ unpolarized |DIS| as described in :doc:`../theory/coeff-funcs`.
Singlet & Non-singlet
---------------------

For the distinction about singlet and non-singlet coefficient function,
see :doc:`../theory/nonsinglet`.
For the distinction about singlet and non-singlet coefficient function,
see :doc:`../theory/nonsinglet`.
1 change: 1 addition & 0 deletions extras/data/machinery/benchmark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Benchmarking tools"""

import pathlib
import traceback

Expand Down
1 change: 1 addition & 0 deletions extras/data/machinery/benchmark/runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Benchmark yadism against apfel."""

import pathlib

dataroot = pathlib.Path(__file__).parents[2]
Expand Down
1 change: 1 addition & 0 deletions extras/data/machinery/generate/POS.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generator for positivity datasets."""

import copy

import yaml
Expand Down
1 change: 1 addition & 0 deletions extras/fonll_hq_treatment/kDISbThr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Vary `kbThr` inside yadism."""

import copy
import pathlib

Expand Down
1 change: 1 addition & 0 deletions extras/fonll_hq_treatment/yadism-vs-apfel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compare yadsim against APFEL."""

import copy
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/yadbox/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Export predictions to PineAPPL."""

import json

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collect all kernels for given |FNS|."""

import numpy as np
from eko.matchings import nf_default

Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/asy/g1_nc_raw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Polarized, asymptotic coefficient functions from :cite:`Bierenbaum:2022biv`."""

import numba as nb
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/asy/kernels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The asymptotic components for the FONLL prescription."""

from eko import basis_rotation as br

from .. import heavy, kernels, light
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/coupling_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coupling between QCD particles and EW particles."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/heavy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
The main CC reference used is: :cite:`gluck-ccheavy`
"""

from . import kernels
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/heavy/f2_nc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Massive :math:`F_2^{NC}` components."""

import LeProHQ
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/heavy/kernels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Truely heavy structure function kernels."""

from eko import basis_rotation as br

from .. import kernels
Expand Down
14 changes: 3 additions & 11 deletions src/yadism/coefficient_functions/intrinsic/raw_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@ def omx(y):
def f2sv(y):
return (
-0.3333333333333333
* (
(-1 + y)
* (15 + 4 * np.pi**2 - 12 * li2(y / (-1 + y)) - 9 * np.log(1 - y))
)
* ((-1 + y) * (15 + 4 * np.pi**2 - 12 * li2(y / (-1 + y)) - 9 * np.log(1 - y)))
/ y
)


def flsv(y):
return (15 + 4 * np.pi**2 - 12 * li2(y / (-1 + y)) - 3 * np.log(1 - y)) / (
3.0 * y
)
return (15 + 4 * np.pi**2 - 12 * li2(y / (-1 + y)) - 3 * np.log(1 - y)) / (3.0 * y)


def f3sv(y):
return (
-5
- (4 * np.pi**2) / 3.0
+ 4 * li2(y / (-1 + y))
+ (3 - 2 / y) * np.log(1 - y)
-5 - (4 * np.pi**2) / 3.0 + 4 * li2(y / (-1 + y)) + (3 - 2 / y) * np.log(1 - y)
)


Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Kernels are a combination of the coupling structure (which parton with which weight)
and the respective 'raw' mathematical coefficient function.
"""

import copy
import importlib
from numbers import Number
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/f3_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This convention is changed in :cite:`Davies:2016ruz` where the |N3LO| CC results are presented
for the first time. Referred equations are not always in agreement with the code conventions.
"""

from .. import partonic_channel as pc
from ..partonic_channel import RSL
from . import f3_nc, n3lo, nnlo
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/f3_nc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
See :mod:`f3_cc` docstring for the name conventions.
"""

from .. import partonic_channel as pc
from ..partonic_channel import RSL
from . import f2_nc, n3lo, nlo, nnlo
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/n3lo/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common factors see :cite:`Larin:1996wd` (Table 2)."""

import numba as nb
import numpy as np

Expand Down
4 changes: 2 additions & 2 deletions src/yadism/coefficient_functions/light/n3lo/xc2ns3p.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Note, the factor `fl11` is disabled for charged currents according to `xcdiff3p.f`.
To generate `c2nm3a,c2nm3c` we follow `xcdiff3p.f` or the reference paper :cite:`Davies:2016ruz`.
"""

import numba as nb
import numpy as np

Expand Down Expand Up @@ -97,8 +98,7 @@ def c2ns3b(y, args):
+ 294.906 * dl1
- 729.359
)
+ nf**2
* (64.0 * d81 * dl1**3 - 464.0 * d81 * dl1**2 + 7.67505 * dl1 + 1.00830)
+ nf**2 * (64.0 * d81 * dl1**3 - 464.0 * d81 * dl1**2 + 7.67505 * dl1 + 1.00830)
)
res = dm * res
return res
Expand Down
4 changes: 2 additions & 2 deletions src/yadism/coefficient_functions/light/n3lo/xc3ns3p.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:math:`\nu + \bar{\nu}`. Vice versa for the minus combination.
To generate `c3np3a,c3np3c` we follow `xcdiff3p.f` or the reference paper :cite:`Davies:2016ruz`.
"""

import numba as nb
import numpy as np

Expand Down Expand Up @@ -107,8 +108,7 @@ def c3ns3b(y, args):
+ 294.906 * dl1
- 729.359
)
+ nf**2
* (64.0 * d81 * dl1**3 - 464.0 * d81 * dl1**2 + 7.67505 * dl1 + 1.00830)
+ nf**2 * (64.0 * d81 * dl1**3 - 464.0 * d81 * dl1**2 + 7.67505 * dl1 + 1.00830)
)
res = dm * res
return res
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/n3lo/xcdiff3p.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Difference even N - odd N moments"""

import numba as nb
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/n3lo/xclns3p.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Note, the factor `fl11` is disabled for charged currents according to `xcdiff3p.f`.
To generate `clnm3a,clnm3c` we follow `xcdiff3p.f` or the reference paper :cite:`Davies:2016ruz`
"""

import numba as nb
import numpy as np

Expand Down
15 changes: 2 additions & 13 deletions src/yadism/coefficient_functions/light/n3lo/xclsg3p.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ def clg3a(y, args):
dl1 = np.log(1.0 - y)

clg31 = (
(
144.0 * dl1**4
- 47024.0 * d27 * dl1**3
+ 6319.0 * dl1**2
+ 53160.0 * dl1
)
* y1
(144.0 * dl1**4 - 47024.0 * d27 * dl1**3 + 6319.0 * dl1**2 + 53160.0 * dl1) * y1
+ dl * dl1 * (72549.0 + 88238.0 * dl)
+ (3709.0 - 33514.0 * y - 9533.0 * y**2) * y1
+ 66773.0 * y * dl**2
Expand All @@ -72,12 +66,7 @@ def clg3a(y, args):
- 409.506 * dl / y
)
clg32 = (
(
288.0 * d27 * dl1**3
- 3648.0 * d27 * dl1**2
- 592.3 * dl1
+ 1511.0 * y * dl1
)
(288.0 * d27 * dl1**3 - 3648.0 * d27 * dl1**2 - 592.3 * dl1 + 1511.0 * y * dl1)
* y1
+ dl * dl1 * (311.3 + 14.24 * dl)
+ (577.3 - 729.0 * y) * y1
Expand Down
1 change: 1 addition & 0 deletions src/yadism/coefficient_functions/light/nnlo/g1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""|NNLO| g1 expressions taken from https://github.com/vbertone/apfelxx/blob/master/src/structurefunctions/zeromasscoefficientfunctionspol_sl.cc"""

import numba as nb
import numpy as np
from eko.constants import CA, CF, TR
Expand Down
16 changes: 10 additions & 6 deletions src/yadism/coefficient_functions/partonic_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ def __init__(self, reg=None, sing=None, loc=None, args=None):
self.loc = loc
if isinstance(args, dict):
self.args = {
k: np.array(args[k], dtype=float)
if k in args and args[k] is not None
else np.array([], dtype=float)
k: (
np.array(args[k], dtype=float)
if k in args and args[k] is not None
else np.array([], dtype=float)
)
for k in ["reg", "sing", "loc"]
}
else:
self.args = {
k: np.array(args, dtype=float)
if args is not None
else np.array([], dtype=float)
k: (
np.array(args, dtype=float)
if args is not None
else np.array([], dtype=float)
)
for k in ["reg", "sing", "loc"]
}

Expand Down
1 change: 1 addition & 0 deletions src/yadism/esf/scale_variations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of factorization and renormalization scale variations."""

import logging
import time

Expand Down
1 change: 1 addition & 0 deletions src/yadism/esf/tmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
to evaluate the physical structure function).
"""

import abc

import numba as nb
Expand Down
1 change: 1 addition & 0 deletions src/yadism/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
interfacing to other codes (but *no loading* is supported from this format)
"""

import copy
import pathlib
import tarfile
Expand Down
1 change: 1 addition & 0 deletions src/yadism/sf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.. todo::
refer to the sf-esf overview
"""

import logging

from .esf import esf, tmc
Expand Down
1 change: 1 addition & 0 deletions src/yadmark/benchmark/external/apfel_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities to help run APFEL."""

import numpy as np
from banana.benchmark.external import apfel_utils

Expand Down
1 change: 1 addition & 0 deletions src/yadmark/benchmark/external/apfelpy_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities to help run APFEL++ benchmarks."""

import numpy as np
from eko import basis_rotation as br

Expand Down
1 change: 1 addition & 0 deletions src/yadmark/benchmark/external/qcdnum_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Benchmark to QCDNUM."""

import pathlib

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/yadmark/benchmark/external/xspace_bench_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Benchmark to xspace_bench (the original FONLL implementation)."""

import numpy as np
from eko.couplings import Couplings, couplings_mod_ev
from eko.io import dictlike, runcards, types
Expand Down
1 change: 1 addition & 0 deletions src/yadmark/benchmark/runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Localized implementation of BenchmarkRunner."""

import numpy as np
import pandas as pd
from banana.benchmark.runner import BenchmarkRunner
Expand Down
1 change: 1 addition & 0 deletions tests/yadism/esf/test_conv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test the DistributionVec class and its methods.
"""

import numpy as np
import pytest
from eko.interpolation import InterpolatorDispatcher, XGrid
Expand Down

0 comments on commit c06562d

Please sign in to comment.