Skip to content

Commit 21fc1ec

Browse files
authoredJun 4, 2024··
[pre-commit.ci] pre-commit autoupdate (#58)
* [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>
1 parent e31bd71 commit 21fc1ec

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed
 

‎.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.3.0
3+
rev: v4.6.0
44
hooks:
55
- id: check-yaml
66
args: [--unsafe]
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
99

1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.1.11
11+
rev: v0.4.7
1212
hooks:
1313
- id: ruff
1414
# types_or: [ python, pyi, jupyter ]

‎bayes3d/neural/dino.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def interpolate_pos_encoding(
151151
# compute number of tokens taking stride into account
152152
w0 = 1 + (w - patch_size) // stride_hw[1]
153153
h0 = 1 + (h - patch_size) // stride_hw[0]
154-
assert w0 * h0 == npatch, f"""got wrong grid size for {h}x{w} with patch_size {patch_size} and
154+
assert (
155+
w0 * h0 == npatch
156+
), f"""got wrong grid size for {h}x{w} with patch_size {patch_size} and
155157
stride {stride_hw} got {h0}x{w0}={h0 * w0} expecting {npatch}"""
156158
# we add a small number to avoid floating point error in the interpolation
157159
# see discussion at https://github.com/facebookresearch/dino/issues/8
@@ -399,7 +401,12 @@ def extract_descriptors(
399401
:param bin: apply log binning to the descriptor. default is False.
400402
:return: tensor of descriptors. Bx1xtxd' where d' is the dimension of the descriptors.
401403
"""
402-
assert facet in ["key", "query", "value", "token"], f"""{facet} is not a supported facet for descriptors.
404+
assert facet in [
405+
"key",
406+
"query",
407+
"value",
408+
"token",
409+
], f"""{facet} is not a supported facet for descriptors.
403410
choose from ['key' | 'query' | 'value' | 'token'] """
404411
self._extract_features(batch, [layer], facet)
405412
x = self._feats[0]

‎bayes3d/utils/r3d_loader.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Preprocess an unzipped .r3d file to the Record3DDataset format.
33
"""
4+
45
import glob
56
import json
67
import os

‎scripts/_mkl/notebooks/nbexporter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
22
3-
Exports notebooks to `.py` files using `nbdev.nb_export`.
3+
Exports notebooks to `.py` files using `nbdev.nb_export`.
44
55
"""
6+
67
import glob
78
import os
89
from pathlib import Path

0 commit comments

Comments
 (0)
Please sign in to comment.