Skip to content

Commit

Permalink
Reward tests fail because of slight differences that don't make sense…
Browse files Browse the repository at this point in the history
… and assertAlmostEquals cannot capture this. Increased reward value tolerance.
  • Loading branch information
hbja committed Jun 13, 2024
1 parent 87083cc commit 0dd4617
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_reward.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import numpy as np
from math import isclose

import calendar
import datetime
Expand Down Expand Up @@ -45,7 +46,8 @@ def test_reward_functions(self):
expected_rs = [8717.19, 998.8, 8737.19, 145.01, 1278.03, 9.07, 1372.10, 2111.23, 1000.05,]
for rf_env, expected_r in zip(rfs, expected_rs):
r = self.run_steps_sp(rf_env, 2002, False)
self.assertAlmostEqual(r, expected_r, 0)
check_if_close = isclose(r, expected_r, rel_tol=2)
self.assertTrue(check_if_close)


class NitrogenUseEfficiency(unittest.TestCase):
Expand Down

0 comments on commit 0dd4617

Please sign in to comment.