Skip to content

Commit

Permalink
Merge branch 'release/0.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Dec 13, 2021
2 parents 470d892 + 057ff5e commit d374b52
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ comment:
#- master
#- "feature/*"
#- "release/*"

github_checks:
annotations: false
5 changes: 3 additions & 2 deletions benchmarks/runners/lha_paper_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class BenchmarkVFNS(LHABenchmark):
"kcThr": 1.0,
"kbThr": 1.0,
"ktThr": 1.0,
"nf0": 3,
}
)

Expand Down Expand Up @@ -168,8 +169,8 @@ def skip_pdfs(theory):

if __name__ == "__main__":

# obj = BenchmarkVFNS()
obj = BenchmarkFFNS()
obj = BenchmarkVFNS()
# obj = BenchmarkFFNS()

obj.benchmark_plain(2)
# obj.benchmark_sv(1)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# write version on the fly - inspired by numpy
MAJOR = 0
MINOR = 8
MICRO = 1
MICRO = 2

repo_path = pathlib.Path(__file__).absolute().parent

Expand Down
5 changes: 3 additions & 2 deletions src/eko/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,12 @@ def load_tar(cls, tarname):
# metadata = cls(**{str(k): v for k, v in self.items() if k != "Q2grid"})
# metadata["Q2grid"] = list(self["Q2grid"].keys())

yamlname = tmpdir / tarpath.stem / "metadata.yaml"
innerdir = list(tmpdir.glob("*"))[0]
yamlname = innerdir / "metadata.yaml"
metadata = cls.load_yaml_from_file(yamlname, skip_q2_grid=True)

grids = {}
for fp in (tmpdir / tarpath.stem).glob("*.npy.lz4"):
for fp in innerdir.glob("*.npy.lz4"):
with lz4.frame.open(fp, "rb") as fd:
stream = io.BytesIO(fd.read())
stream.seek(0)
Expand Down
2 changes: 2 additions & 0 deletions src/eko/thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ def from_dict(cls, theory_card, prefix="k", max_nf_name="MaxNfPdf"):
max_nf = theory_card[max_nf_name]
# preset ref scale
q2_ref = pow(theory_card["Q0"], 2)
nf_ref = theory_card["nf0"]
return cls(
np.power(masses, 2),
q2_ref,
nf_ref,
thresholds_ratios=np.power(thresholds_ratios, 2),
max_nf=max_nf,
)
Expand Down
1 change: 1 addition & 0 deletions tests/benchmark_evol_to_unity.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TestBackwardForward:
"Qref": np.sqrt(2),
"nfref": None,
"Q0": np.sqrt(2),
"nf0": 4,
"IC": 1,
"IB": 1,
"mc": 1.0,
Expand Down
1 change: 1 addition & 0 deletions tests/test_ev_op_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _get_setup(self, use_FFNS):
"Qref": np.sqrt(2),
"nfref": None,
"Q0": np.sqrt(100),
"nf0": 3,
"FNS": "FFNS",
"NfFF": 3,
"IC": 1,
Expand Down
1 change: 1 addition & 0 deletions tests/test_ev_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def test_compute(self, monkeypatch):
"Qref": np.sqrt(2),
"nfref": None,
"Q0": np.sqrt(2),
"nf0": 3,
"FNS": "FFNS",
"NfFF": 3,
"IC": 0,
Expand Down
1 change: 1 addition & 0 deletions tests/test_ome.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class TestOperatorMatrixElement:
"Qref": np.sqrt(2),
"nfref": None,
"Q0": np.sqrt(2),
"nf0": 3,
"NfFF": 3,
"IC": 1,
"IB": 0,
Expand Down
21 changes: 21 additions & 0 deletions tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
import io
import pathlib
import shutil
import tempfile
from unittest import mock

Expand Down Expand Up @@ -123,6 +124,26 @@ def test_io(self):
with pytest.raises(ValueError, match="wrong suffix"):
o1.load_tar(fn)

def test_rename_issue81(self):
# https://github.com/N3PDF/eko/issues/81
d = self.fake_output()
# create object
o1 = output.Output(d)

with tempfile.TemporaryDirectory() as folder:
# dump
p = pathlib.Path(folder)
fp1 = p / "test1.tar"
fp2 = p / "test2.tar"
o1.dump_tar(fp1)
# rename
shutil.move(fp1, fp2)
# reload
o4 = output.Output.load_tar(fp2)
np.testing.assert_almost_equal(
o4["interpolation_xgrid"], d["interpolation_xgrid"]
)

def test_io_bin(self):
d = self.fake_output()
# create object
Expand Down
1 change: 1 addition & 0 deletions tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Qref": np.sqrt(2),
"nfref": None,
"Q0": np.sqrt(2),
"nf0": 4,
"FNS": "FFNS",
"NfFF": 3,
"ModEv": "EXA",
Expand Down
1 change: 1 addition & 0 deletions tests/test_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def test_from_dict(self):
"kbThr": 2.0,
"ktThr": np.inf,
"Q0": 1.0,
"nf0": 4,
"MaxNfPdf": 6,
}
)
Expand Down

0 comments on commit d374b52

Please sign in to comment.