Skip to content

Commit

Permalink
Merge pull request #343 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 1018dda + 11a8da3 commit 6833e50
Show file tree
Hide file tree
Showing 116 changed files with 156 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: pycln
args: [--config=pyproject.toml]
- 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
1 change: 1 addition & 0 deletions benchmarks/DSSV_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Note that the PDF set is private, but can be obtained from the
authors upon request.
"""

from banana import register

from eko import interpolation
Expand Down
1 change: 1 addition & 0 deletions benchmarks/NNPDF_bench.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Benchmark NNPDF pdf family
"""

from banana import register

from eko import interpolation
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/apfel_bench.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Benchmark EKO to Apfel
"""

import numpy as np
from banana import register
from banana.data import cartesian_product
Expand All @@ -20,7 +21,6 @@ def tolist(input_dict):


class ApfelBenchmark(Runner):

"""
Globally set the external program to Apfel
"""
Expand Down
1 change: 1 addition & 0 deletions benchmarks/eko/benchmark_msbar_evolution.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module benchmarks MSbar mass evolution against APFEL."""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions benchmarks/ekore/benchmark_ad.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Benchmark the NLO anomalous dimensions against PEGASUS"""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions benchmarks/lha_paper_bench.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Benchmark to :cite:`Giele:2002hx` (LO + NLO) and :cite:`Dittmar:2005ed` (NNLO).
"""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions crates/make_bib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parse bibtex file to rust crate."""

import datetime
import pathlib
import re
Expand Down
4 changes: 2 additions & 2 deletions extras/lh_bench_23/plot_bench_msht.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
(eko_res, "EKO"),
(fhmv_eko_res, "FHMV EKO"),
(msht_res, "MSHT"),
(fhmv_msht_res, "FHMV MSHT")
(fhmv_msht_res, "FHMV MSHT"),
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

Expand All @@ -54,7 +54,7 @@
(eko_diff, "EKO"),
(fhmv_eko_diff, "FHMV EKO"),
(msht_diff, "MSHT"),
(fhmv_msht_diff, "FHMV MSHT")
(fhmv_msht_diff, "FHMV MSHT"),
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

Expand Down
1 change: 1 addition & 0 deletions src/eko/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Evolution Kernel Operators."""

from . import io, version
from .io.struct import EKO
from .runner import solve
Expand Down
1 change: 1 addition & 0 deletions src/eko/couplings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
See :doc:`pQCD ingredients </theory/pQCD>`.
"""

import logging
from typing import Iterable, List

Expand Down
36 changes: 16 additions & 20 deletions src/eko/evolution_operator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,27 +990,23 @@ def copy_ns_ops(self):
if self.order[1] == 0:
if self.order[0] == 1: # in LO +=-=v
for label in ["nsV", "ns-"]:
self.op_members[
(br.non_singlet_pids_map[label], 0)
].value = self.op_members[
(br.non_singlet_pids_map["ns+"], 0)
].value.copy()
self.op_members[
(br.non_singlet_pids_map[label], 0)
].error = self.op_members[
(br.non_singlet_pids_map["ns+"], 0)
].error.copy()
self.op_members[(br.non_singlet_pids_map[label], 0)].value = (
self.op_members[
(br.non_singlet_pids_map["ns+"], 0)
].value.copy()
)
self.op_members[(br.non_singlet_pids_map[label], 0)].error = (
self.op_members[
(br.non_singlet_pids_map["ns+"], 0)
].error.copy()
)
elif self.order[0] == 2: # in NLO -=v
self.op_members[
(br.non_singlet_pids_map["nsV"], 0)
].value = self.op_members[
(br.non_singlet_pids_map["ns-"], 0)
].value.copy()
self.op_members[
(br.non_singlet_pids_map["nsV"], 0)
].error = self.op_members[
(br.non_singlet_pids_map["ns-"], 0)
].error.copy()
self.op_members[(br.non_singlet_pids_map["nsV"], 0)].value = (
self.op_members[(br.non_singlet_pids_map["ns-"], 0)].value.copy()
)
self.op_members[(br.non_singlet_pids_map["nsV"], 0)].error = (
self.op_members[(br.non_singlet_pids_map["ns-"], 0)].error.copy()
)
# at O(as0aem1) u-=u+, d-=d+
# starting from O(as1aem1) P+ != P-
# However the solution with pure QED is not implemented in EKO
Expand Down
1 change: 1 addition & 0 deletions src/eko/evolution_operator/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
previously instantiated information and does the actual computation of the Q2s.
"""

import logging
from dataclasses import astuple
from typing import Dict, List, Optional
Expand Down
1 change: 1 addition & 0 deletions src/eko/evolution_operator/physical.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the :class:`PhysicalOperator` class."""

from .. import basis_rotation as br
from .. import member

Expand Down
1 change: 1 addition & 0 deletions src/eko/gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
See :doc:`pQCD ingredients </theory/pQCD>`.
"""

import numba as nb

from eko.constants import zeta3, zeta4, zeta5
Expand Down
1 change: 1 addition & 0 deletions src/eko/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Upon construction the dispatcher generates a number of functions
to evaluate the interpolator.
"""

import logging
import math
from typing import Sequence, Union
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/bases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Operators bases."""

from dataclasses import dataclass, fields
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions src/eko/io/dictlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
codified in more native structures.
"""

import copy
import dataclasses
import enum
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""IO generic exceptions."""

import os


Expand Down
1 change: 1 addition & 0 deletions src/eko/io/inventory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage assets used during computation."""

import base64
from dataclasses import asdict, dataclass, field
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/items.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Inventory items definition."""

import io
from dataclasses import asdict, dataclass
from typing import BinaryIO, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/legacy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support legacy storage formats."""

import dataclasses
import io
import os
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/manipulate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manipulate output generate by EKO."""

import logging
import warnings
from typing import Callable, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define `eko.EKO` metadata."""

import logging
import os
import pathlib
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define paths inside an `eko.EKO` object."""

import pathlib
from dataclasses import dataclass

Expand Down
1 change: 1 addition & 0 deletions src/eko/io/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
file, as opposed to structured YAML representing a specific runcard.
"""

import os
from pathlib import Path
from tarfile import TarFile, TarInfo
Expand Down
9 changes: 6 additions & 3 deletions src/eko/io/runcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
All energy scales in the runcards should be saved linearly, not the
squared value, for consistency. Squares are consistenly taken inside.
"""

from dataclasses import dataclass
from math import nan
from typing import List, Optional, Union
Expand Down Expand Up @@ -198,9 +199,11 @@ def new_theory(self):
max_num_flavs=old["MaxNfAs"],
)
new["heavy"] = {
"num_flavs_init": nf_default(old["Q0"] ** 2.0, default_atlas(ms, ks))
if old["nf0"] is None
else old["nf0"],
"num_flavs_init": (
nf_default(old["Q0"] ** 2.0, default_atlas(ms, ks))
if old["nf0"] is None
else old["nf0"]
),
"num_flavs_max_pdf": old["MaxNfPdf"],
"matching_ratios": self.heavies("k%sThr", old),
"masses_scheme": old["HQ"],
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/struct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define output representation structures."""

import contextlib
import copy
import logging
Expand Down
1 change: 1 addition & 0 deletions src/eko/io/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common type definitions, only used for static analysis."""

import enum
import typing
from typing import Any, Dict, Generic, Tuple, TypeVar
Expand Down
4 changes: 1 addition & 3 deletions src/eko/kernels/as4_evolution_integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ def j13_expanded(a1, a0, beta0, b_list):
"""
b1, b2, _ = b_list
return (1 / beta0) * (
(a1 - a0)
- b1 / 2 * (a1**2 - a0**2)
+ (b1**2 - b2) / 3 * (a1**3 - a0**3)
(a1 - a0) - b1 / 2 * (a1**2 - a0**2) + (b1**2 - b2) / 3 * (a1**3 - a0**3)
)


Expand Down
1 change: 1 addition & 0 deletions src/eko/kernels/non_singlet_qed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of QED non-singlet EKOs."""

import numba as nb
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions src/eko/kernels/singlet_qed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of QED singlet EKOs."""

import numba as nb
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions src/eko/kernels/valence_qed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of QED valence EKOs."""

import numba as nb

from .singlet_qed import eko_iterate
Expand Down
1 change: 1 addition & 0 deletions src/eko/matchings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
r"""Holds the classes that define the |FNS|."""

import logging
from dataclasses import dataclass
from typing import List, Union
Expand Down
1 change: 1 addition & 0 deletions src/eko/member.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Atomic operator member."""

import copy
import operator
from numbers import Number
Expand Down
1 change: 1 addition & 0 deletions src/eko/msbar_masses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
r"""|RGE| for the |MSbar| masses."""

from typing import List

import numba as nb
Expand Down
1 change: 1 addition & 0 deletions src/eko/quantities/couplings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Types and quantities related to theory couplings."""

import dataclasses
import enum
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions src/eko/quantities/heavy_quarks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Heavy quarks related quantities."""

import enum
from dataclasses import dataclass
from typing import Generic, List, Sequence, TypeVar
Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage steps to DGLAP solution, and operator creation."""

import os
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/commons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Runners common utilities."""

import numpy as np

from ..couplings import Couplings, couplings_mod_ev
Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/legacy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main application class of eko."""

import logging
import os
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/managed.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
but not automatically performed.
"""

from pathlib import Path

from ..io.items import Evolution, Matching, Target
Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/operators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Combine parts into operators."""

from functools import reduce
from typing import List

Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:class:`OperatorMatrixElement` to simplify the computation and passing down
parameters.
"""

import numpy as np

from .. import evolution_operator as evop
Expand Down
1 change: 1 addition & 0 deletions src/eko/runner/recipes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Recipes containing instructions for atomic computations."""

from typing import List

from ..io.items import Evolution, Matching, Recipe
Expand Down
1 change: 1 addition & 0 deletions src/eko/scale_variations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A Mathematica snippet to check the formulas is available in the
extras folder.
"""

import enum

from . import expanded, exponentiated
Expand Down
8 changes: 2 additions & 6 deletions src/eko/scale_variations/expanded.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,8 @@ def variation_as3(gamma, L, beta0, beta1, g0e2, g0e3, g1g0, g0g1):
"""
return (
gamma[2] * L
+ (1.0 / 2.0)
* (beta1 * gamma[0] + 2.0 * beta0 * gamma[1] + g1g0 + g0g1)
* L**2
+ (1.0 / 6.0)
* (2.0 * beta0**2 * gamma[0] + 3.0 * beta0 * g0e2 + g0e3)
* L**3
+ (1.0 / 2.0) * (beta1 * gamma[0] + 2.0 * beta0 * gamma[1] + g1g0 + g0g1) * L**2
+ (1.0 / 6.0) * (2.0 * beta0**2 * gamma[0] + 3.0 * beta0 * g0e2 + g0e3) * L**3
)


Expand Down
Loading

0 comments on commit 6833e50

Please sign in to comment.