Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added options=None to fix broken ocean envs + updated includes setup.py for raylib rendering and cffi #96

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pufferlib/environments/ocean/sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, num_actions=4, reward_scale=1,
self.action_space=gymnasium.spaces.Discrete(num_actions)
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
# Bandit problem requires a single fixed seed
# for all environments
seed = self.hard_fixed_seed
Expand Down Expand Up @@ -84,7 +84,7 @@ def __init__(self, mem_length=1, mem_delay=0):
self.action_space=gymnasium.spaces.Discrete(2)
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
if seed is not None:
random.seed(seed)
np.random.seed(seed)
Expand Down Expand Up @@ -178,7 +178,7 @@ def observation_space(self, agent):
def action_space(self, agent):
return gymnasium.spaces.Discrete(2)

def reset(self, seed=None):
def reset(self, seed=None, options=None):
# Reallocating is faster than zeroing
self.view=np.zeros((2, 5), dtype=np.float32)
return self.observation, {}
Expand Down Expand Up @@ -248,7 +248,7 @@ def __init__(self, password_length=5, hard_fixed_seed=42):
self.action_space=gymnasium.spaces.Discrete(2)
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
# Bandit problem requires a single fixed seed
# for all environments
seed = self.hard_fixed_seed
Expand Down Expand Up @@ -315,7 +315,7 @@ def __init__(self, delay_mean=0, delay_std=0, bandwidth=1):
self.observation = self.observation_space.sample()
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
return self.observation, {}

def step(self, action):
Expand All @@ -342,7 +342,7 @@ def __init__(self, count_n=0, count_std=0, bandwidth=1):
self.bandwidth = bandwidth
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
return self.observation, {}

def step(self, action):
Expand Down Expand Up @@ -378,7 +378,7 @@ def __init__(self):
})
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
self.observation = {
'image': np.random.randn(5, 5).astype(np.float32),
'flat': np.random.randint(-1, 2, (5,), dtype=np.int8),
Expand Down Expand Up @@ -445,7 +445,7 @@ def _all_possible_targets(self, grid_size):
return [(x, y) for x in range(grid_size) for y in range(grid_size)
if x == 0 or y == 0 or x == grid_size - 1 or y == grid_size - 1]

def reset(self, seed=None):
def reset(self, seed=None, options=None):
if seed is not None:
random.seed(seed)
np.random.seed(seed)
Expand Down Expand Up @@ -548,7 +548,7 @@ def __init__(self, p=0.75, horizon=1000):
self.action_space = gymnasium.spaces.Discrete(2)
self.render_mode = 'ansi'

def reset(self, seed=None):
def reset(self, seed=None, options=None):
if seed is not None:
random.seed(seed)
np.random.seed(seed)
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from Cython.Build import cythonize
import numpy

VERSION = '1.0.0'
VERSION = '1.0.1'

import os
os.environ['CFLAGS'] = '-O3 -march=native -Wall'
Expand Down Expand Up @@ -232,6 +232,8 @@
'psutil==5.9.5',
'pynvml',
'imageio',
'raylib',
'cffi',
],
extras_require={
'docs': docs,
Expand Down