Skip to content

Commit

Permalink
style: polish code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaiejj committed Jul 4, 2024
1 parent 436dbdd commit f56875b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@


def pytest_ignore_collect(path, config):
if os.path.basename(path) == 'meta_drive_env.py' and not meta_drive_env_available:
return True
return False
return os.path.basename(path) == 'meta_drive_env.py' and not meta_drive_env_available
6 changes: 3 additions & 3 deletions omnisafe/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 OmniSafe Team. All Rights Reserved.
# Copyright 2024 OmniSafe Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,8 +25,8 @@

try:
prefix, sep, suffix = (
subprocess.check_output(
['git', 'describe', '--abbrev=7'], # noqa: S603,S607
subprocess.check_output( # noqa: S603
['git', 'describe', '--abbrev=7'], # noqa: S607
cwd=os.path.dirname(os.path.abspath(__file__)),
stderr=subprocess.DEVNULL,
text=True,
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ignore-words = "docs/source/spelling_wordlist.txt"
target-version = "py38"
line-length = 100
src = ["omnisafe", "tests", "examples"]
select = [
lint.select = [
"E", "W", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
Expand All @@ -152,7 +152,7 @@ select = [
"TID", # flake8-tidy-imports
"RUF", # ruff
]
ignore = [
lint.ignore = [
# E501: line too long
# W505: doc line too long
# too long docstring due to long example blocks
Expand All @@ -171,9 +171,9 @@ ignore = [
# use alias for import convention (e.g., `import torch.nn as nn`)
"PLR0402",
]
typing-modules = ["omnisafe.typing"]
lint.typing-modules = ["omnisafe.typing"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # unused-import
]
Expand Down Expand Up @@ -235,15 +235,15 @@ typing-modules = ["omnisafe.typing"]
"ANN003", # Missing type annotation
]

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
multiline-quotes = "double"
inline-quotes = "single"

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_vector_onpolicy_buffer(
assert (
vector_buffer.standardized_adv_r == standardized_adv_r
), f'vector_buffer.sstandardized_adv_r is {vector_buffer.sstandardized_adv_r}'
assert vector_buffer.buffers is not [], f'vector_buffer.buffers is {vector_buffer.buffers}'
assert vector_buffer.buffers != [], f'vector_buffer.buffers is {vector_buffer.buffers}'

# checking the store function
obs_dim = obs_space.shape[0]
Expand Down

0 comments on commit f56875b

Please sign in to comment.