Skip to content

Commit

Permalink
resolve flake8 pre commits
Browse files Browse the repository at this point in the history
  • Loading branch information
felixchalumeau committed Mar 10, 2023
1 parent 98ed194 commit c8d0c2f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion qdax/core/containers/mapelites_repertoire.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ def init(
(
"This type of repertoire does not store the extra scores "
"computed by the scoring function"
)
),
stacklevel=2,
)

# retrieve one genotype from the population
Expand Down
3 changes: 2 additions & 1 deletion qdax/core/containers/mome_repertoire.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ def init( # type: ignore
(
"This type of repertoire does not store the extra scores "
"computed by the scoring function"
)
),
stacklevel=2,
)

# get dimensions
Expand Down
14 changes: 11 additions & 3 deletions qdax/environments/exploration_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def __init__(self, env: env.Env, env_name: str) -> None:
):
raise NotImplementedError(f"This wrapper does not support {env_name} yet.")
if env_name not in ["ant", "humanoid"]:
warnings.warn("Make sure your agent can move in two dimensions!")
warnings.warn(
"Make sure your agent can move in two dimensions!",
stacklevel=2,
)
super().__init__(env)
self._env_name = env_name
# update the env config to add the trap
Expand Down Expand Up @@ -367,9 +370,14 @@ def __init__(self, env: env.Env, env_name: str) -> None:
or env_name not in COG_NAMES.keys()
or env_name not in ENV_MAZE_COLLISION.keys()
):
raise NotImplementedError(f"This wrapper does not support {env_name} yet.")
raise NotImplementedError(
f"This wrapper does not support {env_name} yet.",
)
if env_name not in ["ant", "humanoid"]:
warnings.warn("Make sure your agent can move in two dimensions!")
warnings.warn(
"Make sure your agent can move in two dimensions!",
stacklevel=2,
)
super().__init__(env)
self._env_name = env_name
self._config = (
Expand Down
2 changes: 1 addition & 1 deletion tests/utils_test/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_csv_logger() -> None:
csv_logger.log(metrics)

metrics = {"bad_name": 0.0, "max_fitness": 0.0, "coverage": 0.0}
with pytest.raises(Exception):
with pytest.raises(Exception): # noqa: B017
csv_logger.log(metrics)

file_exist = os.path.exists(file_location)
Expand Down

0 comments on commit c8d0c2f

Please sign in to comment.