Skip to content

Commit

Permalink
added reference data tot est
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiqwerty committed Feb 15, 2024
1 parent 0966743 commit de3f6e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rormula/test/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def eval_asdf():
res = rormula.eval_asdf(df)
assert np.allclose(res.to_numpy().item(), (5.0 - 2.5) / 4.0)

data = np.ones((100, 6))
data = np.random.random((100, 6)) * 1000
df = pd.DataFrame(
data=data, columns=["alpha", "beta", "gamma", "delta", "epsilon", "phi"]
)
s = "5/3 * alpha / beta * (0.2 / 200.0 / (29.22+gamma+epsilon+phi) / 1000)"
rormula = Arithmetic(s, "testslash")
res = rormula.eval_asdf(df)
ref = df.eval(s)
np.allclose(res.values, ref.values)


if __name__ == "__main__":
Expand Down

0 comments on commit de3f6e1

Please sign in to comment.