Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-marks committed Jan 21, 2024
1 parent 9e5f23e commit 97de036
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions tf_agents/environments/batched_py_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ def _step(self, actions):
return nest_utils.stack_nested_arrays(time_steps)

def seed(self, seed: types.Seed) -> Any:
"""Seeds the environment.
Args:
seed: Value to use as seed for the environment.
"""
"""Seeds the environment."""
return self._execute(lambda env: env.seed(seed), self._envs)

def get_state(self) -> Any:
Expand All @@ -197,8 +193,8 @@ def get_state(self) -> Any:
def set_state(self, state: Sequence[Any]) -> None:
"""Restores the environment to a given `state`."""
self._execute(
lambda env_and_state: env_and_state[0].set_state(env_and_state[1]),
zip(self._envs, state)
lambda env_state: env_state[0].set_state(env_state[1]),
zip(self._envs, state)
)

def render(self, mode="rgb_array") -> Optional[types.NestedArray]:
Expand Down
2 changes: 0 additions & 2 deletions tf_agents/environments/batched_py_environment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def test_get_info_gym_env(self, multithreading):
@parameterized.parameters(*COMMON_PARAMETERS)
def test_seed_gym_env(self, multithreading):
num_envs = 5
rng = np.random.RandomState()
gym_env = self._make_batched_mock_gym_py_environment(
multithreading, num_envs=num_envs
)
Expand All @@ -144,7 +143,6 @@ def test_seed_gym_env(self, multithreading):
@parameterized.parameters(*COMMON_PARAMETERS)
def test_state_gym_env(self, multithreading):
num_envs = 5
rng = np.random.RandomState()
gym_env = self._make_batched_mock_gym_py_environment(
multithreading, num_envs=num_envs
)
Expand Down

0 comments on commit 97de036

Please sign in to comment.