Skip to content

Commit

Permalink
Drop isort and black for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Sep 16, 2024
1 parent 8bcee93 commit dfe7c79
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 40 deletions.
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,14 @@ repos:
# Run the linter.
- id: ruff
args: [ --fix ]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
Expand All @@ -53,14 +46,14 @@ repos:
- repo: local
hooks:
- id: fmt
name: fmt
name: cargo fmt
description: Format Rust files with cargo fmt.
entry: cargo fmt --
language: system
files: ^crates/.*\.rs$
args: []
- id: clippy
name: clippy
name: cargo clippy
description: Check Rust files with cargo clippy.
entry: cargo clippy --all-targets --all-features -- -Dclippy::all
pass_filenames: false
Expand Down
36 changes: 20 additions & 16 deletions src/eko/evolution_operator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,23 +1000,27 @@ 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
4 changes: 1 addition & 3 deletions src/eko/kernels/non_singlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@ def eko_truncated(gamma_ns, a1, a0, beta, order, ev_op_iterations):


@nb.njit(cache=True)
def dispatcher(
order, method, gamma_ns, a1, a0, nf, ev_op_iterations
): # pylint: disable=too-many-return-statements
def dispatcher(order, method, gamma_ns, a1, a0, nf, ev_op_iterations): # pylint: disable=too-many-return-statements
"""Determine used kernel and call it.
In LO we always use the exact solution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ def gamma_nsm(n, nf, cache, variation):

# The singular piece.
A4qI = (
2.120902 * 10**4
- 5.179372 * 10**3 * nf
2.120902 * 10**4 - 5.179372 * 10**3 * nf
# + 1.955772 * 10**2 * nf**2
# + 3.272344 * nf**3
)
Expand All @@ -204,9 +203,7 @@ def gamma_nsm(n, nf, cache, variation):

# The local piece.
B4qI = (
2.579609 * 10**4
+ 0.08
- (5.818637 * 10**3 + 0.97) * nf
2.579609 * 10**4 + 0.08 - (5.818637 * 10**3 + 0.97) * nf
# + (1.938554 * 10**2 + 0.0037) * nf**2
# + 3.014982 * nf**3
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ def gamma_nsp(n, nf, cache, variation):

# The singular piece.
A4qI = (
2.120902 * 10**4
- 5.179372 * 10**3 * nf
2.120902 * 10**4 - 5.179372 * 10**3 * nf
# + 1.955772 * 10**2 * nf**2
# + 3.272344 * nf**3
)
Expand All @@ -211,9 +210,7 @@ def gamma_nsp(n, nf, cache, variation):

# ..The local piece.
B4qI = (
2.579609 * 10**4
+ 0.08
- (5.818637 * 10**3 + 0.97) * nf
2.579609 * 10**4 + 0.08 - (5.818637 * 10**3 + 0.97) * nf
# + (1.938554 * 10**2 + 0.0037) * nf**2
# + 3.014982 * nf**3
)
Expand Down

0 comments on commit dfe7c79

Please sign in to comment.