Skip to content

Commit

Permalink
Update pre-commit hook versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuguangw committed Oct 29, 2023
1 parent e88f45f commit fa64806
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright [2023] Boston Dynamics AI Institute, Inc.
# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved.

repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.263'
rev: 'v0.1.0'
hooks:
- id: ruff
args: ['--fix', '--config', 'pyproject.toml']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
args: ['--unsafe']
Expand All @@ -21,15 +21,15 @@ repos:
- id: check-shebang-scripts-are-executable

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.10.0
hooks:
- id: black
language_version: python3.9
args: ['--config', 'pyproject.toml']
verbose: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.6.1
hooks:
- id: mypy
pass_filenames: false
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ dependencies = [

[project.optional-dependencies]
dev = [
"pre-commit >= 3.1.1",
"pytest >= 7.2.1",
"pytest-cov >= 4.0.0",
"pre-commit >= 3.5.0",
"pytest >= 7.3.1",
"pytest-cov >= 4.1.0",
]
habitat = [
"habitat-sim @ git+https://github.com/facebookresearch/[email protected]",
Expand Down Expand Up @@ -118,7 +118,7 @@ preview = true

# mypy configuration
[tool.mypy]
python_version = "3.9"
python_version = "3.10"
disallow_untyped_defs = true
ignore_missing_imports = true
explicit_package_bases = true
Expand All @@ -127,5 +127,5 @@ strict_equality = true
warn_unreachable = true
warn_redundant_casts = true
no_implicit_optional = true
files = ['vlfm']
files = ['vlfm', 'test']
exclude = '^(docker|.*external|.*thirdparty|.*install|.*build|.*_experimental)/'
2 changes: 1 addition & 1 deletion test/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from vlfm.utils.generate_dummy_policy import save_dummy_policy


def test_load_and_save_config():
def test_load_and_save_config() -> None:
if not os.path.exists("data"):
os.makedirs("data")

Expand Down
2 changes: 1 addition & 1 deletion test/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from vlfm.utils.visualization import generate_text_image


def test_visualization():
def test_visualization() -> None:
if not os.path.exists("build"):
os.makedirs("build")

Expand Down
5 changes: 4 additions & 1 deletion vlfm/policy/utils/non_habitat_policy/rnn_state_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def build_rnn_inputs(
rnn_states: torch.Tensor,
not_dones: torch.Tensor,
rnn_build_seq_info: Dict[str, torch.Tensor],
) -> Tuple[PackedSequence, torch.Tensor,]:
) -> Tuple[
PackedSequence,
torch.Tensor,
]:
r"""Create a PackedSequence input for an RNN such that each
set of steps that are part of the same episode are all part of
a batch in the PackedSequence.
Expand Down
3 changes: 1 addition & 2 deletions vlfm/utils/geometry_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def calculate_vfov(hfov: float, width: int, height: int) -> float:
"""
# Calculate the diagonal field of view (DFOV)
dfov = 2 * math.atan(
math.tan(hfov / 2)
* math.sqrt((width**2 + height**2) / (width**2 + height**2))
math.tan(hfov / 2) * math.sqrt((width**2 + height**2) / (width**2 + height**2))
)

# Calculate the vertical field of view (VFOV)
Expand Down

0 comments on commit fa64806

Please sign in to comment.