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

v1.0.4 #10

Merged
merged 3 commits into from
Mar 25, 2024
Merged
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
4 changes: 2 additions & 2 deletions moojoco/environment/dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def observation_space(self) -> SpaceType:
def step(
self, state: BaseEnvState, action: chex.Array, *args, **kwargs
) -> BaseEnvState:
return self._env.step(state=state, action=action)
return self._env.step(state=state, action=action, *args, **kwargs)

def reset(
self, rng: np.random.RandomState | chex.PRNGKey, *args, **kwargs
) -> BaseEnvState:
return self._env.reset(rng=rng)
return self._env.reset(rng=rng, *args, **kwargs)

def render(self, state: BaseEnvState) -> List[RenderFrame] | None:
return self._env.render(state=state)
Expand Down
8 changes: 6 additions & 2 deletions moojoco/environment/mjc_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def step(
) -> VectorMJCEnvState:
self._states = list(
self._pool.map(
lambda env, ste, act: env.step(state=ste, action=act),
lambda env, ste, act: env.step(state=ste, action=act, *args, **kwargs),
self._envs,
self._states,
action,
Expand All @@ -277,7 +277,11 @@ def reset(
self, rng: List[np.random.RandomState], *args, **kwargs
) -> VectorMJCEnvState:
self._states = list(
self._pool.map(lambda env, sub_rng: env.reset(sub_rng), self._envs, rng)
self._pool.map(
lambda env, sub_rng: env.reset(sub_rng, *args, **kwargs),
self._envs,
rng,
)
)

return self._merged_states
Expand Down
10 changes: 5 additions & 5 deletions moojoco/environment/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def observation_space(self) -> SpaceType:
def step(
self, state: BaseEnvState, action: chex.Array, *args, **kwargs
) -> BaseEnvState:
return self._env.step(state=state, action=action)
return self._env.step(state=state, action=action, *args, **kwargs)

def reset(
self, rng: np.random.RandomState | chex.PRNGKey, *args, **kwargs
) -> BaseEnvState:
return self._env.reset(rng=rng)
return self._env.reset(rng=rng, *args, **kwargs)

def render(self, state: BaseEnvState) -> List[RenderFrame] | None:
return self._env.render(state=state)
Expand All @@ -83,14 +83,14 @@ def _transform_observations(self, state: BaseEnvState) -> BaseEnvState:
def step(
self, state: BaseEnvState, action: chex.Array, *args, **kwargs
) -> BaseEnvState:
state = self._env.step(state=state, action=action)
state = self._env.step(state=state, action=action, *args, **kwargs)
state = self._transform_observations(state=state)
return state

def reset(
self, rng: np.random.RandomState | chex.PRNGKey, *args, **kwargs
) -> BaseEnvState:
state = self._env.reset(rng=rng)
state = self._env.reset(rng=rng, *args, **kwargs)
state = self._transform_observations(state=state)
return state

Expand All @@ -114,5 +114,5 @@ def step(
self, state: BaseEnvState, action: chex.Array, *args, **kwargs
) -> BaseEnvState:
action, state = self._transform_action(action=action, state=state)
state = self._env.step(state=state, action=action)
state = self._env.step(state=state, action=action, *args, **kwargs)
return state
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "moojoco"
version = "1.0.3"
version = "1.0.4"
authors = [
{ name = "Dries Marzougui", email = "[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='moojoco',
version='1.0.3',
version='1.0.4',
description='A unified framework for implementing and interfacing with MuJoCo and MuJoCo-XLA simulation '
'environments.',
long_description=readme,
Expand Down
Loading