Skip to content

Commit

Permalink
Add targeted test for .to_evaluator()
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmith- committed Feb 1, 2024
1 parent a4ef355 commit 7008c6f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,28 @@ def test_highlevel_dask(cset):
awkward.flatten(evaluate).compute(),
numpy.full(6, 1.234),
)


def test_model_to_evaluator():
m = model.CorrectionSet(
schema_version=model.VERSION,
corrections=[
model.Correction(
name="test corr",
version=2,
inputs=[
model.Variable(name="a", type="real"),
model.Variable(name="b", type="real"),
],
output=model.Variable(name="a scale", type="real"),
data=1.234,
)
],
)
cset = m.to_evaluator()
assert set(cset) == {"test corr"}

sf = m.corrections[0].to_evaluator()
assert sf.version == 2
assert sf.description == ""
assert sf.evaluate(1.0, 1.0) == 1.234

0 comments on commit 7008c6f

Please sign in to comment.