Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#58)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v2.3.0 → v4.6.0](pre-commit/pre-commit-hooks@v2.3.0...v4.6.0)
- [github.com/astral-sh/ruff-pre-commit: v0.1.11 → v0.4.7](astral-sh/ruff-pre-commit@v0.1.11...v0.4.7)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jun 4, 2024
1 parent e31bd71 commit 21fc1ec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
rev: v0.4.7
hooks:
- id: ruff
# types_or: [ python, pyi, jupyter ]
Expand Down
11 changes: 9 additions & 2 deletions bayes3d/neural/dino.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def interpolate_pos_encoding(
# compute number of tokens taking stride into account
w0 = 1 + (w - patch_size) // stride_hw[1]
h0 = 1 + (h - patch_size) // stride_hw[0]
assert w0 * h0 == npatch, f"""got wrong grid size for {h}x{w} with patch_size {patch_size} and
assert (
w0 * h0 == npatch
), f"""got wrong grid size for {h}x{w} with patch_size {patch_size} and
stride {stride_hw} got {h0}x{w0}={h0 * w0} expecting {npatch}"""
# we add a small number to avoid floating point error in the interpolation
# see discussion at https://github.com/facebookresearch/dino/issues/8
Expand Down Expand Up @@ -399,7 +401,12 @@ def extract_descriptors(
:param bin: apply log binning to the descriptor. default is False.
:return: tensor of descriptors. Bx1xtxd' where d' is the dimension of the descriptors.
"""
assert facet in ["key", "query", "value", "token"], f"""{facet} is not a supported facet for descriptors.
assert facet in [
"key",
"query",
"value",
"token",
], f"""{facet} is not a supported facet for descriptors.
choose from ['key' | 'query' | 'value' | 'token'] """
self._extract_features(batch, [layer], facet)
x = self._feats[0]
Expand Down
1 change: 1 addition & 0 deletions bayes3d/utils/r3d_loader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Preprocess an unzipped .r3d file to the Record3DDataset format.
"""

import glob
import json
import os
Expand Down
3 changes: 2 additions & 1 deletion scripts/_mkl/notebooks/nbexporter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Exports notebooks to `.py` files using `nbdev.nb_export`.
Exports notebooks to `.py` files using `nbdev.nb_export`.
"""

import glob
import os
from pathlib import Path
Expand Down

0 comments on commit 21fc1ec

Please sign in to comment.