Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mypy #291

Merged
merged 29 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bb523b4
Add mypy
felixhekhorn Jul 21, 2023
103567c
Restrict mypy and start fixing
felixhekhorn Jul 21, 2023
e7b6e93
Start fixing tests for num_flavs_ref=None
felixhekhorn Jul 21, 2023
bbfc166
Apply more mypy fixes
felixhekhorn Jul 21, 2023
2d8d8bf
Apply more mypy fixes 2
felixhekhorn Jul 21, 2023
494da3c
Rename OpMembers
felixhekhorn Jul 21, 2023
48ac90e
Fix mypy in io/legacy
felixhekhorn Jul 21, 2023
bab8cf2
Fix mypy in box/{genpdf,apply}
felixhekhorn Jul 21, 2023
e61c8e6
Fix ekomark/plots
felixhekhorn Jul 24, 2023
e40a718
Fix ekobox/cli
felixhekhorn Jul 24, 2023
9271ebc
Make managers class
felixhekhorn Jul 24, 2023
80b85f1
Use backported return in apply
felixhekhorn Jul 24, 2023
34c68a5
Fix eko/io/legacy masses usage
felixhekhorn Jul 24, 2023
d6d1734
Fix remaining mypy errors
felixhekhorn Jul 24, 2023
6e0f434
Remove init from benchmarks
felixhekhorn Jul 25, 2023
e8c218e
Drop new_op_key variable in grid
felixhekhorn Aug 17, 2023
54d9e53
Define couplings cache key type
felixhekhorn Aug 17, 2023
9b0d804
Define label type in apply
felixhekhorn Aug 17, 2023
3b57600
Cast labels in evop/Operator
felixhekhorn Aug 17, 2023
bbe955c
Update src/eko/runner/operators.py
felixhekhorn Aug 17, 2023
16e3809
Introduce OperatorLabel type
felixhekhorn Aug 17, 2023
c9cdc72
Remove list comprension in msbar
felixhekhorn Aug 17, 2023
c946b3f
Upgrade banana
felixhekhorn Aug 17, 2023
0451697
Merge branch 'master' into mypy
felixhekhorn Jan 12, 2024
a49fca6
Fix evol_pdf
felixhekhorn Jan 12, 2024
4be6d44
Merge branch 'master' into mypy
felixhekhorn Jul 15, 2024
0d13e35
Merge branch 'master' into mypy
felixhekhorn Aug 8, 2024
b651ebe
Fix Rust ev_op patch
felixhekhorn Aug 8, 2024
deb41cd
Merge branch 'master' into mypy
felixhekhorn Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/eko/evolution_operator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ def quad_ker_qed(
return ker


OPMEMBERS = Dict[Tuple[int, int], OpMember]
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved


class Operator(sv.ModeMixin):
"""Internal representation of a single EKO.

Expand Down Expand Up @@ -618,7 +621,7 @@ def __init__(
# TODO make 'cut' external parameter?
self._mellin_cut = mellin_cut
self.is_threshold = is_threshold
self.op_members: Dict[Tuple[int, int], OpMember] = {}
self.op_members: OPMEMBERS = {}
self.order = tuple(config["order"])
self.alphaem_running = self.managers["couplings"].alphaem_running
if self.log_label == "Evolution":
Expand Down
11 changes: 5 additions & 6 deletions src/eko/evolution_operator/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"""
import logging
from dataclasses import astuple
from typing import Any, Dict, List, Optional

import numpy as np
Expand All @@ -17,9 +16,9 @@
from ..interpolation import InterpolatorDispatcher
from ..io.runcards import Configs, Debug
from ..io.types import EvolutionPoint as EPoint
from ..io.types import Order
from ..io.types import Order, SquaredScale
from ..matchings import Atlas, Segment, flavor_shift, is_downward_path
from . import Operator, flavors, matching_condition, physical
from . import OPMEMBERS, Operator, flavors, matching_condition, physical
from .operator_matrix_element import OperatorMatrixElement

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -95,8 +94,8 @@ def __init__(
couplings=couplings,
interpol_dispatcher=interpol_dispatcher,
)
self._threshold_operators = {}
self._matching_operators = {}
self._threshold_operators: Dict[Segment, Operator] = {}
self._matching_operators: Dict[SquaredScale, OPMEMBERS] = {}

def get_threshold_operators(self, path: List[Segment]) -> List[Operator]:
"""Generate the threshold operators.
Expand All @@ -118,7 +117,7 @@ def get_threshold_operators(self, path: List[Segment]) -> List[Operator]:
is_downward = is_downward_path(path)
shift = flavor_shift(is_downward)
for seg in path[:-1]:
new_op_key = astuple(seg)
new_op_key = seg
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved
kthr = self.config["thresholds_ratios"][seg.nf - shift]
ome = OperatorMatrixElement(
self.config,
Expand Down
2 changes: 1 addition & 1 deletion src/eko/msbar_masses.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def sc(thr_masses):
heavy_quarks = quark_names[3:]
hq_idxs = np.arange(0, 3)
if nf_ref > 4:
heavy_quarks = str(reversed(heavy_quarks))
heavy_quarks = "".join([e for e in reversed(heavy_quarks)])
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved
hq_idxs = reversed(hq_idxs)

# loop on heavy quarks and compute the msbar masses
Expand Down