Skip to content

Commit

Permalink
Clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jun 17, 2020
1 parent 323b4f7 commit 9d35593
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 219 deletions.
4 changes: 2 additions & 2 deletions src/eko/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import logging

import eko.interpolation as interpolation
from eko import interpolation
from eko.kernel_generation import KernelDispatcher
from eko.thresholds import ThresholdsConfig
from eko.operator_grid import OperatorGrid
Expand Down Expand Up @@ -80,5 +80,5 @@ def get_output(self):
for op in self.get_operators():
final_scale = op.q2_final
q2_grid[final_scale] = op.get_raw_operators()
ret["q2_grid"] = q2_grid
ret["Q2grid"] = q2_grid
return ret
1 change: 0 additions & 1 deletion tests/regressions/Lagrange_interpol.json

This file was deleted.

Empty file removed tests/regressions/__init__.py
Empty file.
216 changes: 0 additions & 216 deletions tests/test_dglap.py

This file was deleted.

36 changes: 36 additions & 0 deletions tests/test_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-

import numpy as np

import eko

def test_runner():
"""we don't check the content here, but only the shape"""
setup = {
"interpolation_xgrid": [.1, 1.],
"interpolation_polynomial_degree": 1,
"interpolation_is_log": True,
"alphas": 0.35,
"Qref": np.sqrt(2),
"Q0": np.sqrt(2),
"FNS": "FFNS",
"NfFF": 3,
"Q2grid": [10,100]
}
r = eko.runner.Runner(setup)
o = r.get_output()

# check output = input
np.testing.assert_allclose(o["interpolation_xgrid"],setup["interpolation_xgrid"])
for k in ["interpolation_polynomial_degree", "interpolation_is_log"]:
assert o[k] == setup[k]
np.testing.assert_allclose(o["q2_ref"],setup["Q0"]**2)
# check available operators
assert len(o["Q2grid"]) == len(setup["Q2grid"])
assert list(o["Q2grid"].keys()) == setup["Q2grid"]
for ops in o["Q2grid"].values():
assert "operators" in ops
assert "operator_errors" in ops
names = ["V.V","V3.V3","V8.V8","T3.T3","T8.T8","S.S","S.g","g.S","g.g"]
assert list(ops["operators"].keys()) == names
assert list(ops["operator_errors"].keys()) == names

0 comments on commit 9d35593

Please sign in to comment.