Skip to content

Commit

Permalink
Read environment as local variable instead of class attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
javiarrobas committed Dec 27, 2024
1 parent d140f1f commit d38e5ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testing/test_boptestGymEnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_reset_fixed(self):
env.start_time = 14*24*3600
env.warmup_period = 3*3600

obs, _ = self.env.reset()
obs, _ = env.reset()

# Check values
df = pd.DataFrame(data=[obs], index=['obs_reset_fixed'], columns=['value'])
Expand Down Expand Up @@ -134,9 +134,9 @@ def test_reset_random(self):
start_times = OrderedDict()
# Reset hundred times
for i in range(100):
obs, _ = self.env.reset()
start_time = self.env.start_time
episode = (start_time, start_time+self.env.max_episode_length)
obs, _ = env.reset()
start_time = env.start_time
episode = (start_time, start_time+env.max_episode_length)
for period in excluding_periods:
# Make sure that the episodes don't overlap with excluding_periods
assert not(episode[0] < period[1] and period[0] < episode[1]),\
Expand Down

0 comments on commit d38e5ef

Please sign in to comment.