Skip to content

Commit

Permalink
Merge branch 'master' into read-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Feb 13, 2025
2 parents 5887997 + c8135d0 commit d5ca946
Show file tree
Hide file tree
Showing 23 changed files with 1,760 additions and 340 deletions.
18 changes: 9 additions & 9 deletions .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/astral-sh/ruff-pre-commit
rev: v0.9.0
rev: v0.9.6
hooks:
# Run the linter.
- id: ruff
Expand All @@ -29,14 +29,14 @@ repos:
args: [ --select, I, --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/PyCQA/docformatter
rev: eb1df34 # TODO: wait for https://github.com/PyCQA/docformatter/issues/293
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
# - repo: https://github.com/PyCQA/docformatter
# rev: v1.7.5 # TODO: wait for https://github.com/PyCQA/docformatter/issues/293
# hooks:
# - id: docformatter
# additional_dependencies: [tomli]
# args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies: [types-PyYAML]
Expand All @@ -59,6 +59,6 @@ repos:
types: [file, rust]
language: system
- repo: https://github.com/pre-commit/pre-commit
rev: v4.0.1
rev: v4.1.0
hooks:
- id: validate_manifest
21 changes: 9 additions & 12 deletions benchmarks/apfel_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ class BenchmarkVFNS(ApfelBenchmark):

vfns_theory = {
"FNS": "ZM-VFNS",
"ModEv": [
"EXA",
"EXP",
"TRN",
],
"ModEv": "EXA",
"kcThr": 1.0,
"kbThr": 1.0,
"ktThr": 1.0,
Expand Down Expand Up @@ -132,12 +128,10 @@ class BenchmarkFFNS(ApfelBenchmark):

ffns_theory = {
"FNS": "FFNS",
"ModEv": [
"EXA",
"EXP",
"TRN",
],
"ModEv": "EXA",
"NfFF": 4,
"nf0": 4,
"nfref": 4,
"kcThr": 0.0,
"kbThr": np.inf,
"ktThr": np.inf,
Expand All @@ -159,7 +153,6 @@ def benchmark_plain_pol(self, pto):

th = self.ffns_theory.copy()
th.update({"PTO": [pto]})
th["ModEv"] = ["EXA"] # TODO for the time one is sufficient
op = operators.apfel_config.copy()
op["polarized"] = [True]
self.run(cartesian_product(th), operators.build(op), ["ToyLH"])
Expand Down Expand Up @@ -209,6 +202,8 @@ class BenchmarkFFNS_qed(ApfelBenchmark):
# "TRN",
],
"NfFF": 5,
"nf0": 5,
"nfref": 5,
"kcThr": 0.0,
"kbThr": 0.0,
"ktThr": np.inf,
Expand Down Expand Up @@ -291,6 +286,8 @@ class BenchmarkVFNS_qed(ApfelBenchmark):
"kbThr": 1.0,
"ktThr": 1.0,
"Q0": 1.25,
"nf0": 3,
"nfref": 5,
"alphas": 0.118000,
"alphaqed": 0.007496,
}
Expand Down Expand Up @@ -319,7 +316,7 @@ def benchmark_plain(self, pto, qed):
# obj = BenchmarkFFNS()

# obj.benchmark_plain_pol(2)
# obj.benchmark_plain(2)
# obj.benchmark_plain(0)
# obj.benchmark_sv(2, "exponentiated")
# obj.benchmark_kthr(2)
# obj.benchmark_msbar(2)
Expand Down
18 changes: 9 additions & 9 deletions benchmarks/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ class Sandbox(Runner):
sandbox = True

# select here the external program between LHA, LHAPDF, apfel, pegasus
external = "apfel"
external = "void"
# external = "pegasus"

# select to plot operators
plot_operator = True
# plot_operator = True

rotate_to_evolution_basis = True
# rotate_to_evolution_basis = True

@staticmethod
def generate_operators():
ops = {
"ev_op_iterations": [1],
# "ev_op_max_order": [20],
"mugrid": [[10]],
"mugrid": [[10.0]],
# "debug_skip_singlet": [True],
}
return ops
Expand Down Expand Up @@ -118,12 +118,12 @@ def lha(self):
"FNS": "FFNS",
"NfFF": 4,
"ModEv": "EXA",
"XIF": np.sqrt(2),
"Q0": np.sqrt(2),
"XIF": float(np.sqrt(2)),
"Q0": float(np.sqrt(2)),
"kcThr": 0.0,
"kbThr": np.inf,
"ktThr": np.inf,
"Qref": np.sqrt(2.0),
"Qref": float(np.sqrt(2.0)),
"alphas": 0.35,
}
self.skip_pdfs = lambda _theory: [
Expand All @@ -139,11 +139,11 @@ def lha(self):
]
self.run(
[theory_updates],
[{"mugrid": [100], "debug_skip_singlet": True}],
[{"mugrid": [100.0], "debug_skip_singlet": True}],
["ToyLH"],
)


if __name__ == "__main__":
sand = Sandbox()
sand.doit()
sand.lha()
Loading

0 comments on commit d5ca946

Please sign in to comment.